思科时间戳(Service-timestamps)配置

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

默认情况下日志消息不包括日期和时间戳。servicetimestamps{debug|log}uptimeservicetimestamps{debug|log}datetime[mesc][localtime][show-timezone][year]debug参数在调试输出时包括时间戳log参数在每种日志消息中添加一个时间戳uptime在消息中包括路由器开机以来的时间0w2d:#SYS-5-CONFIG_I:Configuredfromconsolebyconsole0w2d开机后0周2天datetime显示准确的日期和时间UTC格式标准格式MMDDHH:MM:SSdatetime后面可以跟一些参数mesc消息中包括毫秒信息localtime显示基于本地配置的时区时间show-timezone输出包括时区名称year输出包括年份信息ConnectedtoDynamipsVMdefault(ID0,typec7200)-Consoleport使用Dynamips测试r1#conftEnterconfigurationcommands,oneperline.EndwithCNTL/Z.r1(config)#servicetimestamps?debugTimestampdebugmessageslogTimestamplogmessagescrr1(config)#servicetimestampslog?datetimeTimestampwithdateandtimeuptimeTimestampwithsystemuptimecrr1(config)#servicetimestampsloguptime首先使用开机时间uptimer1(config)#doshowipintbrInterfaceIP-AddressOK?MethodStatusProtocolFastEthernet0/0192.168.100.2YESNVRAMupup产生一条消息用Serial1/0unassignedYESNVRAMadministrativelydowndownSerial1/1unassignedYESNVRAMadministrativelydowndownSerial1/2unassignedYESNVRAMadministrativelydowndownSerial1/3unassignedYESNVRAMadministrativelydowndownr1(config)#intfa0/0r1(config-if)#shutr1(config-if)#00:02:58:%LINK-5-CHANGED:InterfaceFastEthernet0/0,changedstatetoadministrativelydown00:02:59:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetodown00:02:58开机时间。23层改变为downr1(config-if)#exitr1(config)#servicetimestampslogdatetime?localtimeUselocaltimezonefortimestampsmsecIncludemillisecondsintimestampshow-timezoneAddtimezoneinformationtotimestampyearIncludeyearintimestampcrr1(config)#servicetimestampslogdatetimelocaltimemsecshow-timezoneyearr1(config)#intfa0/0r1(config-if)#noshutr1(config-if)#*Sep15200708:18:13.923UTC:%LINK-3-UPDOWN:InterfaceFastEthernet0/0,changedstatetoup*Sep15200708:18:14.923UTC:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup23层改变为upSep15200708:18:13.923UTC7月15日8点18分13秒923毫秒UTC时间r1(config)#servicetimestampsdebug?datetimeTimestampwithdateandtimeuptimeTimestampwithsystemuptimecrr1(config)#servicetimestampsdebuguptimer1(config)#dodebugallThismayseverelyimpactnetworkperformance.Continue?(yes/[no]):yesAllpossibledebugginghasbeenturnedonr1#00:07:09:IProutecacheflagschangedonNull0,addedNoCEF;nowNoCEF00:07:09:IProutecacheflagschangedonNull0,addedNoCEF;nowNoCEF00:07:10:CEF:backgroundresolutionthreadstate:00:07:10:Threadfast_thread:Empty00:07:10:Threadtodothread:Empty00:07:10:Threadslow_thread:Empr1#unallr1#conftr1(config)#servicetimestampsdebugdatetime?localtimeUselocaltimezonefortimestampsmsecIncludemillisecondsintimestampshow-timezoneAddtimezoneinformationtotimestampyearIncludeyearintimestampcrr1(config)#$estampsdebugdatetimelocaltimemsecshow-timezoneyearr1(config)#dodebgugThismayseverelyimpactnetworkperformance.Continue?(yes/[no]):yesAllpossibledebugginghasbeenturnedonr1#*Sep15200708:22:27.335UTC:IProutecacheflagschangedonNull0,addedNoCEF;nowNoCEF*Sep15200708:22:27.339UTC:IProutecacheflagschangedonNull0,addedNoCEF;nowNoCEF*Sep15200708:22:27.359UTC:CEF:backgroundresolutionthreadstate:*Sep15200708:22:27.359UTC:Threadfast_thread:Empty*Sep15200708:22:27.359UTC:Threadtodothread:Empty*Sep15200708:22:27.359UTC:Threadslow_thread:Empty*Sep15200708:22:27.923UTC:LocalMobileIP:agingarpmobilitycacheentries*Sep15200708:22:27.927UTC:IP-ST:if_listtry0*Sep15200708:22:27.927UTC:IP-ST:gw_listtotal0,try0,completedlistTRUE日志消息前面有个*。日志消息一般是从三种字符的一种开始:空格星号句号空格路由器的时钟被手动设置,或者和NTP时间服务器同步星号路由器的时钟没有别设置,或者没有和NTP服务器同步句号路由器的时钟被设置为同步,但和NTP服务器失去了联系

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功