[Nagiosplug-help] check_snmp handling of multiline status

Kyle Tucker kylet at panix.com
Fri Mar 24 05:46:00 CET 2006


Hi all,

Through Nagios, I am running a Net-SNMP "extend" script on a host that 
calls a series of like check_snmp commands on a second system (its cold
backup) that cannot be reached by the Nagios server directly. Anyway,
the script kicks back a multiline response like this and returns the
higheste exitstatus found by all the check_snmp commands.

sh /usr/local/lib/nagios/plugins/check_secondary   
SNMP CRITICAL - *1* 0 proc1 Too few proc1 running (# = 0) 
SNMP CRITICAL - *1* 0 proc2 Too few proc2 running (# = 0) 
SNMP CRITICAL - *1* 0 proc3 Too few proc3 running (# = 0) 
SNMP CRITICAL - *1* 0 proc4 Too few proc4 running (# = 0) 
SNMP CRITICAL - *1* 0 proc5 Too few proc5 running (# = 0) 
SNMP CRITICAL - *2* Rule file is empty 

But check_snmp puts this series odd "summary" before the | delimeter which
seems to include the first line and the last line but it also puts these
substrings "0) " of the (# = 0)'s for each of the 5 proc lines in the 
multiline output. Also, the spaces in (# = 0) are being removed.

+ /usr/local/nagios/libexec/check_snmp -vvv -t 30 -P 3 -H xxx.xxx.xx.xx -L authPriv -U xxxxxx -a MD5 -A yyyyyy -X zzzzzz -o nsExtendResult."check-secondary",nsExtendOutputFull."check-secondary" -w 0 -c 1
/usr/local/bin/snmpget -t 30 -r 5 -m ALL -v 3 -l authPriv -a MD5 -u xxxxxx -A yyyyyy -x DES -X zzzzzz  xxx.xxx.xx.xx:161  nsExtendResult."check-secondary" nsExtendOutputFull."check-secondary"
NET-SNMP-EXTEND-MIB::nsExtendResult."check-secondary" = INTEGER: 2
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."check-secondary" = STRING: SNMP CRITICAL - *1* 0 proc1 Too few proc1 running (# = 0) 
SNMP CRITICAL - *1* 0 proc2 Too few proc2 running (# = 0) 
SNMP CRITICAL - *1* 0 proc3 Too few proc3 running (# = 0) 
SNMP CRITICAL - *1* 0 proc4 Too few proc4 running (# = 0) 
SNMP CRITICAL - *1* 0 proc5 Too few proc5 running (# = 0) 
SNMP CRITICAL - *2* Rule file is empty 

SNMP CRITICAL - *2* SNMP CRITICAL - *1* 0 proc1 Too few proc1 running (# = 0)  0)  0)  0)  0) SNMP CRITICAL - *2* Rule file is empty 
 | NET-SNMP-EXTEND-MIB::nsExtendResult."check-secondary"=2;;;; NET-SNMP-EXTEND-MIB::nsExtendOutputFull."check-secondary"=SNMP CRITICAL - *1* 0 proc1 Too few proc1 running (# = 0) ;;;; SNMP CRITICAL - *1* 0 proc2 Too few proc2 running (#=0) ;;;; SNMP CRITICAL - *1* 0 proc3 Too few proc3 running (#=0) ;;;; SNMP CRITICAL - *1* 0 proc4 Too few proc4 running (#=0) ;;;; SNMP CRITICAL - *1* 0 proc5 Too few proc5 running (#=0) SNMP CRITICAL - *2* Rule file is empty 
;;;;  

Can anyone intimate with check_snmp's C code tell me where in the code these
two actions may be occuring? I have trouble reading other people's code and
there's no comments and the gdb I compiled seg faults. :(  Thanks.

p.s. Can someone explain the 4 semicolons and what might get put in there?

-- 
- Kyle 
---------------------------------------------
kylet at panix.com   http://www.panix.com/~kylet    
---------------------------------------------

-- 
- Kyle 
---------------------------------------------
kylet at panix.com   http://www.panix.com/~kylet    
---------------------------------------------




More information about the Help mailing list