summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/perl/SNMP/examples/mibwalk.pl
blob: ae743d32453165970c86b4ac5bd62933775364cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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});