The Sysadmin's Daily Grind: Uptimed

Conspiracy of the Undead

© Serj Siz`kov, Fotolia

© Serj Siz`kov, Fotolia

Article from Issue 101/2009
Author(s):

Who has the longest uptime? Linux systems used to win hands down when it comes to maximum uptime without rebooting. Today, uptime statistics help admins with monitoring tasks and discovering tricky bugs.

The times when I showed off servers with 1,000 days of uptime to make my colleagues from the Windows team jealous are long gone. If I get caught with a Methuselah like this today, I can expect to answer embarrassing questions about whether I am afraid of kernel updates. (The answer to this is: Yes! I use some fairly exotic RAID controllers now because I shot myself in the foot when I updated to 2.6.27 – ouch!)

Security freaks tell scary stories about the exploits they guess will work on systems that nobody has bothered booting for a year or so. Bragging can't be the only reason why so many admins use Uptimed [1], a daemon that logs a system's uptime over an extended period of time. It makes sense for devices that are not otherwise accessible for monitoring, for reasons of location or security – you get to know exactly when the power supply last failed, or a hardware component died on you.

You can use the /etc/uptimed.conf configuration file to control Uptimed's behavior. The entry

LOG_MAXIMUM_ENTRIES=20

tells the tool to restrict the list of saved uptimes to 20 readable entries.

LOG_MINIMUM_UPTIMED=12h

lets me tell the daemon not to start writing entries until the computer has achieved at least 12 hours of uptime. This makes sense to suppress the intermezzi between two successive reboots, as would be the case if you need to repair or rebuild and try out a new kernel module (you guessed it, my RAID controllers…). You can also define milestones in the configuration file, and have the software notify you by mail when the server reaches one.

Showtime

The Uptimed package includes the Uprecords client, which exhibits the acquired data in a nicely formatted list on the console. To keep things readable, I restricted the uprecords -s -m3 output to the last three entries. There is a reason I choose my video disk recorder for this – it freezes from time to time, and I wanted Uptimed to help me discover some method to the madness of these crashes. Unfortunately, there wasn't one: I guess the hardware is broken, just as I suspected.

The Author

Charly Kühnast is a Unix operating system administrator at the Data Center in Moers, Germany. His tasks include firewall and DMZ security and availability. He divides his leisure time into hot, wet, and eastern sectors, where he enjoys cooking, fresh water aquariums, and learning Japanese, respectively.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Charly’s Column: Cluster SSH

    Charly doesn’t relish the idea of searching through the logfiles of a dozen proxy servers when page requests fail. Now that he has deployed Cluster SSH, he can pull the strings on many machines at the same time.

  • Charly's Column

    Parallel SSH is the name of an easy-to-configure tool that our resident sys admin, Charly, now routinely deploys whenever he needs to launch the same programs, copy the same files, or kill the same processes simultaneously on multiple computers.

  • Charly's Column

    The siege of Troy is said to have taken 10 years, ending only after Odysseus introduced a wooden horse into the mix. Charly is planning a siege, too, and the target is his own web server. Of course, he doesn't have 10 years to complete the task, and Odysseus isn't on his team.

  • Charly's Column

    Network monitors are a dime a dozen, but Nload, which separates incoming and outgoing traffic and draws graphs on the console without X, is unique.

  • Charly's Column: lsof

    The shorter a command, the longer the list of support parameters. This rule applies to lsof, one of Charly’s favorite commands.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News