snmp not working

Marc Powell marc at ena.com
Tue Nov 15 19:55:15 CET 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of HP Geeza
> Sent: Tuesday, November 15, 2005 11:26 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] snmp not working
> 
> Hi All,
> 
> I was hoping that somebody might be able to help me with a snmp
monitoring
> issue on my nagios box.  I am running the following command on the
command
> line on the nagios box:
> 
> /usr/local/nagios/libexec/./check_snmp <ip address of temp probe in
our
> lab)
> -o .1.3.6.1.4.1.2012.1.1.1.4.2.0 -C public
> 
> and get a value of SNMP "WARNING - 68" back
> 
> however i dont think that this value is correct and as a reult the
> check_snmp plugin seems to be obtaining the wrong result as i dont
expect
> this to be a warning.  For example if i run:

Well, you haven't told check_snmp if that's OK or CRITICAL so it doesn't
know what to report it as, hence WARNING. Remember the OIDs can contain
just about any kind of data and check_snmp has no idea what it is you're
querying, it just has an SNMP 'address'. You have to add in the status
intelligence.

> ./check_snmp 10.30.129.30 -o .1.3.6.1.4.1.2012.1.1.1.4.2.0 -C public
-wv
> 80
> -cv 85
> 
> i still get a value of "WARNING - 68"

I'm not sure what version of check_snmp you're using but -wv and -cv
aren't valid command line args, at least with 1.4 and prior.

> is there a different check_snmp plugin i could use? or am i just
running
> the
> command wrong?  I dont want the service to show up as a warning when
the
> temperature is 68F...hence the reason for doing -wv 80 -cv 85

You just need to tell check_snmp what to expect for each range.
Check_snmp (and a couple other plugins) behave differently than other
plugins WRT warning and critical detection as the results of the SNMP
query are highly variable. Here are a couple of examples --

To test for a very specific value where anything but that value is bad
you might use something like - 
define command{
        command_name    check_bgp_peer_state
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -o
.1.3.6.1.2.1.15.3.1.2.$ARG1$ -s 6 -C $USER3$ -l 'BGP Peer $ARG1$ State'
        }

The above will be OK if the value of that OID is 6 and CRITICAL if it's
anything else.

To check for a range of values you might use the following -

define command{ 
        command_name    check_temperature_server_sites
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -u 'Degrees
Celsius' -o .1.3.6.1.4.1.9.9.13.1.3.1.3.2 -C $USER3$ -w 37:32 -c 99:38
-l '
Temperature is' 
        }

The above will result in WARNING if the value of the OID is between 32
and 37 (inclusive), CRITICAL if it's between 38 and 99 (inclusive) and
OK for all other values.

Hope that helps. Use 'check_snmp --help' for other command line args and
their description.

--
Marc


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&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