cisco路由器时间戳
相关话题
思科是全球领先且顶尖的通讯厂商,出产的路由器功能也是很出色的,那么你知道cisco路由器时间戳吗?下面是小编整理的一些关于cisco路由器时间戳的相关资料,供你参考。
什么是时间戳?
时间戳(timestamp),通常是一个字符序列,唯一地标识某一刻的时间。数字时间戳技术是数字签名技术一种变种的应用。
时间戳(time-stamp)是一个经加密后形成的凭证文档,它包括三个部分:
(1)需加时间戳的文件的摘要(digest);
(2)DTS收到文件的日期和时间;
(3)DTS的数字签名。
一般来说,时间戳产生的过程为:用户首先将需要加时间戳的文件用Hash编码加密形成摘要,然后将该摘要发送到DTS,DTS在加入了收到文件摘要的日期和时间信息后再对该文件加密(数字签名),然后送回用户。
书面签署文件的时间是由签署人自己写上的,而数字时间戳则不然,它是由认证单位DTS来加的,以DTS收到文件的时间为依据。
cisco路由器时间戳:
默认情况下日志消息不包括日期和时间戳。
service timestamps {debug | log } uptime
service timestamps {debug | log } datetime [mesc] [localtime] [show-timezone] [year]
debug 参数 在调试输出时包括时间戳
log 参数 在每种日志消息中添加一个时间戳
uptime 在消息中包括路由器开机以来的时间
0w2d: #SYS-5-CONFIG_I : Configured from console by console
0w2d 开机后0周2天
datetime 显示准确的日期和时间 UTC 格式 标准格式 MM DD HH:MM:SS
datetime后面可以跟一些参数
mesc 消息中包括毫秒信息
localtime 显示基于本地配置的时区时间
show-timezone 输出包括时区名称
year 输出包括年份信息
Connected to Dynamips VM "default" (ID 0, type c7200) - Console port
使用Dynamips 测试
r1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
r1(config)#service timestamps ?
debug Timestamp debug messages
log Timestamp log messages
r1(config)#service timestamps log ?
datetime Timestamp with date and time
uptime Timestamp with system uptime
r1(config)#service timestamps log uptime 首先使用开机时间 uptime
r1(config)#do show ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.100.2 YES NVRAM up up 产生一条消息用
Serial1/0 unassigned YES NVRAM administratively down down
Serial1/1 unassigned YES NVRAM administratively down down
Serial1/2 unassigned YES NVRAM administratively down down
Serial1/3 unassigned YES NVRAM administratively down down
r1(config)#int fa 0/0
r1(config-if)#shut
r1(config-if)#
00:02:58: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
00:02:59: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
00:02:58 开机时间 。 2 3 层改变为down
r1(config-if)#exit
r1(config)#service timestamps log datetime ?
localtime Use local time zone for timestamps
msec Include milliseconds in timestamp
show-timezone Add time zone information to timestamp
year Include year in timestamp
r1(config)#service timestamps log datetime localtime msec show-timezone year
r1(config)#int fa 0/0
r1(config-if)#no shut
r1(config-if)#
*Sep 15 2007 08:18:13.923 UTC: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Sep 15 2007 08:18:14.923 UTC: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
2 3 层改变为up Sep 15 2007 08:18:13.923 UTC 7月 15日 8点 18分 13秒 923 毫秒 UTC时间
r1(config)#service timestamps debug ?
datetime Timestamp with date and time
uptime Timestamp with system uptime
r1(config)#service timestamps debug uptime
r1(config)#do debug all
This may severely impact network performance. Continue? (yes/[no]): yes
All possible debugging has been turned on
r1#
00:07:09: IP routecache flags changed on Null0,
added No CEF; now No CEF
00:07:09: IP routecache flags changed on Null0,
added No CEF; now No CEF
00:07:10: CEF: background resolution thread state:
00:07:10: Thread fast_thread: Empty
00:07:10: Thread todothread: Empty
00:07:10: Thread slow_thread: Emp
r1#un all
r1#conf t
r1(config)#service timestamps debug datetime ?
localtime Use local time zone for timestamps
msec Include milliseconds in timestamp
show-timezone Add time zone information to timestamp
year Include year in timestamp
r1(config)#$estamps debug datetime localtime msec show-timezone year
r1(config)#do debgug
This may severely impact network performance. Continue? (yes/[no]): yes
All possible debugging has been turned on
r1#
*Sep 15 2007 08:22:27.335 UTC: IP routecache flags changed on Null0,
added No CEF; now No CEF
*Sep 15 2007 08:22:27.339 UTC: IP routecache flags changed on Null0,
added No CEF; now No CEF
*Sep 15 2007 08:22:27.359 UTC: CEF: background resolution thread state:
*Sep 15 2007 08:22:27.359 UTC: Thread fast_thread: Empty
*Sep 15 2007 08:22:27.359 UTC: Thread todothread: Empty
*Sep 15 2007 08:22:27.359 UTC: Thread slow_thread: Empty
*Sep 15 2007 08:22:27.923 UTC: Local MobileIP: aging arp mobility cache entries
*Sep 15 2007 08:22:27.927 UTC: IP-ST: if_list try 0
*Sep 15 2007 08:22:27.927 UTC: IP-ST: gw_list total 0, try 0, completed list TRUE
日志消息前面有个* 。日志消息一般是从三种字符的一种开始:空格 星号 句号
空格 路由器的时钟被手动设置,或者和NTP时间服务器同步
星号 路由器的时钟没有别设置,或者没有和NTP服务器同步
句号 路由器的时钟被设置为同步,但和NTP服务器失去了联系
service timestamps debug uptime和service timestamps log uptime?
service timestamps
To configure the system to timestamp debugging or logging messages, use one of the service timestamps global configuration commands. Use the no form of this command to disable this service.
service timestamps type [uptime]
service timestamps type datetime [msec] [localtime] [show-timezone]
no service timestamps type
Syntax Description
type
Type of message to timestamp: debug or log.
uptime
(Optional) Timestamp with time since the system was rebooted.
datetime
Timestamp with the date and time.
msec
(Optional) Include milliseconds in the date and timestamp.
localtime
(Optional) Timestamp relative to the local time zone.
show-timezone
(Optional) Include the time zone name in the timestamp.
Defaults
No timestamping.
If service timestamps is specified with no arguments or keywords, default is service timestamps debug uptime.
The default for service timestamps type datetime is to format the time in UTC, with no milliseconds and no time zone name.
The command no service timestamps by itself disables timestamps for both debug and log messages.
Command Modes
Global configuration
Command History
Release Modification
10.0
This command was introduced.
Usage Guidelines
Timestamps can be added to either debugging or logging messages independently. The uptime form of the command adds timestamps in the format HHHH:MM:SS, indicating the time since the system was rebooted. The datetime form of the command adds timestamps in the format MMM DD HH:MM:SS, indicating the date and time according to the system clock. If the system clock has not been set, the date and time are preceded by an asterisk (*) to indicate that the date and time are probably not correct.
Examples
The following example enables timestamps on debugging messages, showing the time since reboot:
service timestamps debug uptime
The following example enables timestamps on logging messages, showing the current time and date relative to the local time zone, with the time zone name included:
service timestamps log datetime localtime show-timezone
Related Commands
Command Description
clock set
Manually set the system clock.
ntp
Controls access to the system's Network Time Protocol (NTP) services.
cisco路由器时间戳的评论条评论