/
test.rb
33 lines (26 loc) · 864 Bytes
/
test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "lib/em/syslog"
#SYSLOG_SERVER = '192.168.249.134'
SYSLOG_SERVER = '0.0.0.0'
SYSLOG_PORT = 514
#EM.kqueue
#EM.epoll
EM.run {
# This is gonna be our 'syslog' server for testing to make sure we're getting the correct packets
#EM.open_datagram_socket SYSLOG_SERVER, SYSLOG_PORT do |c|
# def c.receive_data data
# p data
# end
#end
EM.syslog_setup(SYSLOG_SERVER, SYSLOG_PORT)
EM.add_periodic_timer(1) {
EM.emergency('system is unusable')
EM.alert('action must be taken immediately')
EM.critical('critical conditions')
EM.error('error conditions')
EM.warning('warning conditions')
EM.notice('normal but significant conditions')
EM.informational('informational messages')
EM.info('informational messages (short name for the previous)')
EM.debug('debug-level messages')
}
}