Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2524 > unrolled thread

Re: Help decoding UDPSocket trap data

Started byChandra Sekhar <chandu.ch29@gmail.com>
First post2011-04-08 07:10 -0500
Last post2011-04-08 08:30 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Help decoding UDPSocket trap data Chandra Sekhar <chandu.ch29@gmail.com> - 2011-04-08 07:10 -0500
    Re: Help decoding UDPSocket trap data Brian Candler <b.candler@pobox.com> - 2011-04-08 08:30 -0500

#2524 — Re: Help decoding UDPSocket trap data

FromChandra Sekhar <chandu.ch29@gmail.com>
Date2011-04-08 07:10 -0500
SubjectRe: Help decoding UDPSocket trap data
Message-ID<5154874387e452bac584ca90c8da7eb9@ruby-forum.com>
Hi,

I am new to ruby.
With above example, tried Trap Listener on windows machine. However I
didn' see the traps.

My code given below:

require "rubygems"
require 'snmp'
require 'logger'


m = SNMP::TrapListener.new(:Host => 'myPcIp', :Port => 162) 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

Can anybody help on this?

Note: My PC runs on windows XP

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [next] | [standalone]


#2531

FromBrian Candler <b.candler@pobox.com>
Date2011-04-08 08:30 -0500
Message-ID<40e0762c2b07b5411e0ebd9f8c40b66b@ruby-forum.com>
In reply to#2524
Chandra Sekhar wrote in post #991736:
> I am new to ruby.
> With above example, tried Trap Listener on windows machine. However I
> didn' see the traps.

(1) Are the trap packets arriving? Run Wireshark to look for them.

(2) You probably need to set up your TrapListener with a community 
string, and your trap sender to use that same community string (for SNMP 
v2c anyway).

The example in the source code at 
http://snmplib.rubyforge.org/svn/trunk/lib/snmp/manager.rb
suggests you need to add something like :Community=>"public"

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web