check_snmp issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bmccarthy
Posts: 3
Joined: Tue Jul 08, 2014 11:40 am

check_snmp issue

Post 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.
Last edited by dwhitfield on Tue Oct 11, 2016 1:15 pm, edited 1 time in total.
Reason: marking with green check mark
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_snmp issue

Post 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
Former Nagios employee
https://www.mcapra.com/
bmccarthy
Posts: 3
Joined: Tue Jul 08, 2014 11:40 am

Re: check_snmp issue

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_snmp issue

Post 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?
Former Nagios employee
https://www.mcapra.com/
bmccarthy
Posts: 3
Joined: Tue Jul 08, 2014 11:40 am

Re: check_snmp issue

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_snmp issue

Post 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!
Locked