WASD VMS Web Services - Features and Facilities

13 - Utilities and Facilities

13.1 - Echo Facility 13.2 - Hiss Facility 13.3 - Stream Facility 13.4 - Where Facility 13.5 - Xray Facility 13.6 - ApacheBench 13.7 - CALogs 13.8 - HTAdmin 13.9 - HTTPd Monitor 13.10 - MD5digest 13.11 - QDLogStats 13.12 - SECHAN Utility 13.13 - StreamLF Utility 13.14 - WASDbench :^) 13.15 - WOTSUP Utility
next previous contents full-page

Foreign commands for external utilities (and the HTTPD control functionality) will need to be assigned from the adminstration users' LOGIN.COM either explicitly or by calling the WASD_ROOT:[EXAMPLE]WASDVERBS.COM procedure.

$ AB == "$WASD_EXE:AB"
$ HTTPD == "$WASD_EXE:HTTPD"
$ HTTPDMON == "$WASD_EXE:HTTPDMON"
$ MD5DIGEST == "$WASD_EXE:MD5DIGEST"
$ QDLOGSTATS == "$WASD_EXE:QDLOGSTATS"
$ SECHAN == "$WASD_EXE:SECHAN"
$ STREAMLF == "@WASD_EXE:STREAMLF"
$ WB == "$WASD_EXE:WB"

13.1 - Echo Facility

Ever had to go to extraordinary lengths to find out exactly what your browser is sending to the server? The server provides a request echo facility. This merely returns the complete request as a plain-text document. This can be used for for checking the request header lines being provided by the browser, and can be valuable in the diagnosis of POSTed forms, etc.

This facility must be enabled through a mapping rule entry.

