首页 > 编程知识 正文

华为交换机配置syslog命令,华为交换机 syslog

时间:2023-05-06 05:35:38 阅读:243219 作者:2501

配置华为交换机推送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

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。