While Executing 1 perl file …..M getting this problem
Unrecognized character \x03; marked by <– HERE after PK<– HERE near column 3 at mibwalk.pl line 1.
AnyBody have any idea about it
Code--->
#!usr/bin/perl
use BER;
use SNMP_util;
use SNMP_Session;
$MIB1 = “sysLocation.0”;
$HOST = “192.168.1.150”;
($value) = &snmpget(“public\@$HOST”,”$MIB1”);
if($value) {
print “Results :$MIB1: :$value:\n”;
}
else { warn “No response from host :$HOST:\n”; }
You have to send the string in hex-format.
In my case this was not possible with the NET::SNMP module.
So I modifided the source code of this module to make it possible.
I used the following version of
Net::SNMP:See at bottom of this post for the details.
Now you can use the
set_request()function ofNet::SNMPwith a new ASN.1 type HEX_STRING.e.g.:
Net::SNMP::Message