script /echo/* /echo/*

It may then be used with any request merely by inserting "/echo" at the start of the path, as in the following example.

http://www.example.com/echo/wasd_root/

13.2 - Hiss Facility

The hiss facility provides a response stream made up of random alpha-numeric characters (a sort of alpha-numeric white-noise). No response header is generated and the stream will continue (by default) up to one megabyte of output, or until the client closes the connection. This maximum may be controlled my appending an integer representing the number of kilobytes maximum to the mapping. This facility must be enabled through a mapping rule entry and may then be used for specific requests.

map /**.dll* /hiss/64/*.dll*
map /**/system32/* /hiss/64/*/system32/*
map /**default.ida* /hiss/64/*default.ida*
script /hiss/* /hiss/*

Usage details are described in "WASD VMS Web Services - Install and Config"; 5 - Security Considerations WASD Web Services - Install and Config .

13.3 - Stream Facility

The stream facility provides a quantified or unlimited response stream of printable or binary octets. It is intended as a light-weight data source delivering content at the maximum throughput capable by the server and platform. This can be used as a test source or for end-to-end metrics. This facility must be enabled through a mapping rule.

script /stream/* /stream/*

It may then be used to generate streams of data with various characteristics and sizes by including parameters in the URL.

13.4 - Where Facility

Need to locate where VMS has the HTTPd files? This simple facility maps the supplied path then parses it to obtain a resulting VMS file specification. This does not demonstrate whether the path actually exists!

This facility must be enabled through a mapping rule entry.

script /where/* /where/*

It may then be used with any request merely by inserting "/where" at the start of the path, as in the following example.

http://www.example.com/where/wasd_root/

13.5 - Xray Facility

The Xray facility returns a request's complete response, both header and body, as a plain text document. Being able to see the internals of the response header as well as the contents of the body rendered in plain text can often be valuable when developing scripts, etc.

This facility must be enabled through a mapping rule entry.

script /Xray/* /Xray/*

It may then be used with any request merely by inserting "/xray" at the start of the path, as in the following example.

http://www.example.com/xray/wasd_root/

13.6 - ApacheBench

This server stress-test and benchmarking tool, as used in the Apache Distribution, is included with the WASD package (sourced from http://webperf.zeus.co.uk/ab.c), within license conditions.

Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd.
Copyright (c) 1998 The Apache Group.

ApacheBench will only compile and run for Alpha, Itanium or VAX systems with VMS 7.n or greater available. Also see the WASD analogue, 13.14 - WASDbench :^). ApacheBench is a simple but effective tool, allowing a single resource to be requested from a server a specified number of times and with a specified concurrency. This can be used to benchmark a server or servers, or be used to stress-test a server configuration's handling of variable loads of specific resquests (before exhausting process quotas, etc.) This utility has remained at the 1.3 release due to subsequent versions (e.g. 2.0) having Apache API dependencies.

A small addition to functionality has been made. The WASD ApacheBench displays a count of the HTTP response categories received (i.e. the number of 2nns, 4nns, etc.) This allows easier assessment of the relevance of results (i.e. measuring performance of some aspect only to find the results showed the performance of 404 message generation - and yes, an annoying experience of the author's prompted the changes!)

The following examples illustrate its use.

$ AB -H
$ AB -C 10 -N 100 http://the.server.name/wasd_root/exercise/0k.txt
$ AB -C 50 -N 500 -K http://the.server.name/wasd_root/exercise/64k.txt
$ AB -C 10 -N 100 http://the.server.name/cgi-bin/cgi_symbols

13.7 - CALogs

The Consolidate Access LOGS utility (pronounced similar to the breakfast cereal brand :-) merges multiple HTTP server common and combined format access logs into a single log file with records in time-order. Due to the granularity of HTTP server entry timestamps (one second) the records are sorted to the one second but not within the one second.

It uses RMS and the VMS sort-merge routines to provide the basic consolidation functionality. An RMS search uses the supplied wildcard log file specification. Matching files are opened and each record read. The date/time field is parsed and a binary timestamp generated. Records with formats or date/time fields that do not make sense to the utility are discarded. When all files have been processed the sort-merge is performed using the timestamp as the key. The sorted records are then written to the specified output file.

$ calogs <log-file-spec> [<output-file-name>] [<qualifiers>]

Parameters and Qualifiers
ParameterDescription
/HELPbasic usage information
/NOPROXYdiscard proxy service records
/NOWASDdiscard WASD server status/timestamp entries
/OUTPUT=alternate method of specifying merged file name
/PROXYdiscard non-proxy service records
/QUIETno messages apart from errors
/VERBOSEper-file progress messages
/VERSIONdisplay the utility version and copyright message

Usage Examples

$ CALOGS == "$WASD_EXE:CALOGS"
$ CALOGS WASD_LOGS:*200205*.LOG 2002_MAY.LOG
$ CALOGS /VERBOSE WASD_LOGS:
$ CALOGS /NOWASD WASD_LOGS:*200206*.LOG_* /OUTPUT=2002_JUNE.LOG
$ CALOGS /PROXY /NOWASD WASD_LOGS:*2002*.LOG 2002_PROXY.LOG

13.8 - HTAdmin

The HTAdmin utility assists in with the command-line maintenance of $HTA authorization databases. See WASD Web Services - Install and Config document, "Authorization Configuration" section, and 3 - Authentication and Authorization.

$ htadmin <database> [<username>] [<qualifiers>]

Parameters and Qualifiers
ParameterDescription
/ADDadd a new record
/CONFIRMconfirm deletion of database
/CONTACT="<string>"contact information for record
/CREATEcreate a new database
/CSV[=TAB|char]comma-separated listing (optional character)
/DATABASE=database name (or as command-line parameter)
/DELETEdelete a database or username record from a database
/DISABLEDusername record is disabled (cannot be used)
/EMAIL="<string>"email address for record
/ENABLEDusername record is enabled (can be used)
/FULLlisting showing full details
/GENERATEgenerate a six character password
/HELPbasic usage information
/[NO]HTTPSsynonym for /SSL
/LISTlisting (brief by default, see /FULL and /CSV)
/MODIFYsynonym for /UPDATE
/NAME="<string>"full name for username record
/OUTPUT=alternate output for database listing
/PASSWORD[=<string>]username record password (prompts if not supplied)
/PINgenerate four-digit "PIN number" for password
/[NO]READusername can/can't read
/SORT[=<parameters>]sort the records into a new/another database
/[NO]SSLuser can only authenticate via SSL ("https:")
/[NO]WRITEusername can/can't write
/UPDATEupdate an existing username record
/USER=<string>username
/VERSIONdisplay version of HTADMIN

Usage Examples

Sort Details

The /SORT qualifier sorts the current database records according to the /SORT= parameters. It can be used with the /LIST qualifier to produce ordered reports or will output the records into another authentication file. By default it sorts ascending by username. Qualifier parameters allow a sort by DATE or COUNT. Each of these allows the further specification of which date or count; ACCESS, CHANGE or FAILURE.

13.9 - HTTPd Monitor

The HTTP server may be monitored in real-time using the HTTPDMON utility.

[graphic]  HTTPDMON Graphic

This utility continuously displays a screen of information comprising three or four of the following sections:

  1. Process Information
    HTTPd process information includes its up-time, CPU-time consumed (excluding any subprocesses), I/O counts, and memory utilization. The "Servers:" item shows how many servers are currently running on the node/cluster. Changes in this count are indicated by the second, parenthesized number.
  2. General Server Counters
    The server counters keep track of the total connections received, accepted, rejected, etc., totals for each request type (file transfer, directory listing, image mapping, etc.).
  3. Proxy Serving Counters
    The server counters keep track of proxy serving connections, network and cache traffic, cache status, etc.
  4. Latest Request
    This section provides the response status code, and some transaction statistics, the service being accessed, originating host and HTTP request. Note that long request strings may be truncated (indicated by a bolded ellipsis).
  5. Status Message
    If the server is in an exceptional condition, for example exited after a fatal error, starting up, etc., a textual message may be displayed in place of the the request information. This may be used to initiate remedial actions, etc.

The following shows example output:

   I64::           HTTPDMON v2.4.0 IA64          Tuesday, 17-NOV-2009 23:57:25

Process: WASD:80  PID: 24400436  User: HTTP$SERVER  Version: 10.0.0
     Up: 1 05:23:30.67  CPU: 0 00:00:02.05  Startup: 2  Exit: %X00000001
Pg.Flts: 2269  Pg.Used: 8%  WsSize: 36640  WsPeak: 16864
    AST: 1996/2000  BIO: 1998/2000  BYT: 1992640/1992640  DIO: 1000/1000
    ENQ:  477/500   FIL:  296/300   PRC:     100/100       TQ:   98/100

Request: 107  Current: 0/0  Throttle: 0/0/0%  Peak: 4/2
 Accept: 44  Reject: 0  Busy: 0  SSL: 35/80%
CONNECT: 0  GET: 107  HEAD: 0  POST: 0  PUT: 0  (0)
  Admin: 80  Cache: 9/0/0  DECnet: 0/0  Dir: 1
    DCL: CGI:1 CGIplus:1/0 RTE:0/0 Prc:2/0
   File: 16/6  Proxy: 0  Put: 0  SSI: 0  WebDAV: 0/0

    0xx: 0  2xx: 93  3xx: 6  4xx: 7 (403:1)  5xx: 0
     Rx: 67,162 (6 err) Tx: 939,153 (0 err) (3.9kB/S)

   Time: 17 23:56:52  Status: 200  Rx: 835  Tx: 14,762  Dur: 0.459 (34.0kB/S)
Service: https://i64.kednos.com:443
   Host: clive.vsm.com.au (150.101.13.12)
Request: GET /httpd/-/admin/ (********.***)

The "/HELP" qualifier provides a brief usage summary.

The server counter values are carried over when a server (re)starts (provided the system has stayed up). To reset the counters use the online Server Administration facility (9 - Server Administration).

If [DNSlookup] is disabled for the HTTP server the HTTPDMON utility attempts to resolve the literal address into a host name. This may be disabled using the /NORESOLVE qualifier.

13.10 - MD5digest

From RFC1321 ...

" The [MD5] algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. "

The MD5DIGEST utility is primarily provided with WASD for verifying kits as unchanged from the originals released. With the proliferation of mirror sites and other distribution resources it has become good practice to ensure kits remain unchanged from release, to distribution, to installation site (changes due to to data corruption or malicious intent - as remote a possibility as that may seem). Of course it may also be used for any other purpose where the MD5 hash is useful.

For verifying the contents of a WASD release connect to the original WASD distribution site, refer to the download page, and make a comparison between the release MD5 hash found against the list of all archive hashes and the MD5 hash of your archive. That can be done as follows

$ MD5DIGEST == "$WASD_EXE:MD5DIGEST"
$ MD5DIGEST device:[dir]archive.ZIP
The result will look similar to
MD5 (kits:[000000]htroot710.zip;1) = 404bbdfe0f847c597b034feef2d13d2d

Of course, if you have not yet installed your first WASD distribution using the MD5DIGEST utility that is part of it is not feasable. The original site can provide kits and pre-built executables for this purpose.

13.11 - QDLogStats

Quick-and-Dirty LOG STATisticS is a utility to extract very elementary statistics from Web server common/combined format log files. It is intended for those moments when we think "I wonder how many times that new archive has been downloaded?", "How much data was transfered during November?", "How often is such-and-such a client using the authenticated so-and-so service?", "How much has the mail service been used?" ... and want the results in a matter of seconds (or at least a few tens of seconds ;-) It is available at the command-line and as a CGI script.

[graphic]  QDLOGSTATS Graphic

For QDLOGSTATS to be available as a CGI script it must have authorization enabled against it (to prevent potential ad hoc browsing of a site's logs). The following provides some indication of this configuration, although of course it requires tailoring for any given site.

[VMS]
/cgi-bin/qdlogstats ~webadmin,131.185.250.*,r+w ;

It could then be accessed using

http://the.host.name/cgi-bin/qdlogstats

The initial access provides a form allowing the various filters and other behaviours to be selected. The CGI form basically parallels the command-line behaviour described below.

Filters

A number of filters allow subsets of the log contents to be selected. These filters support the same string matching expressions as the server (see "WASD VMS Web Services - Install and Config"; 6 - String Matching WASD Web Services - Install and Config ).

A knowlege of the format and contents of the common and combined log formats will assist in deciding which and to what purpose filters should be used. Record filtering is done in the same order as is finally displayed, so method would be processed before user-agent for instance. Normally a record match terminates on the first non-matched filter (to expedite processing). To compare and report each filter for every record apply the /ALL qualifier. To view records as they are processed use the /VIEW qualifier. This by default displays all matched records, but the optional =ALL or =NOMATCH parameters will display all records, or all those but the matches.

$ QDLOGSTATS log-file-spec [pattern qualifiers] [other qualifiers]

Parameters and Qualifiers
ParameterDescription
/ALLcompare and report on all supplied filters
/AUTHUSER=pattern (any authenticated username)
/BEFORE=log files before this VMS date/time
/CLIENT=pattern (client host name or IP address)
/DATETIME=pattern ("11/Jun/1999:14:08:49 +0930")
/DECODE[=keyword]URL-decode PATH, QUERY, REFERER before match
/METHOD=pattern (HTTP "GET", "POST", etc.)
/OUTPUT=file specification
/PATH=pattern (URL path component only)
/PROGRESSshow progress during processing; a "+" for each file started, a "." for each 1000 records processed
/QUERY=pattern (URL query component only)
/REFERER=pattern (HTTP "Referer:" field, COMBINED only)
/REMOTEID=pattern (RFC819 file)
/RESPONSE=pattern (HTTP response code)
/SINCE=log files after this VMS date/time
/SIZE[=keyword]response size (in bytes) MIN=integer MAX=integer
/USERAGENT=pattern (HTTP "User-Agent:" field, COMBINED only)
/VIEW[=type]display matching log records (ALL, NOMATCH, MATCH)

Usage Examples

13.12 - SECHAN Utility

The SECHAN utility (pronounced "session") is used by [INSTALL]SECURE.COM and associated procedures to make file system security settings. It is also available for direct use by the site administrator. See "WASD VMS Web Services - Install and Config"; 5 - Security Considerations WASD Web Services - Install and Config .

13.13 - StreamLF Utility

This simple procedure used the FDL facility to convert files to STREAM_LF format. The WASD HTTPd server access STREAM_LF files in block/IO-mode, far more efficiently that the record-mode required by variable-record format files.

NOTE: The server can also be configured to automatically convert any VARIABLE record format files it encounters to STREAM_LF.

13.14 - WASDbench :^)

WASDbench - an analogue to ApacheBench (13.6 - ApacheBench) Why have it? ApacheBench only compiles and runs on VMS 7.n and later. This version should compile and run for all supported WASD configurations. It also has the significant performance advantage (looks like ~25%) of using the underlying $QIO services and not the socket API, and is AST event driven rather than using the likes of select(). It is not a full implementation of AB (for instance, it currently does not do POSTs). The CLI attempts to allow the same syntax as used by AB (within the constraint that not all options are supported) so that it is relatively easy to switch between the two (perhaps for comparison purposes) if desired.

The following examples illustrate its use.

$ WB -H
$ WB -C 10 -N 100 http://the.server.name/wasd_root/exercise/0k.txt
$ WB -C 50 -N 500 -K http://the.server.name/wasd_root/exercise/64k.txt
$ WB -C 10 -N 100 http://the.server.name/cgi-bin/cgi_symbols

WASDbench also has an exercise option, functionality is not found in ApacheBench. It is basically to supercede similar functionality provided by the retired WWWRKOUT. The exercise functionality allows WASDbench to be used to stress-test a server. This behaviour includes mixing HEAD (~5%) with GET requests, and breaking requests during both request and response transfers (~5%). These are designed to shake up the server with indeterminate request types and client error behaviours. The best way to utilize this stress-testing is wrap WASDbench with a DCL procedure providing a variety of different requests types, quantities and concurrencies.

$!(example "wrapper" procedure)
$ IF P1 .EQS. "" THEN P1 = F$GETSYI("NODENAME")
$ WB = "$WASD_EXE:WB"
$ SPAWN/NOWAIT WB +e +s +n -n 100 -c  5    http://'p1'/wasd_root/exercise/0k.txt
$ SPAWN/NOWAIT WB +e +s -k -n  50 -c  5 -k http://'p1'/wasd_root/exercise/64k.txt
$ SPAWN/NOWAIT WB +e +s    -n  50 -c  2    http://'p1'/cgi-bin/conan
$!(delay spawning anymore until this one concludes)
$              WB +e +s    -n 100 -c  5    http://'p1'/wasd_root/*.*
$ SPAWN/NOWAIT WB +e +s +n -n 100 -c  1    http://'p1'/wasd_root/exercise/16k.txt
$ SPAWN/NOWAIT WB +e +s    -n  10 -c  1    http://'p1'/cgi-bin/doesnt-exist
$ SPAWN/NOWAIT WB +e +s -k -n  50 -c  2    http://'p1'/cgi-bin/conan/search
$!(delay spawning anymore until this one concludes)
$              WB +e +s    -n  50 -c  2    http://'p1'/wasd_root/src/httpd/*.*
$!(etc.)

13.15 - WOTSUP Utility

The "WASD Over-The-Shoulder Uptime Picket" is designed to monitor WASD in a production environment for the purpose of alerting operations staff to conditions which might cause that production to be adversely impacted.

Alert triggers include:

Alert reports can be delivered via any combination of:

The utility runs in a detached process and monitors the server environment by periodically polling various server data at a default interval is 15 seconds. As the utility requires access to global memory accounting a per-system WOTSUP is required for each node to be monitored.

The following (somewhat contrived) example illustrates the format and content of a WOTSUP report delivered via OPCOM. Reports delivered via other mechanisms have the same content and similar format.

  %%%%%%%%%%  WOTSUP  24-OCT-2006 13:32:56.44  %%%%%%%%%%%
  Message from user SYSTEM on KLAATU
  Over-The-Shoulder (WASD_WOTSUP) reports:
  1. server PID 001C0950 exit %X00000001 (%SYSTEM-S-NORMAL)
  2. server STARTUP (10)
  3. server PIDs are 0018C14F (HTTPd:80), 001C0950 (HTTPe:80)
  4. pagfilcnt:395432 pgflquota:500000 79% <= 80%

For further infomation check the descriptive prologue in the WASD_ROOT:[SRC.UTILS]WOTSUP.C source code.


next previous contents full-page