From: Joao Pompei Date: 2010-05-04T22:06:32+09:00 Subject: Re: Help decoding UDPSocket trap data jackster the jackle wrote: > I was able to get my version to work but I have to look back now and > find the exact code. > > The first thing I notice is that you are listening on port 1062 and it > should be 162, please try and change that and see if that helps. > > jackster Hello! We got the things going here. Thanks all. Jackster, I can configure witch port I want to use (default is 162, but in linux only the root user has access to that port). The problem was the ip address. I believe that linux by default doesn't address 'localhost' to eth2 (localhost binds with some line in some /etc/net/config.blabla) and because of that I wasn't receiving any messages. Here is the code that I am using now. Note the exact ip address on it: m = SNMP::TrapListener.new(:Host => '192.168.31.5', :Port => 2062) do |manager| manager.on_trap_default do |trap| trap.each_varbind { |v| puts 'OID: ' + v.name.to_s + ' Value: ' + v.value.to_s } end end m.join This code give me this answer: OID: 1.3.6.1.6.3.1.1.4.1.0 Value: 1.3.6.1.4.1.xxxx.6.1.2.2.13.7 OID: 1.3.6.1.2.1.1.5 Value: Equip_name OID: 1.3.6.1.4.1.xxxx.6.1.2.2.3.3.1.2 Value: 2 OID: 1.3.6.1.4.1.xxxx.6.1.2.2.3.3.1.3 Value: 2 OID: 1.3.6.1.2.1.1.3.0 Value: 5 days, 01:17:22.37 OID: 1.3.6.1.6.3.1.1.4.1.0 Value: 1.3.6.1.4.1.xxxx.6.1.2.2.13.15 Where xxxx is the company register on IANA. Thanks guys. Ruby forums are a very good source of solutions. Joao Pompei -- Posted via http://www.ruby-forum.com/.