PMDF System Manager's Guide


Previous Next Contents Index

33.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 33.7.3.1 and Section 33.7.3.2. Following those descriptions, Section 33.7.3.3 describes the individual commands which can be embedded in those requests.

33.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 33.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 33.7.3.2 for further details.

33.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:

  1. The command-specific formatting files are used to format the data collected by the monitoring command. The files will be consulted once for each instance of the entity to be monitored. In the case of generic PMDF information and .HELD message files, the formatting files are consulted only once. In the case of channel counters and processing queues, the files are consulted once for each channel or queue monitored. The command-specific formatting files are described in the sections describing the specific commands.
  2. If the preceding step is successful, the content of the success formatting file is used as the response to the client. Each line of the file is copied to the content of the HTTP response. Any line beginning with %s is replaced with the formatted data generated in the first step. The HTTP response sent back to the client will have an HTTP 200 status code.
  3. If the first step failed, the content of the error formatting file is sent as the response to the client. Each line of the file is copied to the content of the HTTP response. Any line beginning with %s is replaced with the output, if any, of the first step as well as any error messages. The HTTP response sent back to the client will have an HTTP 200 status code.

In the command-specific formatting files, command-specific substitution strings may appear. These strings all begin with the percent character, %. When such a string is encountered, the value it references is substituted into the HTTP response. For instance, the formatting file


%first{<TABLE>} 
%first{<TR><TH>Channel<TH>Queued messages} 
<TR><TD>%counter_channel<TD>%counter_stored_messages 
%last{</TABLE>} 
might be used in conjunction with the show_counters command to produce an HTML table of the PMDF channels and the number of messages queued to each channel; e.g.,


<TABLE> 
<TR><TH>Channel<TH>Queued Messages 
<TR><TD>conversion<TD>3 
<TR><TD>l<TD>29 
<TR><TD>tcp_local<TD>88 
</TABLE> 

In the tables describing each substitution string, the type of data associated with the substitution string is stated. These types are:
Type Description
int Signed integer
string ASCII text string
uint Unsigned integer
In addition, the default formatting string used to format the data is also shown in the tables. The formatting strings follow the C programming language convention for formatting strings passed to the sprintf() C run-time library routine. Alternate formatting strings may be used by enclosing them in braces, {}, and appending them to the substitution string. For instance,


%counter_delivered_volume{%.1f} Kbyte%s 
might be used to limit the %counter_delivered_volume to a single digit of precision after the decimal point.

Five substitution strings, %first, %last, %!first, %!last, and %node deserve special attention. These first four strings substitute into the output specific text when formatting, respectively, the first, the last, not the first, or not the last instance of the data to be formatted. The text to be substituted in must be enclosed in braces, {}, following the substitution string.6 For example, suppose that counters for several channels are to be formatted using the following formatting file:


 
%first{<TABLE>} 
%counter_channel 
%last{</TABLE>} 
 
In that case, when information for the first channel is formatted, the text will be output followed by the channel name (%counter_channel). When information for the last channel is formatted, the text
will be output following the channel name.

The %none substitution string supplies text to output when there are no instances of the monitored data to display. For example, when there are no jobs in a queue to display.

33.7.3.3 Monitoring Commands

As described in Section 33.7.3.1, monitoring commands take the general form


command=command-name&parameter-name-1=parameter-value-1& 
  ...&parameter-name-N=parameter-value-N
In the above, command-name gives the name of the monitoring command to execute. It is then followed by two or more parameters which provide supplemental information relevant to the operation to be performed.

The valid command names are listed in the table below and described in the following subsections.
Command name Section Description
show_counters 33.7.3.3.1 Show channel counters
show_counters 33.7.3.3.2 Determine if there are any .HELD message files
show_pmdf 33.7.3.3.3 Show generic information about the PMDF configuration
show_queue 33.7.3.3.4 Show information about OpenVMS processing queues

33.7.3.3.1 Channel Counters: command=show_counters

