Class: Net::SNMP::TrapHandler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Debug
Defined in:
lib/net/snmp/trap_handler/trap_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Debug

#print_packet, #time

Constructor Details

#initialize(&block) ⇒ TrapHandler

Returns a new instance of TrapHandler.



9
10
11
12
13
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 9

def initialize(&block)
  @listener = Net::SNMP::Listener.new
  @listener.on_message(&method(:process_trap))
  self.instance_eval(&block)
end

Instance Attribute Details

#inform_handlerObject

Returns the value of attribute inform_handler.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def inform_handler
  @inform_handler
end

#listenerObject

Returns the value of attribute listener.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def listener
  @listener
end

#messageObject

Returns the value of attribute message.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def message
  @message
end

#pduObject

Returns the value of attribute pdu.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def pdu
  @pdu
end

#v1_handlerObject

Returns the value of attribute v1_handler.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def v1_handler
  @v1_handler
end

#v2_handlerObject

Returns the value of attribute v2_handler.



6
7
8
# File 'lib/net/snmp/trap_handler/trap_handler.rb', line 6

def v2_handler
  @v2_handler
end