Debian Codegraph @

perl/SNMP/examples/mibwalk.pl

raw
1 # snmpwalk of entire MIB
2 # stop on error at end of MIB
3
4 use SNMP 1.8;
5 $SNMP::use_sprint_value = 1;
6 my $host = shift || localhost;
7 my $comm = shift || public;
8
9 $sess = new SNMP::Session(DestHost => $host, Community => $comm);
10
11 $var = new SNMP::Varbind([]);
12
13 do {
14 $val = $sess->getnext($var);
15 print SNMP::Varbind::tag($var).".".SNMP::Varbind::iid($var)." = ".
16 SNMP::Varbind::val($var)."\n";
17 } until ($sess->{ErrorStr});