check_snmp problem

Jan Scholten Jan.Scholten at iconz.net
Wed Nov 10 23:27:43 CET 2004


> I am testing check_snmp.
Fine :-)


> I run the following command:
> /check_snmp -H localhost -o .1.3.6.1.4.1.2021.9.1.100.1 -C <COM_NAME>
> -c 1
> 
> I get the following answer:
> SNMP OK - 0

What do you want to test? if it is 0 or of its not?
> 
> 
> I am having a problem with the -s option of the command.  The help says:
> -s, --string=STRING
>     Return OK state (for that OID) if STRING is an exact match

I think that will only work if the output is a string and not a integer: 
try "snmpwalk -c <COM_NAME> -v 1 localhost .1.3.6.1.4.1.2021.9.1.100.1"

I think it will output something like IF-MIB::SomeName = INTEGER: 0

And i believe it will only work if the snmp value is a string!


> So I alter the command to read:
> /check_snmp -H localhost -o .1.3.6.1.4.1.2021.9.1.100.1 -C <COM_NAME>
> -c 1 -s "SNMP OK - BAD"
> 
> And I still get:
> SNMP OK - 0
> 
> What am I doing wrong?  Any help would be appreciated.

Try that way (without string)

If you want a critical if the value is 0 try:
/check_snmp -H localhost -o .1.3.6.1.4.1.2021.9.1.100.1 -C <COM_NAME> -c 1:

1: means at least 1  so everything 1 or more is ok else critical

if you want to have a ok if its 0 an critical else try: -c :0
so everything below or 0 are fine (try 0:0 if you want only 0 to be ok)


> Thanks

Hope that helps
Jan


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
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