snmp error

J

jc

Hi,

I'm using the SNMP module to retrieve interfaces mac addresses (oid
1.3.6.1.2.1.2.2.1.6). Snmpwalk works fine

snmpwalk -v 1 -r 1 -t 2 -c public 127.0.0.1 .1.3.6.1.2.1.2.2.1.6.1
IF-MIB::ifPhysAddress.1 = STRING: 0:10:83:fd:dd:67

while using the ruby module

ifTable_columns = [ "1.3.6.1.2.1.2.2.1.6", ]
SNMP::Manager.open:)Host => "#{host}", :Version => :SNMPv1, :Community
=> 'public') do |manager|
manager.walk(ifTable_columns) do |row|
row.each { |vb| puts "#{vb.name.to_s} #{vb.value.to_s}
#{vb.value.asn1_type}" }
end
end

the mac address is visualized as shown

1.3.6.1.2.1.2.2.1.6.1 ýÃg OCTET STRING

instead of 0:10:83:fd:dd:67.

How can I fix it?
Thank you very mych,

JC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top