X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=userapps%2Fopensource%2Fnet-snmp%2Fperl%2FSNMP%2Fexamples%2Fmibwalk.pl;fp=userapps%2Fopensource%2Fnet-snmp%2Fperl%2FSNMP%2Fexamples%2Fmibwalk.pl;h=ae743d32453165970c86b4ac5bd62933775364cc;hb=9dffd9f7659a1b28265e0dc9497343eb3d108d02;hp=0000000000000000000000000000000000000000;hpb=e48c2529a5a7e7dbf1797bb6d1bf964bc03e78a7;p=bcm963xx.git diff --git a/userapps/opensource/net-snmp/perl/SNMP/examples/mibwalk.pl b/userapps/opensource/net-snmp/perl/SNMP/examples/mibwalk.pl new file mode 100644 index 00000000..ae743d32 --- /dev/null +++ b/userapps/opensource/net-snmp/perl/SNMP/examples/mibwalk.pl @@ -0,0 +1,17 @@ +# snmpwalk of entire MIB +# stop on error at end of MIB + +use SNMP 1.8; +$SNMP::use_sprint_value = 1; +my $host = shift || localhost; +my $comm = shift || public; + +$sess = new SNMP::Session(DestHost => $host, Community => $comm); + +$var = new SNMP::Varbind([]); + +do { + $val = $sess->getnext($var); + print "$var->[$SNMP::Varbind::tag_f].$var->[$SNMP::Varbind::iid_f] = ", + "$var->[$SNMP::Varbind::val_f]\n"; +} until ($sess->{ErrorStr});