您的位置:首页 > 理论基础 > 计算机网络

日志服务器管理网络设备日志(Cisco;华为;f5;netscreen;)

2014-04-20 08:34 1756 查看


说明:

网络设备自带日志空间非常小,不利于排除故障,所以,建议把日志传输到远程日志服务器上,常用的linux下的rsyslog日志系统。日志分析软件为loganalyzer

配置日志服务器:
linux系统默认只对本机开放,需要修改配置文件开通远程机子连接,可以使用UDP或TCP,默认端口都是:514
vi /etc/rsyslogd.conf
$ModLoad imudp
$UDPServerRun 514
local1.* /var/log/cisco.log
local2.* /var/log/hw.log
local6.* /var/log/f5.log
local5.* /var/log/netscreen.log
注:修改后重启rsyslog服务,可以: netstat -nap | grep 514 查看有没有生效

1.1 Cisco网络设备配置如下:

cisco#configureterminalcisco(config)#loggingon //启用日志服务cisco(config)#logging 192.168.2.4 //日志服务器的IP地址cisco(config)#loggingfacility local1 //配置日志存储的facility ,默认是local7 (local1--local7)cisco(config)#servicetimestamps debug datetime localtime show-timezone mseccisco(config)#service timestamps log datetime localtime show-timezone msec //syslog 信息包含时间戳cisco(config)#loggingtrap notifications //日志记录级别alerts/critical/debugging/emergencies/errors/informational(默认)/notifications/warnings然后再配置acl,允许访问192.168.2.4中的udp 514端口。permitudp 192.168.2.0 0.0.0.255 host 192.168.2.4 eq 514
效果图:

1.2 F5负载网络配置:

通过SSH登录系统后台配置方法如下:一、备份原配置文件:cd/etc/syslog-ngcpsyslog-ng.conf syslog-ng.conf.default //备份原有syslog-ng的配置文件;二、修改日志配置文件visyslog-ng.conf //编辑syslog-ng.conf配置文件;在syslog-ng.conf文件中添加以下内容;l【软件V10以下版本】destinationremote_server { udp("192.168.2.4" port (514));};filterf_alllogs { level (debug...emerg);};log { source(local); filter(f_alllogs); destination(remote_server);};l【软件V10版本或更高版本】destinationremote_server { udp("192.168.2.4" port (514));};filterf_messages{ level (notice..warning);};log{ source(local); filter(f_messages); destination(remote_server);};按ESC建,输入:wq //保存所编辑的内容并退出;三、然后重启syslog-ng服务:/etc/init.d/syslog-ng restart

1.3 华为交换机配置:

system-viewinfo-centerenable //开启日志系统info-centerloghost 192.168.2.4 facility local1 language english //向日志主机输出信息info-centerloghost source Vlan-interface 11info-centersource default channel loghost log level informational//允许输出信息的模块为所有模块(default),通道为loghost,log级别informational//通道:loghost/console/monitor/trapbuffer/logbuffer/snmp/logfile//日志记录级别:emergencies/alerts/critical/errors/warnings/notifications/informational/debugging

效果图:




华为交换机同步过来的日志有点乱。

1.4 Junlpernetscreen防火墙配置:

netscreen防火墙日志配置实例1 用户登陆web界面2 选择Configuration->;Report Settings->;Syslog

3 点击'Enable Syslog messages'4 输入日志服务器的地址和端口(udp端口514)
还要配置日志级别:


效果图:



本文出自 “都市布衣” 博客,请务必保留此出处http://sunday208.blog.51cto.com/377871/1398859
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: