How reliable is your Windows server? NetWare and Linux administrators love to regale their counterparts in Windows administration with tales of servers that run for months and years without a reboot. When was the last time you rebooted your Windows server? Or the last time your server rebooted itself? Do you even know?

Microsoft can help you answer questions like that with Uptime, a utility that quickly gauges your server’s reliability. In this Daily Feature, I’ll show you how to use Uptime on your server.

Why do I care when I rebooted my server?
You might think it would be easy to remember the last time you rebooted your server, but it’s not—especially when you’re in a network environment with many servers. Even if you do have the memory of an elephant, it may not help. Your server could reboot itself.

Self-reboots are the ones you really need to worry about. Self-reboots have several causes, including power outages, hardware failure, and the famed Blue Screen Of Death. Unless you’re around when your server reboots itself, you may not even be aware of the cause.

Because you can’t be around your server 24 hours a day, you need a quick way to find out when it rebooted itself. Sorting through all of the messages in the Event Log is a time-consuming chore. That’s where Uptime comes in.

What does Uptime do, and where can I get it?
The Uptime utility sorts through the Event Log and searches for key system events like startup and shutdown times. When used with additional programs like Dr Watson, Uptime can display information about applications that caused the server to reboot. Some of the basic information Uptime provides about your server is:

  • The amount of time since the last reboot.
  • The total amount of time the server has been running.
  • The total amount of time the server has been offline.
  • The startup and shutdown times.
  • The total number of Blue Screens generated by the server.

Microsoft first released Uptime for Windows NT with Windows NT Service Pack 4. Even though Uptime is a Windows NT utility, it works equally well with Windows 2000 Professional or Windows 2000 Server.

You can get the Uptime utility at Microsoft’s Uptime Web page. Click the download link for the Intel version of Uptime, unless you’re still running Windows NT for Alpha processors. The file is only 45,672 bytes long, so it will download very quickly. After you obtain the UPTIME.EXE file, you’re ready to use it.

Running Uptime
Uptime is a simple command utility—there are no fancy GUI screens or Setup programs. To run the program, simply open a command prompt on your administration workstation, change directories to your download directory, type uptime, and press [Enter].

If you’re running Windows NT Workstation or Windows 2000 Professional on your administration workstation, you’ll quickly see the amount of time your workstation has been running. If your administration workstation runs Windows 9x or (for some strange reason) Linux, you’ll just get an error.

You probably won’t want to run Uptime from your download directory on a permanent basis, so you should copy the UPTIME.EXE file to another location. You could copy UPTIME.EXE to the C:\WINNT directory or one of the SYSTEM directories on your workstation to make it available without having to enter path information. You can also create an Uptime directory on your administration workstation and copy the UPTIME.EXE file there. I recommend the latter course of action because you can also use this directory to store file listings containing Uptime information about your servers.

If you want, you can also copy UPTIME.EXE directly to your servers and run it on the servers themselves, but you don’t have to. You can use the \\computername switch with UPTIME.EXE to view the Uptime information for any remote NT or Windows 2000-based computer. For example, to view the Uptime information for the server called SNOOPY, you’d type uptime \\snoopy and press [Enter] from your administration workstation.

Uptime also includes other command-line switches you can use to customize output. These switches include:

  • /s—This switch displays detailed information about system events and system statistics.
  • /a—This switch displays application failure events as well as all of the information included with the /s switch.
  • /d:mm/dd/yyyy—This switch limits Uptime to reporting events after the date listed.
  • /p:n—This switch limits Uptime to reporting events that occurred in the previous number of days represented by n.
  • x/heartbeat—This switch toggles the heartbeat of the target system.

Using the switches together gives you a powerful reporting tool. As you can see by the screen in Figure A, using the uptime \\server /s command gives detailed information about many aspects of your server.

Figure A
Uptime provides lots of information about your server.

Using a trick from the Age Of DOS, you can create text files that contain Uptime information on your servers. Type uptime \\server /a >filename.txt, where filename.txt is the name of a text file that will contain the information. You can use any filename instead of filename.txt. The best filename to use is one that represents the server’s name and the date you ran the file, such as SNOOPY72302.TXT. You can then use a text editor to view the information at a later date.

Keep it up!
Uptime should be used only to estimate total system reliability. Don’t treat the information reported by Uptime as gospel. Because Uptime relies on information provided by event logs, the information may be inaccurate if the logs are damaged or erased. Likewise, even though Uptime says your server is available 99.999 percent of the time, it doesn’t mean your users can always access the server. Cable breaks, hub failures, or other network outages not related to the server itself can render the server unavailable without affecting Uptime statistics.

Despite those caveats, you’ll find Uptime to be a very useful tool. It can give you a good sense of your server’s reliability. It can also flag application errors and Blue Screens Of Death that otherwise, you might not know about.