OT: snmpwalk output format query

Ford, Andy andrew.ford at wachovia.com
Sun Jun 8 19:51:09 CEST 2008


> > 
> > #!/usr/bin/perl
> > use warnings;
> > use strict;
> > 
> > my @names = `snmpwalk -v2c -cpublic localhost system`;
> > my @numbers = `snmpwalk -On -v2c -cpublic localhost system`;
> > 
> > foreach my $i (0..$#names) {
> > 	print "$names[$i] $numbers[$i]\n\n";
> > }
> 
> Apparently, it's slightly too basic... or my switch is pretty 
> stupid.  :-)
> 
> As I had wondered might happen, those two commands apparently do not
> enumerate deterministically the same (though I can't see why they
> wouldn't...); the MIB items slip out of sync by the end. It's a start
> though, and I have a perl guy in house.

Wow, that's a surprising result. I guess I'd do this then:

Get the names via a walk, then loop over the walk results and do a
separate snmpget -On on each OID name.
 


Wachovia Securities, LLC's outgoing and incoming e-mails are electronically
archived and subject to review and/or disclosure to someone other
than the recipient.

A.G. Edwards, a division of Wachovia Securities, LLC




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
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