Page 1 of 1

check_snmp issue

Posted: Tue Sep 06, 2016 5:14 pm
by bmccarthy
I am having an issue I can't seem to solve using check_snmp v1.4.16

Using it without the -w warning or -c critical issues, it returns data as expected:

Code: Select all

# ./check_snmp -H 192.168.0.214 -P 2c -c public -m /usr/share/snmp/mibs/MyMIB.txt -o DIFFPRES -l DIFFPRES
SNMP OK - DIFFPRES  10.56 psi  | DIFFPRES= 10.56
Notice the "psi" unit in the output above.


If I add the -w and - c I get:

Code: Select all

# ./check_snmp -H 192.168.0.214 -P 2c -c public -m /usr/share/snmp/mibs/MyMIB.txt -o DIFFPRES -l DIFFPRES -w 18 -c 20
SNMP OK - DIFFPRES 10.69 | DIFFPRES=10.69
Notice there is no "psi" this time.


I verified that the device is returning the "psi" with an snmpget:

Code: Select all

# snmpget -v 2c -c public -m /usr/share/snmp/mibs/MyMIB.txt 192.168.0.214 DIFFPRES
Sbtfp3::DIFFPRES = STRING:  10.9 psi
Has anyone experienced this behavior from check_snmp. If so, I cannot find it in this forum nor with Google. I've tried just about everything I can think of with options/switches so I'm seeking new input.

Thanks in advance for your time.

Re: check_snmp issue

Posted: Wed Sep 07, 2016 12:13 pm
by mcapra
I've replicated this when checking a system's available memory:

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.67.105 -P 2c -C welcome2 -o .1.3.6.1.4.1.2021.4.6.0
SNMP OK - 3565908 | iso.3.6.1.4.1.2021.4.6.0=3565908
With check_snmp, you should be able to define the unit yourself using the -u argument as a work-around:

Code: Select all

[root@localhost libexec]# ./check_snmp -H 192.168.67.105 -P 2c -C welcome2 -o .1.3.6.1.4.1.2021.4.6.0 -u kB
SNMP OK - 3565908 kB | iso.3.6.1.4.1.2021.4.6.0=3565908kB

Re: check_snmp issue

Posted: Wed Sep 07, 2016 2:09 pm
by bmccarthy
Thanks, mcapra. I'm glad someone else has now confirmed it. Seems like a bug to me. I'm aware of the -u switch and will most likely need to implement it. Thanks again.

Re: check_snmp issue

Posted: Wed Sep 07, 2016 3:23 pm
by mcapra
Sure thing! Your best bet in getting the problem fixed is to raise an issue on the github page for nagios-plugins:
https://github.com/nagios-plugins/nagios-plugins

Is it alright if we lock this thread and mark the issue as resolved?

Re: check_snmp issue

Posted: Tue Oct 11, 2016 12:36 pm
by bmccarthy
Sure, mcapra. Lock and mark as Resolved. I will take your suggestion and raise the issue in https://github.com/nagios-plugins/nagios-plugins. Sorry for the delayed reply. Thanks again.

Re: check_snmp issue

Posted: Tue Oct 11, 2016 1:15 pm
by dwhitfield
Glad to hear we have an easy workaround. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!