×

配置华为交换机推送syslog到日志服务器

hqy hqy 发表于2019-12-19 16:52:40 浏览7010 评论0

抢沙发发表评论

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

 

————————————————

版权声明:本文为CSDN博主「weixin_41785851」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/weixin_41785851/article/details/89538780


 您阅读本篇文章共花了: 

打赏

本文链接:https://kinber.cn/post/1124.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

群贤毕至

访客