File: mibwalk.pl

package info (click to toggle)
net-snmp 5.9.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 38,720 kB
  • sloc: ansic: 282,878; perl: 17,704; sh: 12,151; makefile: 2,711; python: 734; xml: 663; pascal: 62; sql: 47
file content (17 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (7)
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 SNMP::Varbind::tag($var).".".SNMP::Varbind::iid($var)." = ".
        SNMP::Varbind::val($var)."\n";
} until ($sess->{ErrorStr});