免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3830 | 回复: 2
打印 上一主题 下一主题

ntp 对时的郁闷 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-28 18:49 |只看该作者 |倒序浏览
从NTP服务器上取得的是UTC时间(不想也没找到中国NTP服务器)  在CISCO设备上clock time zone 加了8\r\n\r\nsh clock时间是中国时间\r\n\r\n可是在日志中的时间戳却是以UTC为格式 \r\n\r\n有没有可以调整的地方..在NTP SERVER  或 设备上

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
2 [报告]
发表于 2008-04-28 19:52 |只看该作者
默认情况下日志消息不包括日期和时间戳。\r\n \r\nservice timestamps {debug | log } uptime\r\n \r\nservice timestamps {debug | log } datetime [mesc] [localtime] [show-timezone] [year]\r\n \r\ndebug  参数 在调试输出时包括时间戳\r\nlog  参数  在每种日志消息中添加一个时间戳\r\n \r\nuptime  在消息中包括路由器开机以来的时间\r\n0w2d: #SYS-5-CONFIG_I : Configured from console by console\r\n0w2d    开机后0周2天\r\n \r\ndatetime 显示准确的日期和时间  UTC 格式   标准格式 MM DD HH:MM:SS\r\n \r\ndatetime后面可以跟一些参数\r\n \r\nmesc 消息中包括毫秒信息\r\nlocaltime 显示基于本地配置的时区时间\r\nshow-timezone  输出包括时区名称\r\nyear 输出包括年份信息\r\n \r\n \r\nConnected to Dynamips VM \"default\" (ID 0, type c7200) - Console port  \r\n使用Dynamips 测试\r\n\r\nr1#conf t\r\nEnter configuration commands, one per line.  End with CNTL/Z.\r\n\r\nr1(config)#service timestamps ?\r\n  debug  Timestamp debug messages\r\n  log    Timestamp log messages\r\n  <cr>\r\n \r\nr1(config)#service timestamps log ?\r\n  datetime  Timestamp with date and time\r\n  uptime    Timestamp with system uptime\r\n  <cr>\r\n \r\nr1(config)#service timestamps log uptime   首先使用开机时间 uptime\r\n\r\nr1(config)#do show ip int br\r\nInterface                  IP-Address      OK? Method Status                Protocol\r\nFastEthernet0/0            192.168.100.2   YES NVRAM  up                    up       产生一条消息用\r\nSerial1/0                  unassigned      YES NVRAM  administratively down down    \r\nSerial1/1                  unassigned      YES NVRAM  administratively down down    \r\nSerial1/2                  unassigned      YES NVRAM  administratively down down    \r\nSerial1/3                  unassigned      YES NVRAM  administratively down down    \r\nr1(config)#int fa 0/0\r\nr1(config-if)#shut\r\nr1(config-if)#\r\n00:02:58: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down\r\n00:02:59: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down\r\n \r\n00:02:58  开机时间  。 2 3 层改变为down\r\n\r\nr1(config-if)#exit\r\n\r\nr1(config)#service timestamps log datetime ?\r\n  localtime      Use local time zone for timestamps\r\n  msec           Include milliseconds in timestamp\r\n  show-timezone  Add time zone information to timestamp\r\n  year           Include year in timestamp\r\n  <cr>\r\n\r\nr1(config)#service timestamps log datetime localtime msec show-timezone year \r\nr1(config)#int fa 0/0\r\nr1(config-if)#no shut\r\nr1(config-if)#\r\n*Sep 15 2007 08:18:13.923 UTC: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up\r\n*Sep 15 2007 08:18:14.923 UTC: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up\r\n \r\n2 3 层改变为up   Sep 15 2007 08:18:13.923 UTC  7月 15日 8点 18分 13秒 923 毫秒 UTC时间\r\n\r\nr1(config)#service timestamps debug ?\r\n  datetime  Timestamp with date and time\r\n  uptime    Timestamp with system uptime\r\n  <cr>\r\nr1(config)#service timestamps debug uptime \r\nr1(config)#do debug all\r\n \r\nThis may severely impact network performance. Continue? (yes/[no]): yes\r\nAll possible debugging has been turned on\r\nr1#\r\n00:07:09: IP routecache flags changed on Null0, \r\n         added No CEF; now No CEF\r\n00:07:09: IP routecache flags changed on Null0, \r\n         added No CEF; now No CEF\r\n00:07:10: CEF: background resolution thread state:\r\n00:07:10: Thread fast_thread: Empty\r\n00:07:10: Thread todothread: Empty\r\n00:07:10: Thread slow_thread: Emp\r\n\r\nr1#un all\r\nr1#conf t\r\nr1(config)#service timestamps debug datetime ?\r\n  localtime      Use local time zone for timestamps\r\n  msec           Include milliseconds in timestamp\r\n  show-timezone  Add time zone information to timestamp\r\n  year           Include year in timestamp\r\n  <cr\r\n \r\nr1(config)#$estamps debug datetime localtime msec show-timezone year     \r\nr1(config)#do debgug \r\nThis may severely impact network performance. Continue? (yes/[no]): yes\r\nAll possible debugging has been turned on\r\nr1#\r\n*Sep 15 2007 08:22:27.335 UTC: IP routecache flags changed on Null0, \r\n         added No CEF; now No CEF\r\n*Sep 15 2007 08:22:27.339 UTC: IP routecache flags changed on Null0, \r\n         added No CEF; now No CEF\r\n*Sep 15 2007 08:22:27.359 UTC: CEF: background resolution thread state:\r\n*Sep 15 2007 08:22:27.359 UTC: Thread fast_thread: Empty\r\n*Sep 15 2007 08:22:27.359 UTC: Thread todothread: Empty\r\n*Sep 15 2007 08:22:27.359 UTC: Thread slow_thread: Empty\r\n*Sep 15 2007 08:22:27.923 UTC: Local MobileIP: aging arp mobility cache entries\r\n*Sep 15 2007 08:22:27.927 UTC: IP-ST: if_list try 0\r\n*Sep 15 2007 08:22:27.927 UTC: IP-ST: gw_list total 0, try 0, completed list TRUE\r\n \r\n日志消息前面有个* 。日志消息一般是从三种字符的一种开始:空格 星号 句号\r\n \r\n空格   路由器的时钟被手动设置,或者和NTP时间服务器同步\r\n星号  路由器的时钟没有别设置,或者没有和NTP服务器同步\r\n句号 路由器的时钟被设置为同步,但和NTP服务器失去了联系

论坛徽章:
0
3 [报告]
发表于 2008-04-28 20:46 |只看该作者
localtime  谢谢\r\n\r\n自已这么浑,先前愣没看到:em11:
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP