Uptime

From Wikipedia, the free encyclopedia - View original article

 
Jump to: navigation, search
This article is about uninterrupted system availability. For use in logistics, see Downtime. For enterprise computing, see high availability. For the first half of a double album by the Kleptones, see Uptime / Downtime#Uptime.

Uptime is a measure of the time a machine, typically a computer, has been working and available. Uptime is the opposite of downtime.

Htop adds an exclamation mark when uptime is bigger than 100 days

It is often used as a measure of computer operating system reliability or stability, in that this time represents the time a computer can be left unattended without crashing, or needing to be rebooted for administrative or maintenance purposes.[citation needed]

Conversely, long uptime may indicate negligence, because some critical updates can require reboots on some platforms.[1]

Records[edit]

In 2005, Novell reported a server with a 6-year uptime.[2][3] Although that might sound unusual, that is actually common when servers are maintained under an industrial context and host critical applications such as banking systems.

Netcraft maintains the uptime records for many thousands of web hosting computers.

A server running Novell NetWare has been reported to have been shut down after 16 years of uptime due to a failing hard disk.[4][5]

Determining system uptime[edit]

Microsoft Windows[edit]

Using systeminfo[edit]

Users of Windows XP Professional, Windows Server 2003 and Windows Vista systems can type systeminfo at the Command Prompt to display all system information, including the System Up Time.[6]

 C:\> systeminfo | findstr "Time:" System Up Time:            0 Days, 8 Hours, 7 Minutes, 19 Seconds 

Note: Windows Vista Business 64-bit and Windows 7 do not return a "System Up Time" but "System Boot Time" instead. Also note that the exact text and date format is dependent of the language and locale Windows is running.

Note: Windows 7's "System Boot Time" is not a reliable indicator of boot time. It does not take into account the time spent in sleep or hibernation mode. Hence, the boot time drifts forward every time the computer is left in sleep or hibernate mode.

Using net statistics server/workstation[edit]

 C:\> net statistics workstation | findstr "since" Statistics since 8/31/2009 8:52:29 PM 

The line that start with "Statistics since ..." provides the time that the server was up from. The commands "net stats wksta" and "net stats srv" are shorthand for "net statistics workstation" and "net statistics server".[7] The exact text and date format is dependent of the language and locale Windows is running.

Using Uptime.exe[edit]

Microsoft has also provided a downloadable utility:[8]

 C:\> uptime \\SYSTEMNAME has been up for: 2 day(s), 4 hour(s), 24 minute(s), 47 second(s) 

Note: Windows 7's Uptime.exe utility is not a reliable indicator of total uptime either. It gives the same wrong information along with Boot Time and Task Manager's Uptime. It does not take into account the time spent in sleep or hibernation mode. The only real indicator may be the one given through "net statistics workstation" under "Statistics".

Using WMI[edit]

Uptime can also be determined via Windows Management Instrumentation from the command-line with WMIC:

 C:\> wmic os get lastbootuptime LastBootUpTime 20110508161751.822066+060 

The timestamp is in the format yyyymmddhhmmss.nnn, so this is a computer that last booted up on 8 May 2011 at 16:17:51.822. WMI can also be used to find the boot time of remote computers as well (Windows permissions allowing), for example with WMIC:

 C:\> wmic /node:"my-server" os get lastbootuptime LastBootUpTime 20101219141712.462006+060 

The text "LastBootUpTime" and the timestamp format are always the same regardless of the language and locale, Windows is running.

WMI can also be used via a programming language such as VBScript or Powershell[9][10]

Using Windows Task Manager[edit]

Users of Windows Vista, Windows 7 and Windows 8 can see uptime in Windows Task Manager under the tab Performance. The uptime format is DD:HH:MM:SS, that is Days:Hours:Minutes:Seconds that the system has been up.

Linux[edit]

Using uptime[edit]

Users of Linux systems can use the uptime utility (uptime(1) – Linux User Commands Manual) to get the uptime, together with the current time, the number of users and load averages for the past 1, 5 and 15 minute intervals:

 $ uptime  18:17:07 up 68 days,  3:57,  6 users,  load average: 0.16, 0.07, 0.06 

Using /proc/uptime[edit]

Shows how long the system has been on since it was last restarted:

 $ cat /proc/uptime 350735.47 234388.90 

The first number is the total number of seconds the system has been up. The second number is how much of that time the machine has spent idle, in seconds.[11] On multi core systems (and some linux versions) the second number is the sum of the idle time accumulated by each CPU.[12]

BSD[edit]

Using uptime[edit]

Like Linux, BSD-based operating systems such as FreeBSD and Mac OS X also have the uptime command (See uptime(1) – FreeBSD General Commands Manual).

 $ uptime 3:01AM  up 69 days,  7:53, 0 users, load averages: 0.08, 0.07, 0.05 

Using sysctl[edit]

There is also a method of using sysctl to call the system's last boot time:[13]

 $ sysctl kern.boottime kern.boottime: { sec = 1271934886, usec = 667779 } Thu Apr 22 12:14:46 2010 

OpenVMS[edit]

Users of OpenVMS systems can type show system at the command prompt.[14]

 $ show system/noprocess OpenVMS V7.3-2 on node JACK 29-JAN-2008 16:32:04.67  Uptime  894 22:28:52 

This shows the uptime as days then hours:minutes:seconds.

External measurement services[edit]

There are a many external services which can be used to monitor the uptime and downtime as well as availability of a service or a host. Some examples:

See also[edit]

References[edit]

  1. ^ "How to install multiple Windows updates or hotfixes with only one reboot". Support.microsoft.com. Retrieved 2014-04-22. 
  2. ^ "Marathon servers". Networkworld.com. 2005-12-01. Retrieved 2014-04-22. 
  3. ^ "Cool Solutions: Uptime Workhorses: Still Crazy after all these Years". Novell.com. Retrieved 2014-04-22. 
  4. ^ Bright, Peter (2013-03-29). "Epic uptime achievement unlocked. Can you beat 16 years?". Ars Technica. Retrieved 2014-04-22. 
  5. ^ "So long to a valiant companion - Ars Technica OpenForum". Arstechnica.com. Retrieved 2014-04-22. 
  6. ^ "Tracking down uptime in Windows XP | TechRepublic". Archive.is. Retrieved 2014-04-22. 
  7. ^ Author: Yuval Sinay (2006-10-25). "How to find Windows uptime?". Support.microsoft.com. Retrieved 2014-04-22. 
  8. ^ "Uptime.exe Tool Allows You to Estimate Server Availability with Windows NT 4.0 SP4 or Higher". Support.microsoft.com. 2012-08-20. Retrieved 2014-04-22. 
  9. ^ "How Can I Tell if a Server has Rebooted? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs". Blogs.technet.com. Retrieved 2014-04-22. 
  10. ^ "How Can I Determine the Uptime for a Server? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs". Blogs.technet.com. Retrieved 2014-04-22. 
  11. ^ [1][dead link]
  12. ^ "Martin Schwidefsky: Re: [PATCH] Re: /proc/uptime idle counter remains at 0". LKML. Retrieved 2014-04-22. 
  13. ^ "Mac Developer Library". Developer.apple.com. Retrieved 2014-04-22. 
  14. ^ "OpenVMS Undocumented Features". Parsec.com. 2008-10-29. Retrieved 2014-04-22.