Using the HTTP Monitor to Monitor Web Sites and Applications

Ken Spencer introduces you to the Microsoft Windows 2000 Resource Kit HTTPMon utility.

Ken Spencer

December 18, 2000

5 Min Read
ITPro Today logo in a gray background | ITPro Today

The Windows 2000 Resource Kit

The Microsoft Windows 2000 Resource Kit HTTP Monitoring tool (HTTPMon) can help you monitor Web sites or applications. (HTTPMon is part of the Server version of the resource kit.) Like WebCheck, another resource kit tool, HTTPMon can simultaneously test several sites and applications. Tools such as HTTPMon are a requirement for ensuring that sites and applications are staying up or responding within reasonable times. HTTPMon is composed of three components:

  • Realtime Sampling Service—the realtime monitoring service

  • SQL Reporting Server—pulls data from monitor servers and loads it into Microsoft SQL Server

  • Client Monitor—a set of Web pages that displays the results from the SQL Reporting Server database

HTTPMon can check several Web sites and report the results to either a log file (in Comma Separated Values—CSV—format) or the Win2K or Windows NT event log. You can then use Windows Management Instrumentation (WMI) or other technologies to monitor the event log, or you can import the CSV output into Microsoft Excel, SQL Server, or another tool for further analysis. You can also use the SQL Server data and Client Monitor to track your servers.

Installing and Configuring HTTPMon
The steps for installing HTTPMon are simple. First, access the resource kit from either the CD-ROM or your network. Then, start setup.exe from the resource kit's appshttpmon directory. Follow the prompts from the setup program, and enter the installation folder name or accept the default location.

When setup is complete, the readme.txt file will appear, which includes release notes for the tool. The readme.txt file includes the steps you must take to complete the setup process. The setup process creates four directories under the main installation directory:

  • Docs—contains the documentation files

  • Output—contains the output .csv files

  • Samples—contains sample files for configuring and using HTTPMon

  • Source—contains a C source file

After you've installed HTTPMon, run httpmoncfg.exe. This program presents a simple interface that lets you configure the service. The tool reads and writes the entries you make into an .ini file. By default, the .ini file is C:winnthttpmon.ini. HTTPMon lets you define groups of servers in the .ini file called clusters. You can define a cluster, add servers to that cluster, then add the URL to test within the cluster. Clusters is basically a friendly name for the group of servers, but the URL is a relative URL within the group, so the servers must all have the same relative page.

To begin configuration, expand the Web Clusters WWW entry in the tree. For the first set of servers, you can change the entry for WWW or add another entry. You might want to add entries with names that are recognizable instead of using WWW. To change the WWW entry, expand it, then add your server and URL. To add a server, right-click the cluster name, then select Add Server. On the Add Server dialog box, which Figure 1 shows, enter the information for the server, such as its IP address and name. You can add a URL to test on the servers in the cluster by right-clicking the cluster name and selecting Add URL. The URL you add must be a relative URL for the servers you enered. When you've made your changes or additions, click OK to close the Add Server dialog box and save the changes.

Running HTTPMon
Before you can use the tool, you must start HTTPMon. You can start this service from the Control Panel Services applet (NT 4.0), or choose Start, Programs, Computer Management Services (Win2K). You must assign a logon account to the service that is in the Administrators group.

In testing, I found that changes to the httpmon.ini file are applied only after you restart HTTPMon. To implement changes to an existing server or URL configuration, make the change, then restart the service. As soon as HTTPMon restarts, it will begin testing and write its output to a .csv file or the event log. If you specify .csv files, the default names appear as 972348948.csv, 972348527.csv, and so on. The tests run at 5-minute intervals.

When your tests start running, you can view the results by opening the .csv files in the Output directory. Look at the files by their timestamp, and open the last one to see the latest test. The file will contain an entry for each server tested, as Figure 2 shows. The entry will show the type of test (e.g., Internet), server URL, cluster name, and the friendly name for the URL you're testing. The remaining entries on each line provide information about the test. The entry after the friendly name is a response code (using the Internet Engineering Task Force—IETF—Request for Comments—RFC—1945 responses). The statuscode.htm file from the Samples folder explains the response code. The remaining columns show a code you can use to test headers, the length of time the sample took to return the text, the number of retries HTTPMon attempted, the time of the sampling, and an alert level, respectively. The alert level will be

  • 1—write to a .csv file

  • 2—write to the event log

HTTPMon Reporting
By following these steps, you can get HTTMMon running with its basic reporting to .csv files or the event log. Getting the SQL Server support running is a bit more daunting. The setup program places monitor.sql in the samples directory. Microsoft created this .sql file for SQL Server 6.5; it won't work on SQL Server 2000 or SQL Server 7.0. To make monitor.sql work, you must modify the script, which requires changing the database-creation statements to comply with SQL Server 2000 or SQL Server 7.0 and the Percent word in the Creation statement for view vwClustSum. This modification also requires changing the navigation.asp code that uses the view. There might be other changes that are required or that you can't make because of the way HTTPMon uses SQL Server.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like