trouble w/SNMP

Natalie Aloi naloi at experisdatacenters.com
Fri Apr 10 20:23:18 CEST 2009


Thanks Allan! That's what its doing a getnext - see below!
note mib oid and value!

[root at nagios mibwalk]# snmpgetnext -v 1 -c public 10.1.102.40 SNMPv2-SMI::mib-2.33.1.1.5.0
SNMPv2-SMI::mib-2.33.1.2.1.0 = INTEGER: 1
[root at nagios mibwalk]#

hmmm now I need to figure out how to tell nagios to do a walk on that oid...

-----Original Message-----
From: Allan Clark [mailto:allanc at chickenandporn.com]
Sent: Friday, April 10, 2009 01:57 PM
To: 'Natalie Aloi'
Cc: 'Nagios Users Mail-list'
Subject: Re: [Nagios-users] trouble w/SNMP



2009/4/10 Natalie Aloi <naloi at experisdatacenters.com>

(moved top-post)

-----Original Message-----
From: Allan Clark [mailto:allanc at chickenandporn.com]
Sent: Friday, April 10, 2009 01:19 PM
To: 'Natalie Aloi'
Cc: 'Nagios Users Mail-list'
Subject: Re: [Nagios-users] trouble w/SNMP

On Fri, Apr 10, 2009 at 12:57, Natalie Aloi <aloi at experisdatacenters.com> wrote:


I am trying to get something to work in Nagios and my command generates a response of unknown, but the snmpwalk generates a value of 2
I also tried another oid and the values generated are identical for the snmpwalk and the snmpget

(the one for the upsBatteryStatus is the one I am curious about)


[root at nagios mibwalk]# /usr/lib/nagios/plugins/check_snmp -H 10.1.102.40 -C public -o SNMPv2-SMI::mib-2.33.1.2.2.0
SNMP OK - 0 seconds | UPS-MIB::upsSecondsOnBattery.0=0 seconds

[root at nagios mibwalk]# /usr/lib/nagios/plugins/check_snmp -H 10.1.102.40 -C public -o SNMPv2-SMI::mib-2.33.1.2.1.0
SNMP OK - unknown(1) | UPS-MIB::upsBatteryStatus.0=unknown(1)
[root at nagios mibwalk]#

Data from snmpwalk is below:


UPS-MIB::upsBatteryStatus.0 = INTEGER: batteryNormal(2)
UPS-MIB::upsSecondsOnBattery.0 = INTEGER: 0 seconds





try something like:

 snmpget -v 1 -c public 10.1.102.40 SNMPv2-SMI::mib-2.33.1.2.1.0

Assuming SNMP-v1; try with "-v 2c" as well, to see which one matches your results. I don't have a commandline available to check which the snmp command plugin uses, but maybe this will give you an idea whether the snmpwalk differs form the snmpget result, perhaps an avenue to investigate further.

Allan




> [root at nagios mibwalk]# snmpget -v 1 -c public 10.1.102.40 SNMPv2-SMI::mib-2.33.1.2.1.0
> SNMPv2-SMI::mib-2.33.1.2.1.0 = INTEGER: 1
> [root at nagios mibwalk]#
> 

> Huh? - weird! why would snmpget give me 1, but walk gives me 2?

If we assume Nagios is doing snmpget rather than snmpwalk, then the problem is slightly different: how would we get snmpget to produce the desired/accurate "2" rather than "1".

For giggles, try:

snmpget -v 1 -c public 10.1.102.40 SNMPv2-SMI::mib-2.33.1.2.1

(dropping the .0)

I'm curious about this because I remember something with snmpwalk needing a .0 in places where snmpget didn't seem to. Don't recall exactly what it was.

Allan
-- 
allanc at chickenandporn.com "金鱼" http://linkedin.com/in/goldfish
please, no proprietary attachments (http://tinyurl.com/cbgq)
Sent from New York, NY, United States 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090410/3b1ba037/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
-------------- next part --------------
_______________________________________________
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