Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5380957
  • 博文数量: 890
  • 博客积分: 12876
  • 博客等级: 上将
  • 技术积分: 10760
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-04 14:18
个人简介

猝然临之而不惊,无故加之而不怒。

文章分类

全部博文(890)

文章存档

2016年(1)

2014年(18)

2013年(41)

2012年(48)

2011年(65)

2010年(84)

2009年(121)

2008年(101)

2007年(129)

2006年(95)

2005年(118)

2004年(69)

分类: 系统运维

2013-04-25 17:45:02

将Cisco设备的日志发往syslog服务器,如下操作:

device#conf t
device(config)#logging on
device(config)#logging 172.16.86.102
device(config)#logging trap errors //日志记录级别,可用"?"查看详细内容
device(config)#logging source-interface loopback0 //日志发出用的源IP地址
device(config)#service timestamps log datetime localtime //日志记录的时间戳设置,可根据需要具体配置检验
device#sh logging

设置完成后,最好设置一下当前交换机或路由器的时钟。这样在日志服务器上就可以看到何时产生的日志。
switch#clock 9:48:00 21 Feb 2011

logging trap level //指定日志消息的级别

(0:紧急(Emergencies)
1:告警(Alerts)
2:严重的(Critical)
3:错误(Errors)
4:警告(Warnings)
5:通知(Notifications)
6:信息(Informational)
7:调试(Debugging))

syslog要考虑的主要是哪些日志需要发送到日志服务器上,即日志等级,
使用 如下命令:

device(config)#logging trap warning //日志记录级别,可用"?"查看详细内容

? emergency—Logs only emergency events.
? alert—Logs alert and more severe events.
? critical—Logs critical and more severe events.
? error—Logs error and more severe events.
? warning—Logs warning and more severe events.
? notice—Logs notice and more severe events.
? informational—Logs informational and more severe events.
? debug—Logs all events, including debug events.

为了防止日志量太大,一般设置成warning就行了。

阅读(1975) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~