Re: Retriving IfPhysAddress using Perl doesn't work

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 30/04/07, Marco Bettiol <[email protected]> wrote:
> Querying by snmpget/walk is ok:
> Example:
> #####
> $>  snmpwalk -c public -v 2c 192.168.5.100 ifPhysAddress.8
> IF-MIB::ifPhysAddress.8 = STRING: 0:14:bf:d2:67:e5
>
>
> but trying with perl gives this...


> my $s = new SNMP::Session (DestHost => "192.168.5.100", Version=>"2c");
> print ($s->get('ifPhysAddress.8'));
> ########
> THE OUTPUT:  "��g"


Rather than simply printing the output as a text string,
try saving the result into another variable.  Then investigate
what format that value might be.

I'm not in a position to test this right now, but I suspect it
may well be a six-character binary string.  What happens
if you split this string into six separate integer values,
and print each one in hex?

Dave
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.