Netscape Compass Server Administrator's Guide

[Contents] [Previous] [Next] [Index]

Chapter 8
Monitoring the Server

You can monitor your server's activity using several different methods. You can view the server's status in real time by using the Hypertext Transfer Protocol (HTTP). You can also monitor your server by recording and viewing log files or by using performance-monitoring tools provided with your operating system.

Working with Log Files

Server log files record your server's activity. You can use these logs to monitor your server and to help you when troubleshooting. The error log file, located in compass-servername/logs in the server root directory, lists all the errors the server has encountered. The access log, located in
compass-servername/logs in the server root directory, records information about requests to the server and the responses from the server. You can use the Server Manager to specify what to include in the access log file. Use the log analyzer to generate server statistics. You can back up server error and access log files by archiving them.

Viewing an Access Log File

You can view the server's active and archived access log files from the Server Manager.

To view an access log:

  1. Choose Server Status|View Access Log.

  2. Choose the access log file you want to see.
    Active log files for resources and archived log files appear in the list.

  3. Type the number of lines you want to see in the "Number of entries" field.
    The order of the log entries on the screen is the order in which they were recorded in the log.

  4. To filter the access log entries for a particular word, type the word in the "Only show entries with" field.
    Case is important; make sure the case for your entry matches the case of the word you're searching for. (For example, if you want to see only those access log entries that contain "POST," type POST.)

  5. Click OK.
Here is an example of an access log in the Common Logfile Format:

wiley.a.com - - [16/Feb/1996:21:18:26 -0800] "GET / HTTP/1.0" 200 751
wiley.a.com - - [17/Feb/1996:1:04:38 -0800] "GET /docs/grafx/icon.gif HTTP/1.0" 204 342
wiley.a.com - - [20/Feb/1996:4:36:53 -0800] "GET /help HTTP/1.0" 401 571
arrow.a.com - john [29/Mar/1996:4:36:53 -0800] "GET /help HTTP/1.0" 401 571
Table 8.1 describes the last line of the sample access log.

Table 8.1 The fields in the last line of the sample access log file
Access Log Field Example
Hostname or IP address of client

arrow.a.com. (In this case, the hostname is shown because the web server's setting for DNS lookups is enabled; if DNS lookups were disabled, the client's IP address would appear.0

RFC 931 information

- (RFC 931 identity not implemented)

Username

john (user name entered by the client for authentication)

Date/time of request

29/Mar/1996:4:36:53 -0800

Request

GET /help

Protocol

HTTP/1.0

Status code

401

Bytes transferred

571

Here is an example of an access log using the flexible logging format:

wiley.a.com - - [25/Mar/1996:12:55:26 -0800] "GET /index.htm HTTP/1.0" "GET" "/?-" "HTTP/   1.0" 304 0 - Mozilla/2.0 (WinNT; I) 
wiley.a.com - - [25/Mar/1996:12:55:26 -0800] "GET / HTTP/1.0" "GET" "/?-" "HTTP/1.0" 304 0    - Mozilla/2.0 (WinNT; I)
wiley.a.com - - [25/Mar/1996:12:55:26 -0800] "GET / HTTP/1.0" "GET" "/?-" "HTTP/1.0" 304 0    - Mozilla/2.0 (X11; I; IRIX 5.3 IP22)
The access log in the flexible logging format looks similar to the access log using the Common Logfile Format.

Viewing the Error Log File

The error log file contains errors the server has encountered since the log file was created; it also contains informational messages about the server, such as when the server was started. Incorrect user authentication is also recorded in the error log. Use the error log to find broken URL paths or missing files.

To view the error log file from the Server Manager:

  1. Choose Server Status|View Error Log.

  2. To see more or fewer than 25 lines of the error log, use the "Number of errors to view" field to enter the number of lines you'd like to see.
    The order of the log entries on the screen is the order in which they were recorded in the log.

  3. To filter the error messages for a particular word, type the word in the "Only show entries with" field.
    Case is important; make sure the case for your entry matches the case of the word you're searching for. (For example, if you want to see only those error messages that contain "warning," type warning.)

  4. Click OK.
Here is an example of an error log:

[13/Feb/1996:16:56:51] info: successful server startup
[20/Mar/1996 19:08:52] warning: for host wiley.a.com trying to GET /report.html,     append-trailer reports: error opening /usr/ns-home/docs/report.html (No such file or directory)
[30/Mar/1996 15:05:43] security: for host arrow.a.com trying to GET /, basic-ncsa     reports: user jane password did not match database /usr/ns-home/authdb/mktgdb
In this example, the first line is an informational message--the server started up successfully. The second log entry shows that the client wiley.a.com requested the file report.html, but the file wasn't in the primary document directory on the server. The third log entry shows that the password entered for the user jane was incorrect.

Setting Log Preferences

During installation, an access log file named access was created for the server. You can customize access logging for any resource by specifying whether to log accesses, what format to use for logging, and whether the server should spend time looking up the domain names of clients when they access a resource.

Server access logs can be in Common Logfile Format, or flexible log format, or your own customizable format. The Common Logfile Format is a commonly supported format that provides a fixed amount of information about the server. The flexible log format allows you to choose (from the Server Manager) what to log. A customizable format uses parameter blocks that you specify to control what gets logged. Once an access log for a resource has been created, you can't change its format unless you archive it or create a new access log file for the resource.

To set access logging preferences:

  1. From the Server Manager, choose Server Status|Log Preferences.

  2. Use the Resource Picker to choose the resource you'd like to apply custom logging to.

  3. Select whether to log client accesses.

  4. Type the full path for the log file.
    As a default, the log files are kept in the logs directory in the server root directory. If you specify a partial pathname, the server assumes the path is the logs directory in the server root.

  5. Choose whether to record domain names or IP addresses in the access log.

  6. Choose the format in which the log file should be: Common Logfile Format, or flexible log format (Only log radio button), or custom format. If you click Only log, you can choose any or all of the following flexible log format items:

  7. If you don't want to log client access from certain hostnames or IP addresses, type them in the Hostnames and IP Addresses fields.
    Type a wildcard pattern of hosts the server should ignore when recording accesses. For example, use *.netscape.com if you don't want to log accesses from people whose domain is netscape.com. You can type wildcard patterns for hostnames, IP addresses, or both.

  8. Choose whether to include the format string in the logfile.
    If you are using the proxy server's log analyzer, you should include a format string. If you are using a third-party analyzer, you may not want to include a format string in your logfile.

  9. Click OK.

Archiving Log Files

You can archive the access and error log files and have the server create new ones.

When you archive log files, the server renames the current log files and then creates new log files with the original names. You can back up or archive (or delete) the old log files, which are saved as the original filename followed by the date and time the file was rotated. For example, access might become access.24Apr-04AM.

You can archive log files immediately or have the server archive log files at a specific time on specific days. The information about when to archive log files is stored in the cron.conf file in the admin-serv directory in the server root directory; the server's cron configuration options are stored in ns-cron.conf in the admin-serv directory.

Note Before running the log analyzer, you should archive the server logs.

To archive log files:

  1. From the Server Manager, choose Server Status|Archive Log.

  2. Click Archive if you want to rotate the log files immediately.
    If you want archiving to occur at specific times on specific days, click the "Rotate log at" button, choose a time from the pull-down menu, and select the days for archiving to occur.

  3. Click OK.

  4. (Unix only) Shut down the administration server by clicking the shut down link on the page that appears.

  5. (Unix only) Restart the administration server.

Monitoring the Server Using HTTP

You can monitor your server's usage with the interactive server monitor. You can see how many requests your server is handling and how it is handling these requests. If the interactive server monitor reports that the server is handling a great deal of requests, you may need to adjust the server configuration or the system's network kernel to accommodate the requests. The interactive server monitor is shown in Figure 8.1.

To monitor your server from the Server Manager:

  1. Choose Server Status|Monitor Current Activity.

  2. Click "Monitor current activity on port port_number". The interactive server monitor shown in Figure 8.1 appears.
Figure 8.1    The interactive server monitor

The interactive server monitor reports the totals for the following server values:

Working with the Log Analyzer

Use the log analyzer to generate statistics about your server, such as a summary of activity, most commonly accessed URLs, times during the day when the server is accessed most frequently, and so on. You can run the log analyzer from the Server Manager or the command line.

Note Before running the log analyzer, you should archive the server logs.

To run the log analyzer from the Server Manager:

  1. Choose Server Status|Generate Report.

  2. Type the name of your server; this name appears in the generated report.

  3. Choose whether the report will appear in HTML or plain text format.

  4. Select the log file you want to analyze.

  5. If you want to save the results in a file, type an output filename in the Output file field. If you leave the field blank, the analyzer prints results on the screen. For large log files, you should save the results to a file because printing the output to the screen might take a long time.

  6. Select whether to generate totals for certain server statistics. You can generate the following totals:

  7. Select whether to generate general statistics. You can generate the following general statistics:

  8. Select whether to generate a list of server access statistics. You can generate a list of the following:

  9. Specify the order in which you want to see the results.

  10. Click OK.


[Contents] [Previous] [Next] [Index]

Last Updated: 02/12/98 13:36:17


Copyright © 1997 Netscape Communications Corporation

Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use