Class: SyslogCapture

Inherits:
Object
  • Object
show all
Defined in:
lib/monitor/server/syslog/syslog_capture.rb

Instance Method Summary collapse

Constructor Details

#initializeSyslogCapture

Returns a new instance of SyslogCapture.



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

def initialize()
 if $config.syslog_mon
	buff=MsgBuffer.new(1)
	begin
		@input = SyslogServer.new(buff)
		@output = SyslogAnalyzer.new(buff)
	rescue Errno::EADDRINUSE => msg
	rescue Errno::EACCES => msg
	 $log.error("Syslog Server: not started")
	end
 end
end

Instance Method Details

#stopObject



19
20
21
22
23
24
25
26
# File 'lib/monitor/server/syslog/syslog_capture.rb', line 19

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