1 # snmpwalk of entire MIB
2 # stop on error at end of MIB
5 $SNMP::use_sprint_value = 1;
6 my $host = shift || localhost;
7 my $comm = shift || public;
9 $sess = new SNMP::Session(DestHost => $host, Community => $comm);
11 $var = new SNMP::Varbind([]);
14 $val = $sess->getnext($var);
15 print "$var->[$SNMP::Varbind::tag_f].$var->[$SNMP::Varbind::iid_f] = ",
16 "$var->[$SNMP::Varbind::val_f]\n";
17 } until ($sess->{ErrorStr});