PMDF System Manager's Guide
PMDF-REF-6.0


Previous | Contents

32.7.3 Monitoring customization

In order to customize the monitoring interface, it is first necessary to understand how the monitoring CGI processes HTTP requests and formulates HTTP responses. This is described in Section 32.7.3.1 and Section 32.7.3.2 . Following those descriptions, Section 32.7.3.3 describes the individual commands which can be embedded in those requests.

32.7.3.1 Processing HTTP requests

The CGI interface responds to HTTP GET and POST requests by parsing the request for a monitoring command and generating the appropriate response. The commands take the general form
command=command-name&parameter-name-1=parameter-value-1& 
  ...&parameter-name-N=parameter-value-N
(In the above, the line has been wrapped for typographic reasons.) The allowed command names and associated parameters are described in Section 32.7.3.3 .

In the case of GET requests, commands are embedded in the URL to retrieve as follows:

http://host:7633/monitor/?command=command-name&parameter-name-1= 
  parameter-value-1&...&parameter-name-N=parameter-value-N
And in POST requests the content of the request contains the command in URL-encoded form:
command=command-name&parameter-name-1= 
  parameter-value-1&...&parameter-name-N=parameter-value-N

If the command cannot be extracted from the request, an HTTP 5yz error response is sent back to the client. If the command can be extracted but cannot be parsed or successfully executed, a successful HTTP 200 response is sent back; the content of the HTTP response will be formatted as per the error formatting directions specified in the monitoring command. If those directions could not be extracted from the command, then an HTTP 500 error response is returned. See Section 32.7.3.2 for further details.

32.7.3.2 Generating HTTP responses

After processing an HTTP request from a client, the result of processing the monitoring command is sent back as an HTTP response to the client. The format of the response is governed by formatting files specified in the command from the client. That is, the request from the client includes the names of formatting files on the CGI server system that are to be used to format the response sent back to the client. On OpenVMS systems, these files must reside in the PMDF_ROOT:[www.monitor] directory; on UNIX systems, these files must reside in the /pmdf/www/monitor/ directory or a subdirectory thereof.

The formatting files may contain text to be copied verbatim into the HTTP response as well as directives to substitute in values associated with the monitoring information collected by the CGI. There are three basic types of formatting files: success, error, and command-specific files.

After the CGI parses a request and executes it, the results of the operation are sent back to the HTTP client using the following formatting steps: