|Pathologically Eclectic Rubbish Lister|
Net::SNMP ignoring/omitting charactersby Hagalaz (Initiate)
|on Apr 09, 2015 at 16:18 UTC||Need Help??|
Hagalaz has asked for the wisdom of the Perl Monks concerning the following question:
Greetings everyone. I am having an issue (basically an inconsistency in its behavior) with a bit of code using the module Net::SNMP to retrieve a value that is encoded as a Hex-string. Using regular snmpget in the shell, without any arguments, this is what I get:
If I use the -Ox command line argument, the result is
Which is the correct result. Now, however, if I do the same with Net::SNMP...
I should get the same as the snmpget above, correct? And yet, I am not getting it:
And if I use unpack ('H*', $response), I get:
Which shows the two bytes that are missing, corresponding to the semi-colon (;) that is present in the original snmpget.
There's basically one character in the hex string (two bytes) missing, and I have no idea why or how to fix it. Several hours of google searches, reading the module's CPAN page, scanning perlmonks and another well known questions and answer sites have been fruitless. I've been using Net::SNMP for a long time, quite intensively even, and had never had such an issue.
I therefore turn to perlmonks, hoping that someone might have ran into this issue, and knows what the problem (and its solution) is.
Thank you very much in advance for your time (and pardon any imprecision, it is my first post here),
p.s. No, this doesn't just happen with the semicolon, I have ran into other cases with this OID.