思科交换机日志服务器搭建

为了更好的监控网络设备运行装, 搭建了一套日志服务器,环境如下
server:CentOS 6.5 rsyslog
client:cisco 2960

交换机配置

config t
logging on        #开启日志功能
logging 192.168.95.5       #日志服务器地址
logging facility local0    #facility标识
logging 192.168.95.5       #日志服务器地址
logging trap 7 (log日志)   #日志记录级别
logging source-interface vlan 9    #日志发出用的源IP地址
service timestamps debug datetime localtime    #日志记录的时间戳设置

服务器设置

新建一个日志文件
touch   cisco.log         

修改配置文件

vim /etc/rsyslog.conf

# Provides UDP syslog reception       
$ModLoad imudp                        #打开udp端口
$UDPServerRun 514                  #允许接收udp514端口的信息

# Cisco syslog message
local0.*          /var/log/cisco.log             #配置local0记录位置

SYSLOGD_OPTIONS="-r -x -m 0"    #允许服务器接收外来的log日志
保存退出

service rsyslog restart          #重启rsyslog服务  

查看日志文件是否有日志
[root@vmps log]# cat /var/log/cisco.log

Apr 20 17:16:18 192.168.95.204 18354: Jul 23 20:34:07.510: %VQPCLIENT-7-RECONF: Reconfirming VMPS responses
Apr 20 17:26:18 192.168.95.204 18355: Jul 23 20:44:07.510: %VQPCLIENT-7-RECONF: Reconfirming VMPS responses
Apr 20 17:36:18 192.168.95.204 18356: Jul 23 20:54:07.511: %VQPCLIENT-7-RECONF: Reconfirming VMPS responses

猜你喜欢

转载自blog.51cto.com/9971654/2488954