How to add a scaling factor to check_modbus results

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

How to add a scaling factor to check_modbus results

Post by ljblom »

I recently added the check_modbus plugin, and the checks are going through smoothly. However, the results need some massaging... I need to add a scaling multiple (100*2^-15) to the results in order to get Volts out. How can I add this basic math to either a service or command? Do I need to write a separate plugin? Thanks!
Last edited by dwhitfield on Tue Apr 11, 2017 12:55 pm, edited 1 time in total.
Reason: left out the "b" in the check...luckily was in subject or I would have been really confused!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to add a scaling factor to check_modbus results

Post by mcapra »

We didn't write that plugin, so the advice we can offer is a bit limited.

At a glance, it looks like you'd either need to re-write parts of the plugin (and then re-compile it) or, as you suggested, use some sort of wrapper script to massage the results. That wrapper script would then be used in a Nagios XI command definition and assigned to the service of your choosing.
Former Nagios employee
https://www.mcapra.com/
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Re: How to add a scaling factor to check_modbus results

Post by ljblom »

OK, thanks for the reply. Is it possible to add any bc commands to a nagios command?
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Re: How to add a scaling factor to check_modbus results

Post by ljblom »

Or any other generic performance data scaling mechanism?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to add a scaling factor to check_modbus results

Post by dwhitfield »

If you take a look at http://YOURSERVER/nagiosxi/includes/com ... pe=command you'll notice that you can make "any" executable a command. The question is what you do with that information.

For clarity, you mean something like /usr/bin/bc when you are asking about bc, correct?
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Re: How to add a scaling factor to check_modbus results

Post by ljblom »

Thank you, yes that's the bc I was talking about. I was hoping that you could nest a bc expression in a service or command... Looks like I need to use a wrapper for the check_modbus plugin though. Thanks for the help!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: How to add a scaling factor to check_modbus results

Post by dwhitfield »

np. Are we ready to lock this up or did you have any other questions?
ljblom
Posts: 31
Joined: Tue Feb 16, 2016 7:24 pm

Re: How to add a scaling factor to check_modbus results

Post by ljblom »

Yes, thank you.
Locked