Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging time incorrect

Status
Not open for further replies.

chipk

IS-IT--Management
Mar 23, 2006
1,226
US
Anybody seen this? When I do "show log" on my switches, I always get the incorrect time in the log. It is off by exactly 4 hours. I am in EST - 5. If I do "show clock" the time on the switch is correct:

switch#sho clock
09:32:58.609 EDT Wed Oct 25 2006

The sho log comand, run seconds later, has this output:

switch#sho log
Oct 25 13:31:50: %SYS-CLUSTER_MEMBER_4-5-CONFIG_I: Configured from console by vty0

I am using NTP, but it would seem to me that if there was a problem with NTP, the time on the switch itself would be off, not just the time shown in the log. This is just weird to me and I'd like to fix it, even though it's more of just a nuisance than anything.

Relevant lines from the config are:
.....
clock timezone EST -5
clock summer-time EDT recurring
.....
ntp clock-period 17180677
ntp server xxx.xxx.xxx.xxx
 
..hi..

..below is pulled from..



You may see log messages that don't exhibit the correct date and time. There are a variety of options to control the date and time that appear on logging output (either to the screen or to the buffer). To control this, use the following command:

Router(config)# service timestamps debug ?
datetime Timestamp with date and time
uptime Timestamp with system uptime

..huh? ;-)





CCNP,CCSP,MCSE,Sec+,Net+,A+...
 
...what do you know..
..i'm glad you asked that question..
..i configured according to the above and it works!
.....tell you truth i saw the problem a while back and wanted to fix...but you gave the push..thanx

CCNP,CCSP,MCSE,Sec+,Net+,A+...
 
Huh, was already doing that, but doesn't appear to be working...

What about "service timestamps log [datetime|uptime]"? Would that mess with the time in the log?
 
You need to add to the config:

service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
!

The 'localtime' bit changes the timestamps to reflect the actual timezone the router is configured for. Without this it displays the time that it is sync'd to (via NTP).

HTH

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top