adamZ88 has asked for the wisdom of the Perl Monks concerning the following question:
Monks, this is my very first post. I am new to Perl, and SNMP. I however have more knowledge on Cisco IOS. When I create any perl script utilizing SNMP_util and it pulls a value that is HEX-string, the output looks like so: "180.20.137.96.107.0:▒▒`k'" The funny looking characters are supposed to be a mac address Expressed like so: FF FF FF FF FF FF. The walk works just fine if I run it from shell with net-snmp the Hex-String displays just fine. The issue happens with any OID that is supposed to pull Hex-Strings. Please Help. I think that the result of the snmpwalk is not displaying properly. But the best way to explain it is "it looks like a mushed together bar-code, it is by no means any alphanumeric characters. Additionaly, I have not found any documetation on SNMP_util.pm. Can you please point me to where I can find that Documentation? Thanks!
#!/usr/bin/perl use SNMP_util; $comunity = "rushnet"; $host = shift; $testOid = shift; print "----------------------------------------WALK------------------- +-------------\n"; (@result) = &snmpwalk("$comunity\@500\@$host", "$testOid"); foreach $lineBuf (@result){ print "$lineBuf\n";} print "----------------------------------------GET-------------------- +------------\n"; $result = &snmpget("$comunity\@$host", "$testOid"); #chomp($result); print "$result\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hex-String retrieval is unsuccesful on SNMP Walk form Perl
by Marshall (Canon) on Apr 12, 2016 at 18:48 UTC | |
by adamZ88 (Beadle) on Apr 12, 2016 at 19:17 UTC | |
|
Re: Hex-String retrieval is unsuccesful on SNMP Walk form Perl
by VinsWorldcom (Prior) on Apr 12, 2016 at 19:17 UTC | |
by adamZ88 (Beadle) on Apr 12, 2016 at 19:33 UTC | |
by Marshall (Canon) on Apr 12, 2016 at 21:01 UTC |