Существует шесть способов сбора логов с cisco маршрутизаторов:
as53xx231#conf t Enter configuration commands, one per line. End with CNTL/Z. as53xx231(config)#logging trap ? <0-7> Logging severity level alerts Immediate action needed (severity=1) critical Critical conditions (severity=2) debugging Debugging messages (severity=7) emergencies System is unusable (severity=0) errors Error conditions (severity=3) informational Informational messages (severity=6) notifications Normal but significant conditions (severity=5) warnings Warning conditions (severity=4) as53xx231(config)#logging trap debugging as53xx231(config)#logging facility local2 as53xx231(config)#logging 10.26.95.254 as53xx231(config)#exit
local2.* /var/log/cisco/cisco231.log
syslogd_enable="YES" #разрешим использовать syslog только для хостов из доверенных сетей syslogd_flags="-a 10.26.95.224/27:* -a 10.187.155.64/29:*"
> /etc/rc.d/syslogd restart
> ee /etc/newsyslog.conf ... /var/log/cisco/cisco231.log 600 7 100 * JC
iptables -A INPUT -p udp -m udp -s xxx.xxx.xxx.234 --dport 514 -i eth0 -j ACCEPT
# nano /etc/default/rsyslog #RSYSLOGD_OPTIONS="-c5" RSYSLOGD_OPTIONS="-c5 -x"
# nano /etc/rsyslog.conf $ModLoad imudp #$UDPServerAddress xxx.xxx.xxx.254 $UDPServerRun 514 local2.* -/var/log/cisco234.log # touch /var/log/cisco234.log # chown root:adm /var/log/cisco234.log
# /etc/init.d/rsyslog restart # lsof -i:514 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME rsyslogd 10020 root 3u IPv4 4999345 0t0 UDP *:syslog rsyslogd 10020 root 4u IPv6 4999346 0t0 UDP *:syslog
# nano /etc/logrotate.d/cisco_remote_log /var/log/cisco*.log { size=1M missingok rotate 5 compress delaycompress create 640 root adm }