Monitor Your Systems Easily
Use free tools from Microsoft to monitor your systems and make sure they are running properly
Q: We've got a new manager, and she wants us to begin producing uptime reports from each of our network servers as part of her new approach to systems management. Is there a simple way to do this? We're especially interested in an approach that doesn't require us to purchase new commercial tools.
Danielle: You might not think so right now, but your manager has a great idea. Generating uptime reports might not have been exciting in a Windows NT network because you were constantly rebooting servers. But uptime reports can have a significant impact on how you manage your systems in a Windows Server 2003 environment because this operating system typically runs on and on. Microsoft removed more than 75 reboot situations from Windows 2000, and it removed even more from Windows Server. Now, the only time you need to reboot servers is when you have to apply security patches to them. Fortunately, you can chain security patches to make sure they don't require multiple reboots. Microsoft is working to reduce the complexity of patch management and streamline their application within the near future, so this situation might change.
Nevertheless, your reports should show increased stability from your servers running Windows Server 2003. We recommend generating uptime reports once a week. There are many commercial tools that generate these reports automatically, but with a little ingenuity and some new command-line tools found in Windows Server, you can create your own uptime report generator and have it run automatically each week.
You need to work with three items: a command file containing your uptime report generation commands, a tool to generate the report itself, and a scheduled task to run your command file each week.
The tool you should use depends on how much detail you want to include in the report. Windows Server includes built-in commands for this, but there are also tools available in the Windows Server Resource Kit.
Uptime reports help you track the status of your servers and identify which configurations, both at the software and the hardware level, work best in your environment.
Nelson: As Danielle pointed out, you can use any of several tools to generate an uptime report. You can find one in the Windows Server's command-line tools:
systeminfo. This command gives you information on the server you are examining, as well as how long it has been running. You can run this command remotely, but it requires a username and password. The user must have the right to log on locally to the machine to execute the command. The syntax to use this command is simple:
systeminfo /s servername /u
username /p password
/fo TABLE >filename.txt
Servername is the fully qualified domain name (FQDN) of the server you want the report from, and username is the name of the account with rights to the serverbe sure to use the domain/username formatand password is the account's password. The last switch,
/fo, tells the command how to format the output. You can format this output as a table, a list, or as comma-separated values (csv) . List is the default, but the table format works best if you want to generate a report that lets you find the system uptime easily. You can import the resulting table into Microsoft Excel for easier viewing. In this case, you'll find the uptime information in column K. You'll also see that
systeminfo generates a lot more information about each system than just the uptime results.
A couple of caveats for this command: First, make sure you create the output file with a txt extension, which tells Excel to import the file. Second, be careful about choosing your password. If you end up putting this command in a command file, then the password you use for this command will be in clear text. Ideally, you should store the command file in an encrypted folder and use secure communications to run the command.
You can find two other tools on the Microsoft download site. One is from the Windows Server 2003 Resource Kit, and the other is from Windows NT:
uptime. The first, the Remote Server Information command, generates more general information about a server. The last line in the report generated by
srvinfo identifies how long a server has been in operation:
srvinfo \\servername >filename.txt
Servername references the NetBIOS name of the server you want to investigate. If you leave it blank, it lists information about the local server. Be sure to use filename.txt to identify the name and path of the file you want to send the information into.
Administrators usually use both
systeminfo to produce information about the entire state of a server. However, the
uptime command is sufficient if all you want are uptime reports. Microsoft used to include this tool in the Windows NT Resource Kit but now includes it as part of the Application Center 2000 toolkit. It is designed specifically to report on server uptime and only that:
You can also pipe this command to a text file. However, this command produces only the information for the uptime on a given server, so you have to be a little more creative to make this work. Begin by putting this code line into a command file and create one line for each server in your network. It is sometimes best to use Notepad to create the command file. Make sure you give it the CMD extension so it's treated as a command. Next, create a scheduled task using the command file, but output the results of the entire command file to a text file:
Run the task once a week, and you're done. You can even create the resulting report file in a shared folder your manager has access to so that he or she can view the results after you run the job each week.
Danielle: That's great Nelson, but what if they don't want to work with the command line? What if the manager wants to know more than just the uptime, and he or she doesn't want to wade through an endless series of Excel files? Microsoft has a new tool, the Microsoft Server Status Monitor (SSM), that proves handy in such cases.
If your shop includes 10 or fewer serversor if you can be happy monitoring only 10 servers at a timeyou can download a free copy of SSM. This tool is a subset of the Microsoft Operations Manager (MOM) Resource Kit. Microsoft created this subset to monitor servers on an ongoing basis and provide simple and significant reports through a Web-based interface. You can download the resource kit from the Microsoft downloads Web site (see Resources) and install it on any Windows machine running XP, 2000, or Windows Server 2003. Fire it up after you install it, and follow the instructions. The monitor uses several different techniques (such as ping and Active Directory lookup) to locate the servers on your network and then generates a report on each server.
The cool part is that SSM reports are based on server roles. This means you'll be trawling in familiar territory if you've worked with the Manage Your Server interface in Windows Server 2003 and assigned each server role through this interface. SSM supports 16 server roles out of the box (see Figure 1), and it detects the roles enabled on any given server automatically. It also lists the uptime for any given server that it monitors (see Figure 2), which means you can probably get away with installing SSM on your manager's desktop and letting her view uptime reports on her own schedule.
Nelson: If you download the MOM Resource Kit, you might also want to take a look at the other tools it includes. One that might interest you is the Event Log Configuration tool, which lets you configure event logs on multiple servers at the same time from a single location.
I'd like to be able to monitor my Active Directory. Is there a special tool you'd recommend I use?
Danielle: There are a great many commercial tools for monitoring Active Directory (AD). One of the best is MOM, but you could even use the free SSM discussed in the previous question, especially if you have 10 or fewer domain controllers. Another great AD monitoring tool is NetPro's Secure Active Directory Lifecycle Suite. It's designed specifically for AD monitoring and troubleshooting. It also includes Domain Name System (DNS) service monitoring, something many other commercial tools omit when dealing with AD. Another great feature is that its troubleshooting component usually gives you answers on how to repair an AD problem when it's identified. This is a great way to keep your domain controllers up and running.
Nelson: That's good Danielle, but what if you can't afford a commercial tool? In my opinion, you might be well served by a little-known utility included with the Windows 2000 Server Resource Kit: the Domain Controller Diagnostics Tool (Dcdiag). This utility tests every component in your directory from replication to each of the flexible single master of operations roles. You can configure it to generate complete reports with a lot of detail. You can also configure it to generate only error reports. It's a command-line tool with a straightforward syntax:
dcdiag /s: domaincontroller
/n: namingcontext /u:
username /p: password
Domaincontroller is the DC you want to use as the basis of the diagnosisuse its FQDN name. Namingcontext is the domain or forest you want to test, and username is the account you want to use. This account must have local logon rights to the base DC. Logfile is the name of the output file the diagnosis generates. You can also use the
/ferr switch if you want to output errors into a separate log file. This is a good idea if you have many DCs in your forest.
One nice thing about this command is the
/fix switch, which you can use to correct minor problems on domain controllers. You can use this to fix things such as the replication path and other simple errors. The reports and tests this tool runs are comprehensive. It isn't the same as having either MOM or NetPro's SADL Suite, but it gets the job done, especially if you're on a budget.
Got More Questions?
Contact Nelson and Danielle by e-mail at [email protected].
About the Authors
Danielle Ruest is always looking for ways to simplify system management, especially with graphical tools. Nelson Ruest (MCSE, MCT) is more concentrated on the command line and its particularities. Both are prolific authors who try to make system administration an easier world to live in. Their latest book, Windows Server 2003 Pocket Administrator (McGraw-Hill, 2003), is chock-full of detailed advice on how to keep your networks running smoothly. Feel free to send comments or questions to [email protected].
Danielle Ruest and Nelson Ruest, both Microsoft MVPs, are IT professionals focused on technologies futures. They are authors of multiple books, including "Microsoft Windows Server 2008: The Complete Reference" (McGraw-Hill Osborne Media, 2008), which focuses on building virtual workloads with Microsoft's new OS.