[Nagiosplug-devel] [ nagiosplug-Bugs-756567 ] check_snmp not processing strings

SourceForge.net noreply at sourceforge.net
Sun Dec 5 14:13:02 CET 2004


Bugs item #756567, was opened at 2003-06-18 05:31
Message generated for change (Comment added) made by mattkent
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=756567&group_id=29880

Category: Argument proccessing
Group: v1.3.0 beta3
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Tony Missana (amissana)
>Assigned to: Matthew Kent (mattkent)
Summary: check_snmp not processing strings

Initial Comment:
When I upgraded the software to Nagios 1.1 from 
Netsaint 7, the check_snmp plugin stopped working for 
any strings.
I have included the output below from one of the string 
checks.

[nagios at w2linux libexec]$ ./check_snmp -H w3linux -o 
system.sysName.0 -C public
SNMP OK - w3linux
[nagios at w2linux libexec]$ ./check_snmp -H w3linux -o 
system.sysName.0 -C public -s w3linux
SNMP CRITICAL - *w3linux*

As can be seen without the -s option the plugin come 
back with an ok status,  when I add the -s it always 
comes back critical even though is is an exact match.  
Enclosing string variable in single and double quotes 
yields the same invalid output.

Plugins are from the 1.3.0 build.  

----------------------------------------------------------------------

>Comment By: Matthew Kent (mattkent)
Date: 2004-12-05 14:12

Message:
Logged In: YES 
user_id=983566

Sorry for the delay. Fixed in HEAD. 

Now the output of 
./check_snmp -H 127.0.0.1 -o sysServices.0 -C public
SNMP OK - 79

Can be used to match properly
./check_snmp -H 127.0.0.1 -o sysServices.0 -C public -s 79
SNMP OK - 79

----------------------------------------------------------------------

Comment By: Tony Missana (amissana)
Date: 2003-06-18 07:17

Message:
Logged In: YES 
user_id=31338

Found a workaround for the problem, added the -OQ 
parameter to the end of the command line which removes the 
type designation i.e STRING: from the return.  Program is now 
processing string  correctley.  Output below.

/* create the command line to execute */
	asprintf (&command_line, "%s -m %s -v %s %s %
s:%s %s -OQ",
	          PATH_TO_SNMPGET, miblist, proto, authpriv, 
server_address, port, oid);
	if (verbose)
		printf ("%s\n", command_line);

Correct output:
[nagios at w2linux plugins]$ ./check_snmp -H w3linux -C public -
o system.sysName.0 -s w3linux
SNMP OK - w3linux

Put invalid string and it compared correctly.

[nagios at w2linux plugins]$ ./check_snmp -H w3linux -C public -
o system.sysName.0 -s w1linux
SNMP CRITICAL - *w3linux*


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=756567&group_id=29880




More information about the Devel mailing list