如果你是一名网络运维工程师,那cisco网络设备告警信息相信是你最关心的了,但并不是所有的log都是你关心的,如何才能定制你需要的log

级别呢,cisco的设备log是可以选择的

下面是配置命令,选择你需要的配置上吧
site1(config)#logging buffered ?
<0-7> Logging severity level
<4096-2147483647> Logging buffer size
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)
filtered Enable filtered logging
informational Informational messages (severity=6)
notifications Normal but significant conditions (severity=5)
warnings Warning conditions (severity=4)
xml Enable logging in XML to XML logging buffer


我一般在非核心使用的是notifications 这个级别,核心设备使用informational
比如我要配置一个logging级别是6(informational),并指定源接口,和syslog服务器地址

site1(config)#do show log #这时我还没有指定
Syslog logging: enabled (11 messages dropped, 8 messages rate-limited,
0 flushes, 0 overruns, xml disabled, filtering disabled)
Console logging: level debugging, 48 messages logged, xml disabled,
filtering disabled
Monitor logging: level debugging, 0 messages logged, xml disabled,
filtering disabled
Buffer logging: level notifications, 0 messages logged, xml disabled,
filtering disabled
Logging Exception size (4096 bytes)
Count and timestamp logging messages: disabled

No active filter modules.

Trap logging: level informational, 59 message lines logged


site1(config)#logging buffered informational
site1(config)# logging host 1.1.1.2
site1(config)#logging source-interface loopback 0

下面检查log级别是不是我所指定的
site1#show logging
Syslog logging: enabled (11 messages dropped, 8 messages rate-limited,
0 flushes, 0 overruns, xml disabled, filtering disabled)
Console logging: level debugging, 52 messages logged, xml disabled,
filtering disabled
Monitor logging: level debugging, 0 messages logged, xml disabled,
filtering disabled
Buffer logging: level informational, 3 messages logged, xml disabled, #级别已经改为informational了
filtering disabled
Logging Exception size (4096 bytes)
Count and timestamp logging messages: disabled