Tags: Huawei switch log syslog
huawei switch:
#Specify sending message basic, which means sending from 0-7
info-center source default channel 2 log level debugging
#Specify from which interface to send
info-center loghost source Vlanif1
#Specify the remote syslog server IP
info-center loghost x.x.x.x
Centos Server:
vim /etc/rsyslog.conf
#Enable udp 514 port listening.
$ ModLoad imudp
$ UDPServerRun 514
# Put the logs from the two switches into the specified log files.
: fromhost-ip, isequal, "x.x.x.x" /var/log/switch01.log
: fromhost-ip, isequal, "x.x.x.x" /var/log/switch02.log
#Restart the rsyslog service
service rsyslog restart
test:
Any commands executed on the switch are recorded, such as:
#tail -f /var/log/switch01.log
May 5 16:17:27 switch01 %% 01SHELL / 6 / DISPLAY_CMDRECORD (s) [1]: Recorded display command information. (Task = VT0, Ip = xxxx, VpnName =, User = **, AuthenticationMethod = "Password", Command = "display info-center statistics")
May 5 16:17:40 switch01 %% 01SHELL / 6 / DISPLAY_CMDRECORD (s) [2]: Recorded display command information. (Task = VT0, Ip = xxxx, VpnName =, User = **, AuthenticationMethod = "Password", Command = "display current-configuration")
Configure a Huawei switch to send logs to a remote centos syslog server