配置清单2-3 管理和使用系统日志
Router#show Sogging
Syslog logging:enabled(0messages dropped,0flushes,0 overruns)
Console logging:level debugging,18 messages logged
Monitor logging:level debugging,0 messages logged
Buffer logging:disabled
Trap logging:level informational,22 message lines logged
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#Soggmg buffer
Router(config)#no logging coBSole
Router(config)#^Z
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int e0 (此行及以下3行命令是为了测试日志设置结果而输入的)
Router(config-if)#no shut
Router(config-if)#shut
Router(config-if)#Z
Router#
Router#sh logging
Syslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns)
Console logging:disabled
Monitor logging: level debugging, 0 messages logged
Buffer logging:level debugging,4 messages logged
Trap logging: level informational, 26 message lines logged
Log Buffer (4096 bytes):
04:07:57: %SYS-5-CONFIGJ: Configured from console by console
04:08:08: %LINEPROTO-5-UPDOWN: Line protocol on Interface EthemetO, changed state to down
04:08:09: %LINK-5-CHANGED: Interface EthemetO, changed state to administratively down
04:08:11: %SYS-5-CONFIGJ: Configured from console by console
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no logging trap
Router(config)#no Sogging monitor
Router(config)#exit
Router#
(1)show logging命令显示了系统当前的日志设置和缓冲区里的日志信息,第1个show logging命令显示当前设置为:缓冲区日志(Buffer logging)禁用,其他日志可用。
(2)接下来在全局配置模式下输入了两条命令:logging buffer和no logging console目的是开启缓冲区日志,并关闭控制台的日志信息显示。
(3)在interface模式下发的no shut和shut命令的目的是为了制造一些事件,生成新的系统日志信息。我们可以看到,在控制台上没有任何系统信息产生。
(4)再次使用show logging命令,结果显示了在缓冲区中有4条系统日志信息,分别记录了通过Console端口的配置操作和Ethernet0接口的"Updown"变化信息。
(5)在实验的最后,演示了关闭向SNMP管理软件和Telnet客户端发送系统日志的命令,即no logging trap和no logging monitor,这两个命令实际上并不太常用。
(本节未完,待续.....)