cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15022
Views
0
Helpful
2
Replies

Router/Switch Uptime

jwbensley
Level 1
Level 1

The following is a snippet from "show version" after a device lost power;

sw1 uptime is 3 hours, 22 minutes

System returned to ROM by power-on

System restarted at 13:16:51 BST Wed Nov 21 2012

Initially when this switch started up it was logging errors into it's buffer and timestamping them from midnight like the following;

*Mar  1 00:00:52.199: %SPANTREE-5-EXTENDED_SYSID: Extended SysId enabled for type vlan

*Mar  1 00:00:54.571: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down

Later on, it communicated with an NTP server and received the correct time, at which point it started to log entires in its buffer with the correct time;

*Mar  1 00:01:06.216 BST: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

*Mar  1 00:01:32.616 BST: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan97, changed state to up

Nov 21 13:20:45.379 BST: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

Nov 21 13:20:47.387 BST: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

At the point when the clock is updatyed by NTP, is the value in "show version" updated accordingly where it says "System restarted at 13:16:51 BST Wed Nov 21 2012"? The device counts how long it has been up "sw1 uptime is 3 hours, 22 minutes" so presumably it will adjust the value accordingly if there is a clock change?

Thank you.

2 Replies 2

jwbensley
Level 1
Level 1

I have answered my own question. I just booted up a spare switch and left it for 10 minutes. At this point "show ver" said "Switch uptime is 10 minutes" and there was no line regarding power on time.

I set the system clock manuall and then ran "show ver" again and it said "system restarted at <10 minutes ago>".

My guess is that the software hooks into the time interrupt and increments a counter value by 1 for every 1/100 of a second that has passed since the management portion of the system initialized.  Therefore, it wouldn't matter what you did to the clock (moving it forward in time, back in time, etc) because the time interrupt would fire off at the same interval regardless.