Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Can't call method "bulkwalk" on unblessed reference at /usr/lib/zabbix/externalscripts/cisco_ifindex.pl line 19.
- #!/usr/bin/perl -w
- $TAGSEP = ",";
- use SNMP;
- die "Usage: $0 <host> <port> <community>" if ($#ARGV < 2);
- $sess = new SNMP::Session(DestHost => "$ARGV[0]",
- Community => "$ARGV[2]",
- Version => "2c",
- RemotePort => "$ARGV[1]",
- UseNumeric => 1,
- NonIncreasing => 1,
- UseLongNames => 1);
- die $sess->{ErrorStr} if ($sess->{ErrorNum});
- ===>>> LINE 19 ($ifInOctets, $ifDescr, $ifType, $ifAdmin, $ifInErrors, $ifHCInOctets, $ifAlias) = $sess->bulkwalk(0, 500, [
- ['.1.3.6.1.2.1.2.2.1.10'],
- ['.1.3.6.1.2.1.2.2.1.2'],
- ['.1.3.6.1.2.1.2.2.1.3'],
- ['.1.3.6.1.2.1.2.2.1.7'],
- ['.1.3.6.1.2.1.2.2.1.14'],
- ['.1.3.6.1.2.1.31.1.1.1.6'],
- ['.1.3.6.1.2.1.31.1.1.1.18']
- ]);
- die $sess->{ErrorStr} if ($sess->{ErrorNum});
- for $i (0..$#$ifInOctets) {
- $json{ $$ifInOctets[$i]->iid } = {};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement