Class: SnmpTrapCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/monitor/server/snmp/snmptrap_capture.rb

Instance Method Summary collapse

Constructor Details

#initializeSnmpTrapCapture

Returns a new instance of SnmpTrapCapture.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/monitor/server/snmp/snmptrap_capture.rb', line 6

def initialize()
 if $config.snmptrap_mon
	buff=MsgBuffer.new(1)
	begin
		@input = SnmpTrapServer.new(buff)
		@output = SnmpAnalyzer.new(buff)
	rescue Errno::EADDRINUSE => msg
	rescue Errno::EACCES => msg
	   $log.error "SNMP Trap Server: not started"
	end
 end
end

Instance Method Details

#stopObject



19
20
21
22
23
24
25
# File 'lib/monitor/server/snmp/snmptrap_capture.rb', line 19

def stop()
	if @input != nil
		@input.close_socket()
	end
	$log.debug("end of SyslogServer thread")
	#output thread will be done auto
end