Subject: | Data retreived is incorrect/corrupted. |
===================
- Net-SNMP-5.0.1
- # perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
- # uname -a ; cat /etc/redhat-release
Linux hostname 2.4.21-NANO #1 Tue Nov 16 12:53:19 CET 2004 i686 i686 i386 GNU/Linux
Red Hat Linux release 8.0 (Psyche)
- I'm trying to get ARP table entries from a CISCO 3750G layer3 switch.
===================
snmpget -v 2c -c "community" IPx .1.3.6.1.2.1.4.22.1.2.205.10.0.0.90
IP-MIB::ipNetToMediaPhysAddress.205.10.0.0.90 = STRING: 0:30:48:71:a:70
===================
# ./arp2.pl
.1.3.6.1.2.1.4.22.1.2.205.10.0.0.90: 0Hq
p
===================
However, for some other IP:
# ./arp2.pl
.1.3.6.1.2.1.4.22.1.2.205.10.0.0.89: 0x000e38f468c6
===================
arp2.pl snippet:
my $oid=".1.3.6.1.2.1.4.22.1.2.205.10.0.0.90";
$result = $session->get_request(
-varbindlist => [$oid]
);
if(!defined($result)) {
printf("ERROR in SNMP: %s\n", $session->error);
exit 1;
}
printf("$oid: %s", $result->{"$oid"});