配置:
1、rsyslog Server
去掉下面两行的注释:
vim /etc/rsyslog.conf
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
重启rsyslog服务
service rsyslog restart
2、Client
在RULES里添加:
vi /etc/rsyslog.conf
#RULES
user.* @192.168.1.1
重启rsyslog服务
service rsyslog restart
测试:
rsyslog Server
1、[root@Frank ~]# netstat -tunap | grep rsyslog(端口已经开启)
udp 0 0 0.0.0.0:514 0.0.0.0:* 3012/rsyslogd
2、[root@Frank ~]# tailf -n 2 /var/log/messages(注意,先执行该命令,再在Client里执行logger 'test')
Sep 8 07:51:48 kashu root: hellologger testlogger testlogger testlogger testlogger testlogger test!
Sep 8 07:52:12 kashu root: hello!!!!!!!!!!!
Sep 8 08:05:24 kashu root: Just a test
Client
[root@kashu ~]# logger 'hello!!!!!!!!!!!'
[root@kashu ~]# logger 'Just a test'
另参考syslog服务器端和客户端的配置:
阅读(2592) | 评论(0) | 转发(1) |