配置华为交换机推送syslog到日志服务器 |
您所在的位置:网站首页 › 华为交换机收集日志命令在哪 › 配置华为交换机推送syslog到日志服务器 |
1、配置交换机 方法一: 配置交换机日志推送到日志主机: eg:日志主机IP地址:10.172.49.1 system-view info-center channel 6 name loghost1 info-center source default channel loghost1 log state on info-center loghost source ******* info-center loghost 10.172.49.1 channel loghost1 commit 方法二: #进入用户视图 system-view #指定发送消息基本,表示从0-7都发送 info-center source default channel 2 log level debugging #指定从哪个接口发送 info-center loghost source ******* #指定远程syslog服务器ip info-center loghost 10.172.49.1 备注:******查询方法:dis cu 查询结果如下 eg:IP对应的三层网络接口为loopback 0,用查询到的数据替换******* # interface LoopBack0 description Network_Mgmt ip address 10.4.114.1 255.255.255.255 # 2、配置日志主机 eg:centos server vim /etc/rsyslog.conf #启用udp 514端口监听。 $ModLoad imudp $UDPServerRun 514 #配置交换机日志保存文件 说明:x.x.x.x为交换机ip :fromhost-ip,isequal, "x.x.x.x" /var/log/switch01.log 重启日志配置文件 /bin/systemctl start rsyslog.service 查看配置结果: display info-center channel 6 display logbuffer display logfile file-name |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |