From: Rocir Santiago Date: 2009-10-01T23:37:19+09:00 Subject: Re: Problems with SNMP Hi, Nicol叩s. Thanks for the reply. My switch works fine with SNMP. It's 3com Baseline Switch 2226 Plus. My doubt it's about the ruby code to find the MAC address of each computer "pluged" in my switch. I can figure out some examples at the doc page of this lib. But when I just try to get the ifPhysAddress, the application raises an error and I don't know why. Here is the code: _________ require 'snmp' ifTable_columns = ["ifIndex", "ifDescr", "ifInOctets", "ifOutOctets", "ifPhysAddress"] SNMP::Manager.open(:Host => 'xxx.xxx.xxx.xxx') do |manager| manager.walk(ifTable_columns) do |row| row.each { |vb| print "\t#{vb.value}" } puts end end _________ I just added the ifPhysAddress to the example in the site. If I just remove the ifPhysAddress, it works fine. Nicol叩s Brailovsky wrote: > Rocir, you should first check if your switch supports this > functionality. If > it does I'd try to do an snmpwalk through the complete table to find an > OID > providing a list of known mac addresses, which will most likely be > grouped > by interface (port). > > This link may come in handy: http://www.oid-info.com/index.htm > > Regards > > -- > Nicol叩s Brailovsky > - http://nicolasb.com.ar/ > - http://monosinfinitos.com.ar/ > > 2009/10/1 Rocir Santiago -- Posted via http://www.ruby-forum.com/.