check_snmp -s (and -r) not working

David Dyer-Bennet dd-b at dd-b.net
Mon Feb 20 23:29:14 CET 2012


Using check_snmp v1.4.15 (nagios-plugins 1.4.15)

[ddb at prc-mn-lnx01 dev]$ /usr/lib64/nagios/plugins/check_snmp  -H
192.168.1.254 -C XXXXXX -o 1.3.6.1.2.1.2.2.1.8.10125 -l ifOperStatus  -s
"loser" -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 192.168.1.254:161
1.3.6.1.2.1.2.2.1.8.10125
iso.3.6.1.2.1.2.2.1.8.10125 = INTEGER: 2
SNMP OK - ifOperStatus 2 | ifOperStatus=2

I'm trying to check an OID value that isn't range-related,
ifOperStatus.<port>.  As you see, I'm getting back the enum value that
means "down".  This does NOT in any way match the -s string I supplied. 
I'm still getting an "OK" return value.

(Obviously it's easy to wrap this with a script that finds the
"ifOperStatus=<int>" and returns what I need.  I'll do that if I have to.)

But...am I misunderstanding what the -s switch does?  Or is the -s switch
completely non-functional in this version?  (I've read about a change
rolled back to restore 1.4.14 behavior, but I didn't read the description
as saying the string matching was completely non-functional before that.)

I've also tried -r for regexps, same results; they seem to be completely
ignored.
-- 
David Dyer-Bennet, dd-b at dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list