4

A tool such as this might on the surface appear to serve no real useful purpose, but people that take care of systems like to brag, and uptime is just one of those things that they like to brag about right after how much RAM or CPUs their systems have.

Additionally, how many times have you had a system mysteriously reboot, only to find that it had, later on. A tool such as this would help to identify the frequency of both the reboots and the length of time that the system was staying up, between reboots. 2 potentially useful pieces of information when debugging badly behaving systems.

Is anyone aware of such a tool?

  • 1
    What about last? – Stéphane Chazelas Nov 19 '13 at 12:36
  • @StephaneChazelas - last doesn't show what I want. Unless I'm missing something about it. – slm Nov 19 '13 at 12:40
  • It shows the boots and shutdowns (especially with -x), isn't it what you're looking for? – Stéphane Chazelas Nov 19 '13 at 13:06
  • @StephaneChazelas - last isn't what I was looking for, but thanks. – slm Nov 19 '13 at 13:14
6

uptimed

One such tool that I came across many years ago is called uptimed. The project site is here: http://podgorny.cz/moin/Uptimed.

This is a pretty straightforward install, given uptimed appears to be in most of the major distros' repositories.

Installation

$ sudo yum install uptimed

Once installed the service needs to be configured so that it will start upon reboots. The stats of differing uptimes can be seen using the command uprecords.

Example

uprecords 
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1   371 days, 06:08:04 | Linux 2.6.18-194.8.1.el5  Fri Jan 13 08:03:18 2012
     2   322 days, 13:20:22 | Linux 2.6.18-194.8.1.el5  Wed Feb 23 21:17:19 2011
     3   243 days, 13:42:00 | Linux 2.6.18-164.15.1.el  Thu Jun 24 21:48:01 2010
     4   120 days, 11:08:54 | Linux 2.6.18-194.8.1.el5  Sun Jun  2 08:43:41 2013
     5    80 days, 21:27:49 | Linux 2.6.18-128.1.1.el5  Fri Jan  1 16:35:06 2010
     6    73 days, 21:47:32 | Linux 2.6.18-194.8.1.el5  Sat Jan 19 13:23:17 2013
->   7    49 days, 00:12:15 | Linux 2.6.18-194.8.1.el5  Mon Sep 30 19:20:13 2013
     8    39 days, 06:12:06 | Linux 2.6.18-194.8.1.el5  Tue Apr 23 06:05:01 2013
     9    29 days, 16:18:57 | Linux 2.6.18-92.1.13.el5  Thu Jan  1 00:31:43 2009
    10    29 days, 12:41:08 | Linux 2.6.18-92.1.18.el5  Thu Feb 12 02:46:39 2009
----------------------------+---------------------------------------------------
1up in    24 days, 21:35:18 | at                        Fri Dec 13 19:07:32 2013
no1 in   322 days, 05:55:50 | at                        Tue Oct  7 04:28:04 2014

collectd

If you're looking for something more graphical then check out collectd. Main project page is here: http://collectd.org/. Again, should be in most major distros' repositories.

Example

   ss of collectd - uptime

Collectd can do way more than just collect uptimes. It has a sophisticated plugin API which has dozens of plugins for collecting data on a variety of services such as MySQL or other system related information.

References

1

Another alternative tool is Tuptime, it tracks system startup and shutdown events. It also registers if the shutdowns or reboots were OK or bad (mysterious reboots as you said).

$ tuptime -t
No.      Startup Date                              Uptime       Shutdown Date   End                   Downtime

1   10:15:27 08/08/15                          42 seconds   10:16:09 08/08/15    OK                 16 seconds
2   10:16:26 08/08/15                          49 seconds   10:17:15 08/08/15    OK                 16 seconds
3   10:17:32 08/08/15            5 minutes and 47 seconds   10:23:19 08/08/15    OK                 16 seconds
4   10:23:36 08/08/15                           9 seconds   10:23:45 08/08/15   BAD                 42 seconds
5   10:24:28 08/08/15   2 hours, 9 minutes and 27 seconds   12:33:55 08/08/15    OK  41 minutes and 44 seconds
    . . .

It is usually available from the APT repository:

apt-get install tuptime

Or from the github site: https://github.com/rfrail3/tuptime/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.