1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > syslog 华为 服务器_配置华为交换机把日志发送到远程centos syslog服务器上

syslog 华为 服务器_配置华为交换机把日志发送到远程centos syslog服务器上

时间:2022-03-30 15:17:26

相关推荐

syslog 华为 服务器_配置华为交换机把日志发送到远程centos syslog服务器上

huawei switch:

#指定发送消息基本,表示从0-7都发送

info-centersourcedefaultchannel2logleveldebugging

#指定从哪个接口发送

info-centerloghostsourceVlanif1

#指定远程syslog服务器ip

info-centerloghost x.x.x.x

Centos Server:

vim /etc/rsyslog.conf

#启用udp 514端口监听。

$ModLoadimudp

$UDPServerRun514

#把来自两个交换机的日志分别放入到指定的log文件中。

:fromhost-ip,isequal,"x.x.x.x"/var/log/switch01.log

:fromhost-ip,isequal,"x.x.x.x"/var/log/switch02.log

#重启rsyslog服务

service rsyslog restart

测试:

在交换机上执行任何命令都被记录下来,比如:

#tail -f/var/log/switch01.log

May516:17:27switch01%%01SHELL/6/DISPLAY_CMDRECORD(s)[1]:Recordeddisplaycommandinformation.(Task=VT0,Ip=x.x.x.x,VpnName=,User=**,AuthenticationMethod="Password",Command="displayinfo-centerstatistics")

May516:17:40switch01%%01SHELL/6/DISPLAY_CMDRECORD(s)[2]:Recordeddisplaycommandinformation.(Task=VT0,Ip=x.x.x.x,VpnName=,User=**,AuthenticationMethod="Password",Command="displaycurrent-configuration")

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。