check_snmp problem

Donjuma Lee dlee at rewardsnetwork.com
Wed Nov 10 23:35:37 CET 2004


Thanks.  That helps a lot.

> What do you want to test? if it is 0 or of its not?

The 0 is the expected value.

-----Original Message-----
From: Jan Scholten
Sent: Wednesday, November 10, 2004 5:28 PM
To: Donjuma Lee
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] check_snmp problem

> 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_idU88&alloc_id065&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