1、安装rsyslog
rpm -qa|grep rsyslog
rsyslog-8.24.0-34.el7.x86_64
rsyslog-mysql-8.24.0-34.el7.x86_64
cd /usr/share/doc/rsyslog-8.24.0
mysql -uroot -p < mysql-createDB.sql
mysql -uroot -p Syslog
grant all on Syslog.* to rsyslog@localhost identified by '123456';
flush privileges;
2、配置rsyslog.conf
vim /etc/rsyslog.conf
在 #### MODULES #### 下添加下面两行。
$ModLoad ommysql
. :ommysql:localhost,Syslog,rsyslog,123456
/bin/systemctl restart rsyslog.service
3、配置防火墙
firewall-cmd --zone=public --add-port=514/tcp --permanent
firewall-cmd --zone=public --add-port=514/udp --permanent
firewall-cmd --reload
firewall-cmd --list-all
文章评论