1 # snmpwalk of a single table
2 # getnext of 3 columns from ipAddrEntry table
3 # stop after last row in table
7 my $host = shift || localhost;
8 my $comm = shift || public;
10 my $sess = new SNMP::Session ( DestHost => $host, Community => $comm );
12 my $vars = new SNMP::VarList([ipAdEntAddr],[ipAdEntIfIndex],[ipAdEntNetMask]);
14 for (@vals = $sess->getnext($vars);
15 $vars->[0]->tag =~ /ipAdEntAddr/ # still in table
16 and not $sess->{ErrorStr}; # and not end of mib or other error
17 @vals = $sess->getnext($vars)) {
18 print " ($vals[1]) $vals[0]/$vals[2]\n";