The show_counters command displays channel counters and derived statistics for one or more channels. Parameter names and their values accepted by the command are listed in the table below.
Parameter   Description
counter_format= file-spec Required Name of the formatting file to use to format channel counter information. The recognized substitution strings for this command are listed in Table 33-6 and Table 33-7.
channel_name= name Optional Name of the channel to display information for. Wildcards are permitted. If this option is not specified, * is assumed and information for all channels will be displayed.
success_format= file-spec Required Name of the formatting file to use to format the results when the command is successful.
error_format= file-spec Required Name of the formatting file to use to format the results when the command fails.
Each of the file-spec file specifications must be relative file paths specifying files in the pmdf_root:[www.monitor] directory (OpenVMS) or the /pmdf/www/monitor/ directory (UNIX).

For each channel matching the channel name pattern, the counter format file will be used to format the information for that channel. If the command is successful, the results are then formatted as per the success format file; otherwise, the error format file will be used to generate an error response.

An example URL for a GET command might be


http://host:7633/monitor/?command=show_counters&channel_name=tcp*& 
  counter_format=counters.txt&success_format=csuccess.txt& 
  error_format=cerror.txt 

Table 33-6 General Substitution Strings
Substitution string Type Format Description
%last string %s Text string to display if this is the last formatting pass.
%none string %s Text string to display if there is no information to format.
%first string %s Text string to display if this is the first formatting pass.
%!first string %s Text string to display if this is not the first formatting pass.
%!last string %s Text string to display if this is not the last formatting pass.
%S char %s Output an S if the previously displayed numeric value had a non-singular value.
%s char %s Output an s if the previously displayed numeric value had a non-singular value.
%host string %s Display the TCP/IP host name of the node on which the monitoring data was collected.
%image_ident string %s PMDF version number as recorded in the PMDF shared library.
%image_link_date string %s Date and time the PMDF shared library was linked.
%node string %s Display the DECnet node name (VMS) or TCP/IP host name (UNIX) of the node on which the monitoring data was collected.
%time string %s Display the date and time at which the monitoring data was collected.
%time_zone_name string %s Display the name for the time zone under which the monitoring data was collected.
%time_zone_offset int %+04d Display the numeric time zone offset, in minutes, for the time zone under which the monitoring data was collected.
%time_zone_offset_hm int %s Display the numeric time zone offset, in hhmm format, for the time zone under which the monitoring data was collected.

Table 33-7 Substitution Strings for Use with the show_counters Command
Substitution string Type Format Description
%counter_channel string %s The channel's name.
%counter_delivered_messages int %d Total cumulative count of messages processed (dequeued) by the channel.
%counter_delivered_messages_rate_5 float
%counter_delivered_messages_rate_5_min
%counter_delivered_messages_rate_5_max
%counter_delivered_messages_acc_5
%counter_delivered_messages_acc_5_min
%counter_delivered_messages_acc_5_max
%counter_delivered_messages_rate_15
%counter_delivered_messages_rate_15_min
%counter_delivered_messages_rate_15_max
%counter_delivered_messages_acc_15
%counter_delivered_messages_acc_15_min
%counter_delivered_messages_acc_15_max
%counter_delivered_messages_rate_60
%counter_delivered_messages_rate_60_min
%counter_delivered_messages_rate_60_max
%counter_delivered_messages_acc_60
%counter_delivered_messages_acc_60_min
%counter_delivered_messages_acc_60_max
%.2f Rate of change (_rate_) and acceleration (_acc_), measured in messages per minute and messages per minute per minute, averaged over the past 5, 15, and 60 minutes. Also, the minimum and maximum values for these values.
%counter_delivered_recipients int %d Total cumulative count of message recipients processed (dequeued) by the channel.
%counter_delivered_volume_b
%counter_delivered_volume_k
%counter_delivered_volume_m
%counter_delivered_volume_g
float %.2f Total cumulative count of message volume processed (dequeued) by then channel as measured in bytes, kilobytes, megabytes, and gigabytes.
%counter_received_messages int %d Total cumulative count of messages sent to the channel (messages enqueued to the channel).
%counter_received_messages_rate_5 float
%counter_received_messages_rate_5_min
%counter_received_messages_rate_5_max
%counter_received_messages_acc_5
%counter_received_messages_acc_5_min
%counter_received_messages_acc_5_max
%counter_received_messages_rate_15
%counter_received_messages_rate_15_min
%counter_received_messages_rate_15_max
%counter_received_messages_acc_15
%counter_received_messages_acc_15_min
%counter_received_messages_acc_15_max
%counter_received_messages_rate_60
%counter_received_messages_rate_60_min
%counter_received_messages_rate_60_max
%counter_received_messages_acc_60
%counter_received_messages_acc_60_min
%counter_received_messages_acc_60_max
%.2f Rate of change (_rate_) and acceleration (_acc_), measured in messages per minute and messages per minute per minute, averaged over the past 5, 15, and 60 minutes. Also, the minimum and maximum values for these values.
%counter_received_recipients int %d Total cumulative count of message recipients sent to the channel (recipients enqueued to the channel).
%counter_received_volume_b
%counter_received_volume_k
%counter_received_volume_m
%counter_received_volume_g
float %.2f Total cumulative count of message volume sent to the channel (enqueued to the channel) as measured in bytes, kilobytes, megabytes, and gigabytes.
%counter_stored_messages
%counter_stored_messages_min
%counter_stored_messages_max
int %d Count of messages currently enqueued to the channel as well as the minimum and maximum recorded counts for these values.
%counter_stored_messages_avg_5 float
%counter_stored_messages_avg_5_min
%counter_stored_messages_avg_5_max
%counter_stored_messages_avg_15
%counter_stored_messages_avg_15_min
%counter_stored_messages_avg_15_max
%counter_stored_messages_avg_60
%counter_stored_messages_avg_60_min
%counter_stored_messages_avg_60_max
%.2f The averages over the past 5, 15, and 60 minutes of the counts of messages currently enqueued to the channel
%counter_stored_messages_rate_5 float
%counter_stored_messages_rate_5_min
%counter_stored_messages_rate_5_max
%counter_stored_messages_acc_5
%counter_stored_messages_acc_5_min
%counter_stored_messages_acc_5_max
%counter_stored_messages_rate_15
%counter_stored_messages_rate_15_min
%counter_stored_messages_rate_15_max
%counter_stored_messages_acc_15
%counter_stored_messages_acc_15_min
%counter_stored_messages_acc_15_max
%counter_stored_messages_rate_60
%counter_stored_messages_rate_60_min
%counter_stored_messages_rate_60_max
%counter_stored_messages_acc_60
%counter_stored_messages_acc_60_min
%counter_stored_messages_acc_60_max
%.2f Rate of change (_rate_) and acceleration (_acc_), measured in messages per minute and messages per minute per minute, averaged over the past 5, 15, and 60 minutes. Also, the minimum and maximum values for these values.
%counter_stored_messages_threshold int %d Stored message alarm threshold set for the channel in the option file.
%counter_stored_recipients
%counter_stored_recipients_min
%counter_stored_recipients_max
int %d Count of recipients currently enqueued to the channel and the minimum and maximum recorded counts.
%counter_stored_volume_b
%counter_stored_volume_min_b
%counter_stored_volume_max_b
%counter_stored_volume_k
%counter_stored_volume_min_k
%counter_stored_volume_max_k
%counter_stored_volume_m
%counter_stored_volume_min_m
%counter_stored_volume_max_m
%counter_stored_volume_g
%counter_stored_volume_min_g
%counter_stored_volume_max_g
float %.2f Count of volume currently enqueued to the channel as measured in bytes, kilobytes, megabytes, and gigabytes. Also, the minimum and maximum values recorded for these values.
%counter_submitted_messages int %d Total cumulative count of messages sent by the channel (enqueued by the channel).
%counter_submitted_messages_rate_5 float
%counter_submitted_messages_rate_5_min
%counter_submitted_messages_rate_5_max
%counter_submitted_messages_acc_5
%counter_submitted_messages_acc_5_min
%counter_submitted_messages_acc_5_max
%counter_submitted_messages_rate_15
%counter_submitted_messages_rate_15_min
%counter_submitted_messages_rate_15_max
%counter_submitted_messages_acc_15
%counter_submitted_messages_acc_15_min
%counter_submitted_messages_acc_15_max
%counter_submitted_messages_rate_60
%counter_submitted_messages_rate_60_min
%counter_submitted_messages_rate_60_max
%counter_submitted_messages_acc_60
%counter_submitted_messages_acc_60_min
%counter_submitted_messages_acc_60_max
%.2f Rate of change (_rate_) and acceleration (_acc_), measured in messages per minute and messages per minute per minute, averaged over the past 5, 15, and 60 minutes. Also, the minimum and maximum values for these values.
%counter_submitted_recipients int %d Total cumulative count of message recipients sent to by the channel (enqueued to by the channel).
%counter_submitted_volume_b
%counter_submitted_volume_k
%counter_submitted_volume_m
%counter_submitted_volume_g
float %.2f Total cumulative count of message volume sent by the channel (enqueued by the channel) as measured in bytes, kilobytes, megabytes, and gigabytes.

