yermej wrote:
> I'm not sure, but the data format is probably dependent on the Cisco
> devices. I would check their documentation for more info.
> 
> You might also want to check out Ruby SNMP - 
> http://snmplib.rubyforge.org/
> - rather than writing your own socket routines.

Good call yermej...thanks.

I copied the basic TrapListener script as follows and am receiving traps 
that are readable:
-----------code one ---------------
require 'snmp'
require 'logger'

log = Logger.new(STDOUT)
  m = SNMP::TrapListener.new do |manager|
      manager.on_trap_default do |trap|
          log.info trap.inspect
puts "------------------"
puts logger.value
      end
  end
  m.join
----------------------------------

Interestingly enough, if I change the code a bit and print out 
"logger.value",
you see the exact type of trap formatting that I originally asked about 
in my initiail request:
-------------code two ----------------
log = Logger.new(STDOUT)
  m = SNMP::TrapListener.new do |manager|
      manager.on_trap_default do |trap|
          log.info trap.inspect
puts logger.value
      end
  end
  m.join
----------------------------------
What is the best way to get my logger values out if "code one" listed 
above so that I can manipulate them? I'd like to be able to access this 
output from "code one" for instance:
----------------------code three ------------
 @value="Interface GigabitEthernet7/12, changed state to down",
---------------------------------------------

thanks

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