[Nagiosplug-help] How to format send/expect strings for check_udp against SNMP managed devices?

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Thu Sep 27 12:38:06 CEST 2007


> -----Original Message-----
> From: Andreas Ericsson [mailto:ae at op5.se]
> Sent: Thursday, September 27, 2007 12:00 PM
> To: Grothe, Ralph
> Cc: tom.nail at amd.com; nagiosplug-help at lists.sourceforge.net
> Subject: Re: [Nagiosplug-help] How to format send/expect
strings for
> check_udp against SNMP managed devices?
> 
> 
> Ralph.Grothe at itdz-berlin.de wrote:
> 
> ...
> 
> > or the more often used form with prepended MIB?
> > 
>  
> The correct answer is "none of the above". Use the OID directly
> instead. It's not subject to change. .1.3.6.1.2.1.1.1.0 is the
> one you want, and will save quite a bit of load every time you
> run the check.

O yeah, of course.
I forgot the avoidable overhead of MIB parsing and descriptor to
numeric OID mapping.

I could verify the OID you mentioned (which I'm sure seasoned
SNMP admins know by heart)
without paging the RFC1213-MIB by simply giving snmpget the
numeric output flag
(I can never remember such long digit dot sequences)
This also reminds me of not forgetting the leading top level
"domain" dot.

$ /usr/bin/snmpget -On -t 1 -r 5 -m RFC1213-MIB -v 1 -c public
sensor_r01:161 sysDescr.0
.1.3.6.1.2.1.1.1.0 = STRING: "sensorProbe8 v 2.0 SP8363 191006"


> 
> 
> > As the really executed snmpget command, which the -v option
> > additionally displays, implies to me
> > the second form seems to load ALL MIBs from net-snmp's mib
dirs
> > which to me seems to be more wasteful than the preselection
via
> > -m.
> > Is this true?
> > 
> 
> Yes. By default the Net-SNMP tools load all the mibs on every
> invocation. You can limit the number of mibs to load using the
> -m switch, and also tell it to load mibs from different
locations.
> 
> "-m :" will make it load no mibs at all, which is what you
want.
> The check_snmp plugin will notice if you're using an oid or a
> mib-name and act accordingly.

So when using a numeric OID I don't have to additionally pass the
mentioned "-m :"
to check_snmp to avoid the overhead 
(i.e. check_snmp will sort out the best snmpget options on its
own)?

Then this as check command will do?

$ check_snmp -v -H sensor_r01 -o .1.3.6.1.2.1.1.1.0 -P 1
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 -c public sensor_r01:161
.1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "sensorProbe8 v 2.0 SP8363 191006"

SNMP OK - "sensorProbe8 v 2.0 SP8363 191006" |
iso.3.6.1.2.1.1.1.0="sensorProbe8 v 2.0 SP8363 191006"  


Ah, it passed -m an empty string, which I guess translates to:
"avoid any MIB loading at all".



> 
> -- 
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Tel: +46 8-230225                  Fax: +46 8-230231
> 




More information about the Help mailing list