Page 1 of 1

check_snmp multiplier

Posted: Tue Mar 12, 2024 11:17 am
by michaewlewis
I need convert an int to float on some snmp data and one of the Nagios sales guys said that check_snmp can do that sort of math in a query. I checked the man page and couldn't figure it out. It looks like the rate option might let me do what I want, but there isn't much info about how to do it.
For example, RSSI is returned as 8247, but I need to see it as 82.47 (it's actually supposed to be a negative number, but not sure if that would break anything)
Or temp needs to be decimal shifted from 715 to 71.5

Re: check_snmp multiplier

Posted: Tue Mar 12, 2024 12:14 pm
by sgardil
Hey @michaewlewis

I'm not positive on the solution, however from taking a glance multiplier would seem like the correct flag to throw to me. maybe something like adding --rate-multiplier 0.1 to the end for getting 715 to 71.5. Let me know if this works.

Re: check_snmp multiplier

Posted: Tue Mar 12, 2024 2:04 pm
by michaewlewis
I tried adding --rate-multiplier 0.1 to the end of the command and it says it has to be a positive integer. I tried changing it to 10 and it didn't change it at all.

Re: check_snmp multiplier

Posted: Tue Mar 12, 2024 5:09 pm
by bbahn
According to the man page https://nagios-plugins.org/doc/man/check_snmp.html, it says --rate-multiplier sets the seconds by which the rate is divided. i.e. --rate-multiplier 1 would give you rate/second, 60 would give you rate/minute and 3600 would give rate/hour. In your case, setting it to --rate-multiplier 10 would give you rate per 10 seconds.

Re: check_snmp multiplier

Posted: Tue Mar 12, 2024 5:16 pm
by lgute
Hi @michaewlewis, thanks for reaching out.

Have you tried --multiplier?

If I run check_snmp, I get this...

Code: Select all

# /usr/local/nagios/libexec/check_snmp -H 192.168.58.250 -C public -o enterprises.77.1.1.1.0
SNMP OK - "10" | 
If I add a --multiplier of .01, I get this...

Code: Select all

# /usr/local/nagios/libexec/check_snmp -H 192.168.58.250 -C public -o enterprises.77.1.1.1.0 --multiplier .01
SNMP OK - "0.1" | 

Re: check_snmp multiplier

Posted: Wed Mar 13, 2024 12:16 pm
by michaewlewis
I hadn't tried --multiplier. I skipped right over it somehow. That works, but it rounds the result to the nearest whole number. Not a big deal for temperature, but RSSI could benefit from a little more precision. Still better than nothing, though.

Re: check_snmp multiplier

Posted: Wed Mar 13, 2024 1:37 pm
by lgute
Hi @michaewlewis,

I am glad that will work for you. I will create a request to get more precision with the --multiplier argument.

Re: check_snmp multiplier

Posted: Thu Sep 12, 2024 2:44 pm
by PCMRobertHirabayashi
Any news on this feature? I'm monitoring electricity and the multiplier argument is really helpful, but it ends up making 0.837 into 0, which isn't ideal for measuring watts and amps.

Re: check_snmp multiplier

Posted: Fri Sep 13, 2024 9:13 am
by lgute
Hi @PCMRobertHirabayashi, thanks for reaching out.

I have incremented the weight on this issue. I do not have any control over when issues get scheduled. Requests are weighted by how many users have asked for it. Which includes forum post, contacting sales reps or contacting the support team.

Once this issue has been worked, it will show up in the CHANGELOG with this reference [GL:XI#857].