33.7.3.3.2 .HELD messages: command=show_held

The show_held command may be used to determine whether or not there are .HELD message files. This command merely determines whether or not such files exist; it does not return a count of how many such files there are. On systems which have large volumes of queued messages, this command may take a while to execute. Parameters which may be supplied in conjunction with the command are listed in the following table.
Parameter   Description
held_format= file-spec Required Name of the formatting file to use to format .HELD message information. The recognized substitution strings for this command are listed in Table 33-6 and Table 33-8.
success_format= file-spec Required Name of the formatting file to use to format the results when the command is successful.
error_format= file-spec Required Name of the formatting file to use to format the results when the command fails.
Each of the file-spec file specifications must be relative file paths specifying files in the pmdf_root:[www.monitor] directory (OpenVMS) or the /pmdf/www/monitor/ directory (UNIX).

An example URL for a GET command might be


http://host:7633/monitor/?command=show_held&success_format=hsuccess.txt& 
  error_format=herror.txt 

Table 33-8 Substitutions Strings for Use with the show_held Command
Substitution string Type Format Description
%held_messages int %d Has value 0 when there are no .HELD message files and the value 1 when there are .HELD message files.

33.7.3.3.3 General Information: command=show_pmdf

The show_pmdf command displays general information about PMDF. Parameters which may be used with the command are listed below.
Parameter   Description
pmdf_format= file-spec Required Name of the formatting file to use to format PMDF information. The recognized substitution strings for this command are listed in Table 33-6.
success_format= file-spec Required Name of the formatting file to use to format the results when the command is successful.
error_format= file-spec Required Name of the formatting file to use to format the results when the command fails.
Each of the file-spec file specifications must be relative file paths specifying files in the pmdf_root:[www.monitor] directory (OpenVMS) or the /pmdf/www/monitor/ directory (UNIX).

An example URL for a GET command might be


http://host:7633/monitor/?command=show_pmdf&pmdf=pmdf.txt& 
  success_format=psuccess.txt&error_format=perror.txt 

33.7.3.3.4 Processing Queues: command=show_queue

The show_queue command displays information about OpenVMS processing queues and jobs. This command is only available on OpenVMS PMDF systems. The parameters recognized by the command are listed below.
Parameter   Description
queue_format= file-spec Required Name of the formatting file to use to format processing queue information. The recognized substitution strings for this command are listed in Table 33-6 and Table 33-9.
job_format= file-spec Optional Name of the formatting file to use to format processing job information. The recognized substitution strings for this command are listed in Table 33-6 and Table 33-10.
queue_name= name Optional Name of the processing queue to display information for. Wildcards are permitted. If this option is not specified, each processing queue used by PMDF will be scanned.
success_format= file-spec Required Name of the formatting file to use to format the results when the command is successful.
error_format= file-spec Required Name of the formatting file to use to format the results when the command fails.

7That is, the MAIL$BATCH queue and any other processing queue called out in the PMDF configuration file by means of the queue channel keyword.

Each of the file-spec file specifications must be relative file paths specifying files in the pmdf_root:[www.monitor] directory (OpenVMS) or the /pmdf/www/monitor/ directory (UNIX).

For each queue matching the queue name pattern, the queue file and optional job format file will be used to format the information for that queue. It is important to note that the %first, %last, %!first, and %!last formatting strings are handled in a special way when both queue and job formatting files are specified. In that case, the first flag is only true for the first queue entry formatted by the queue file. It is not true while the job information is being formatted. The last flag is never true while the queue information is being formatted. It is only true when the last job of the last queue is being formatted.

An example URL for a GET command might be


http://host:7633/monitor/?command=show_queue&queue_format=queue.txt& 
  job_format=job.txt&success_format=qsuccess.txt&error_format=qerror.txt& 
  queue_name=MAIL$BATCH 

Table 33-9 Queue Substitution Strings for Use with the show_queue Command
Substitution string Type Format Description
%queue_assigned_name string %s Name of the execution queue associated with the logical queue name.
%queue_base_priority uint %u The priority at which at which batch jobs submitted to the queue are initiated or the priority of a symbiont process that controls output execution queues for the queue.
%queue_cpu_default_s
%queue_cpu_default_m
%queue_cpu_default_h
%queue_cpu_default_d
uint %.2f The default CPU time limit, displayed in units of seconds, minutes, hours, or days, for jobs submitted to the queue.
%queue_cpu_default_dhms uint %u %02u:%02u:%02u The default CPU time limit, displayed in "dd hh:mm:ss" format, for jobs submitted to the queue.
%queue_cpu_limit_s
%queue_cpu_limit_m
%queue_cpu_limit_h
%queue_cpu_limit_s
uint %.2f The maximum CPU time limit, displayed in units of seconds, minutes, hours, or days, for jobs submitted to the queue.
%queue_cpu_limit_dhms uint %u %02u:%02u:%02u The maximum CPU time limit, displayed in "DD HH:MM:SS" format, for jobs submitted to the queue.
%queue_default_form_name string %s The name of the default form associated with the queue.
%queue_default_form_stock string %s The name of the default paper stock associated with the queue.
%queue_description string %s Description associated with the queue.
%queue_device_name string %s The name of the device on which the specified output execution queue is located.
%queue_executing_job_count uint %u Count of jobs currently being executed in the queue.
%queue_flags uint %s Queue processing flags.
%queue_form_name string %s Form name associated with the queue.
%queue_form_stock string %s Paper stock associated with the queue.
%queue_generic_target string %s The names of the execution queues which are enabled to accept from the queue.
%queue_holding_job_count uint %u The count of jobs being held in the queue until explicitly released for execution.
%queue_job_limit uint %u The number of jobs which can execute simultaneously in the queue.
%queue_job_reset_modules string %s The names of the text modules that are to be extracted from the device control library and copied to the printer prior to each print job.
%queue_job_size_maximum uint %u The maximum number of disk blocks that a print job initiated from the queue may contain.
%queue_job_size_minimum uint %u The minimum number of disk blocks that a print job initiated from the queue may contain.
%queue_library_specification string %s The name of the device control library for the queue.
%queue_name string %s The name of the queue.
%queue_owner_uic uint %s The UIC of the owner of the queue.
%queue_pending_job_block_count uint %u The total number of blocks for all pending jobs in the queue. Applies only to execution queues.
%queue_pending_job_count uint %u The total number of jobs pending execution in the queue.
%queue_processor string %s The name of the symbiont image associated with the queue.
%queue_protection uint %s The protection mask associated with the queue.
%queue_retained_job_count uint %u The number of jobs in the queue retained after execution.
%queue_scsnode_name string %s The name of the node on which the queue is located. Applies only to execution queues.
%queue_status uint %s The status of the queue.
%queue_timed_release_job_count uint %u The number of jobs in the queue on hold until a specified time.
%queue_type uint %s A text string describing the type of queue.
%queue_wsdefault uint %u The default working set size for jobs run in the queue. Applies only to batch and execution queues.
%queue_wsextent uint %u The default working set extent for jobs run in the queue. Applies only to batch and execution queues.
%queue_wsquota uint %u The default working set quota for jobs run in the queue. Applies only to batch and execution queues.

