Page 1 of 1
How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 12:50 pm
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!
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 1:38 pm
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.
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 1:50 pm
by ljblom
OK, thanks for the reply. Is it possible to add any bc commands to a nagios command?
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 1:52 pm
by ljblom
Or any other generic performance data scaling mechanism?
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 3:11 pm
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?
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 6:03 pm
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!
Re: How to add a scaling factor to check_modbus results
Posted: Tue Apr 11, 2017 8:36 pm
by dwhitfield
np. Are we ready to lock this up or did you have any other questions?
Re: How to add a scaling factor to check_modbus results
Posted: Mon Apr 17, 2017 5:46 pm
by ljblom
Yes, thank you.