check_snmp multiplier

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
michaewlewis
Posts: 17
Joined: Wed Sep 05, 2018 11:10 am

check_snmp multiplier

Post 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
sgardil
Posts: 150
Joined: Wed Aug 09, 2023 9:58 am

Re: check_snmp multiplier

Post 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.
michaewlewis
Posts: 17
Joined: Wed Sep 05, 2018 11:10 am

Re: check_snmp multiplier

Post 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.
bbahn
Posts: 123
Joined: Thu Jan 12, 2023 5:42 pm

Re: check_snmp multiplier

Post 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.
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.
User avatar
lgute
Posts: 123
Joined: Mon Apr 06, 2020 2:49 pm

Re: check_snmp multiplier

Post 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" | 
Please let us know if you have any other questions or concerns.

-Laura
michaewlewis
Posts: 17
Joined: Wed Sep 05, 2018 11:10 am

Re: check_snmp multiplier

Post 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.
User avatar
lgute
Posts: 123
Joined: Mon Apr 06, 2020 2:49 pm

Re: check_snmp multiplier

Post 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.
Please let us know if you have any other questions or concerns.

-Laura
Post Reply