Table 33-10 Job Substitution Strings for Use with the show_queue Command
Substitution string Type Format Description
%job_account_name string %s Account name of the owner of the job.
%job_after_time string %s Date and time when the job is scheduled to be released to run (/AFTER).
%job_checkpoint_data string %s Job's checkpoint data stored in the BATCH$RESTART DCL symbol.
%job_cli string %s The command language interpreter to be used to execute the job (/CLI).
%job_completed_blocks uint %u Blocks completed so far by the symbiont for the job. Applies only to print jobs.
%job_completion_queue string %s Name of the queue in which the job was executed.
%job_completion_time string %s Date and time at which the job finished executing.
%job_condition_vector uint %u Final completion status code for the job.
%job_copies uint %u Number of copies to be printed by the print job (/COPIES). Applies only to print jobs.
%job_copies_done uint %u Copies printed so far by the symbiont for the job. Applies only to print jobs.
%job_cpu_limit_s
%job_cpu_limit_m
%job_cpu_limit_h
%job_cpu_limit_d
float %.2f CPU time limit allowed for the job displayed in seconds, minutes, hours, or days (/CPUTIME).
%job_cpu_limit_dhms uint %u %02u:%02u:%02u CPU time limit allowed for the job displayed in "DD HH:MM:SS" format (/CPUTIME).
%job_entry_number uint %u Queue entry number assigned to the job.
%job_file_count uint %u Count of files submitted for the job.
%job_flags uint %s Job processing flags.
%job_form_name string %s Name of the print form associated with the job or queue (/FORM=). Applies only to print jobs.
%job_form_stock string %s Name of the paper stock associated with to be used for the job. Applies only to print jobs.
%job_log_queue string %s Name of the print queue to which the log for the job is to be submitted for printing (/PRINTER).
%job_log_specification string %s File specification for the job's log file (/LOG).
%job_name string %s Name associated with the job (/NAME).
%job_note string %s Note associated with the job (/NOTE).
%job_operator_request string %s Request to be sent to the operator before the job begins execution (/OPERATOR).
%job_parameter_1
%job_parameter_2
%job_parameter_3
%job_parameter_4
%job_parameter_5
%job_parameter_6
%job_parameter_7
%job_parameter_8
string %s Parameters P1 through P8 associated with the job (/PARAMETER).
%job_pending_reason uint %s Reason for why the job is pending execution.
%job_pid uint %08x Process identifier of the process executing the job request.
%job_priority uint %u Job processing priority (/PRIORITY).
%job_queue_name string %s Name of the queue that contains the job (/QUEUE).
%job_requeue_queue_name string %s Name of the queue to which the job has been reassigned.
%job_restart_queue_name string %s Name of the queue to submit the job to should the job be restarted.
%job_retention_time string %s The time until which the job should be retained in the queue.
%job_size uint %u Size of the job as measured in 512 byte blocks ( e.g., size of the command procedure to be executed or the size of the file to be printed).
%job_status uint %s Job status information.
%job_submission_time string %s Date and time when the job was submitted to the queue.
%job_uic uint %s UIC of the account under which the job was submitted.
%job_username string %s Username of the account under which the job was submitted (/USER).
%job_wsdefault uint %u Job's working set default (/WSDEFAULT).
%job_wsextent uint %u Job's working set extent (/WSEXTENT).
%job_wsquota uint %u Job's working set quota (/WSQUOTA).

33.7.3.3.5 HTML SUBMIT Buttons: noop=label

The noop=label pair is provided as an aid to processing HTTP POST requests generated with HTML forms. The need for this command relates to a shortcoming of HTML. In HTML, the form submit operation is realized through the following HTML tag:


<INPUT TYPE="SUBMIT" NAME="command" VALUE="y"> 
That tag generates the URL-encoded command command=y when the button labelled y is activated. But here's the rub: the label which appears on the button must be the same as the command to be submitted. So as to prevent HTML authors from having to label buttons to match the CGI's command names, the noop command is provided. It is used as follows


<INPUT TYPE="HIDDEN" NAME="command" VALUE="command-name"> 
<INPUT TYPE="SUBMIT" NAME="noop" VALUE="button-label"> 
The above allows whatever text label is desired to be placed on the submission button. When the submission button is generated a URL-encoded command of the form


