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
check_snmp multiplier
Re: check_snmp multiplier
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.
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.
-
- Posts: 17
- Joined: Wed Sep 05, 2018 11:10 am
Re: check_snmp multiplier
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
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.
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Re: check_snmp multiplier
Hi @michaewlewis, thanks for reaching out.
Have you tried --multiplier?
If I run check_snmp, I get this...
If I add a --multiplier of .01, I get this...
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" |
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" |
Please let us know if you have any other questions or concerns.
-Laura
-Laura
-
- Posts: 17
- Joined: Wed Sep 05, 2018 11:10 am
Re: check_snmp multiplier
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
Hi @michaewlewis,
I am glad that will work for you. I will create a request to get more precision with the --multiplier argument.
I am glad that will work for you. I will create a request to get more precision with the --multiplier argument.
Please let us know if you have any other questions or concerns.
-Laura
-Laura