交换机日志监控

部署rsyslog服务器

配置文件如下

1
2
3
4
5
6
$MaxMessageSize 64k

$template detail,"%syslogpriority-text% %syslogfacility-text% %timegenerated% %hostname% %syslogtag% %msg%n"
$template switch,"/data/logs/yz-switch/yz-switch-%$YEAR%%$MONTH%%$DAY%.log"
:hostname, contains, "-rsyslog-net" ~
*.* ?switch;detail

配置交换机

1
2
3
4
info-center logbuffer size 1024
info-center loghost source M-GigabitEthernet0/0/0
info-center loghost vpn-instance mgt_vrf 192.168.2.113 facility local6 ## 192.168.2.113是rsyslog地址
info-center source SHELL logbuffer deny