noop=button-label&command=command-name&parameter-name-1=parameter-value-1... 
is sent to the CGI. The CGI ignores the noop= button-label pair and processes the remainder of the URL encoded command.

33.7.3.4 An HTTP GET Example

The following example illustrates three formatting files---command-specific, success, and error---which might be used to display information about the PMDF channel counters. An HTTP request using these files might issue an HTTP GET for the URL


http://host:7633/monitor/?command=show_channels&counters_format=counters.txt 
  &success_format=success.txt&error_format=error.txt 

The command-specific formatting file is shown in Example 33-4. The file builds a table displaying each channel name (%counter_channel) and the count of messages currently enqueued to the channel (%counter_stored_messages). In addition, the cumulative count of messages enqueued to (%counter_received_messages), dequeued by (%counter_delivered_messages), and enqueued by (%counter_submitted_messages) the channel are also shown. The values for each PMDF channel are substituted into the HTML in place of the substitution strings which begin with %. The %first and %last substitution strings are used to generate HTML for the start and end of the table.

Once information for each channel is formatted, the success formatting file of Example 33-5 is then used to produce the final content of the HTTP response to be sent back to the client. Sample HTML output is shown in Example 33-7; that output builds a table appearing similar to the one shown below:


PMDF channel counters 
 
            Current Messages           Cummulative Messages 
                 Enqueued to   Enqueued to  Dequeued by  Enqueued by 
 conversion                1         2300          2299            0 
 l                        23        18021         17998        19473 
 tcp_local               147        13522         13375          321 
Should an error occur, the error formatting file of Example 33-6 will instead be used to format the response sent back to the client.

Example 33-4 show_channels example: channels.txt formatting file

 
%first{<TABLE BORDER><TR><TH><TH>Current Messages<TH COLSPAN=3>} 
%first{Cummulative Messages<TR ALIGN="right"><TH><TH>Enqueued to} 
%first{<TH>Enqueued to<TH>Dequeued by<TH>Enqueued by} 
<TR ALIGN="right"><TD ALIGN="left">%counter_channel 
<TD>%counter_stored_messages<TD>%counter_received_messages 
<TD>%counter_delivered_messages<TD>%counter_submitted_messages 
%last{</TABLE>} 
 

Example 33-5 show_channels example: success.txt formatting file

 
<HTML> 
<HEAD> 
<META HTTP-EQUIV="Refresh" CONTENT="60"> 
<TITLE>PMDF channel counters</TITLE> 
</HEAD> 
<BODY> 
<B>PMDF channel counters</B> 
<P> 
%s 
</BODY> 
</HTML> 
 

Example 33-6 show_channels example: error.txt formatting file

 
<META HTTP-EQUIV="Refresh" CONTENT="60"> 
<HTML> 
<HEAD>PMDF Channel Counters</HEAD> 
<BODY> 
 
Unable to obtain information on the PMDF channels.  Output from the server is 
shown below 
 
<P> 
<HR> 
<P> 
%s 
<P> 
<HR> 
</BODY> 
</HTML> 
 

Example 33-7 show_channels example: the resulting HTML output

 
<HTML> 
<HEAD> 
<META HTTP-EQUIV="Refresh" CONTENT="60"> 
<TITLE>PMDF channel counters</TITLE> 
</HEAD> 
<BODY> 
<B>PMDF channel counters</B> 
<P> 
<TABLE BORDER><TR><TH><TH>Current Messages<TH COLSPAN=3> 
Cummulative Messages<TR ALIGN="right"><TH><TH>Enqueued to 
<TH>Enqueued to<TH>Dequeued by<TH>Enqueued by 
<TR ALIGN="right"><TD ALIGN="left">conversion 
<TD>1<TD>2300 
<TD>2299<TD>0 
<TR ALIGN="right"><TD ALIGN="left">l 
<TD>23<TD>18021 
<TD>17998<TD>19473 
<TR ALIGN="right"><TD ALIGN="left">tcp_local 
<TD>147<TD>13522 
<TD>13375<TD>321 
</TABLE> 
</BODY> 
</HTML> 
 

Note

6 At present, substitution strings appearing within the text to be substituted are ignored and treated as literal text.


Previous Next Contents Index