Robert B. Denny 15-Sep-97
WebSite Server Monitor Applet
This applet monitors only a remote WebSite or WebSite
with three moving graphs displaying:
- number of requests per second
- response data volume in KBytes/sec
- number of current connections
If you are reading this page from a WebSite-powered site, you should
begin to see the graphs appearing by now. This document sets the applet
to sample every 10 seconds. Normally, you would set this to at least 30
seconds between samples. The full-scale values for each graph are
adjustable via applet parameters:
To display the monitor graph within an HTML document, you must insert
the <applet> tag and its parameters like this:
The size of this applet is fixed, although someday its
size may be
variable. For the time being, use the height
width values shown above. The <param...> lines
set the applet's parameters. The default values are set for sites with a
very high traffic level. You will probably want to set them lower. The
<applet code="WSMon.class" width=479 height=92>
<param name=num_samples value=16>
<param name=sample_interval value=10>
<param name=max_req_rate value=5>
<param name=max_byte_rate value=16384>
<param name=max_conns value=20>
You're viewing this page with a browser that doesn't
understand the APPLET tag. You need to upgrade to a
Java-enabled browser in order to view this Java
- The number of sample points across each graph. There is not much
point in setting this to a value that exceeds the number of screen pixels
within the width of a graph. The default is 60.
- The time, in seconds, between samples. Don't set this too short.
Each sample requires completion of an HTTP request to the server. Take
into account network delays. Also, the data volume gets updated only on
completion of an HTTP request by the server, so you will not see the
effects of a large data transfer until it's over. Then it will all show
at once. It's best to set the sample interval to at least 30 sec. The
default is 30 sec.
- The full-scale value for the requests/sec. graph (default 30)
- The full-scale value for the KBytes/sec. graph (default 150)
- The full-scale value for the current connections graph (default 60)
- server_host (not shown above)
- The DNS host name or IP address of the host to monitor. This is
only if the WSMon classes are loaded from a local file path,
resulting in the applet being trusted (see below). Defaults to
the host from which the applet classes were loaded (in accordance with
Java security policy).
The non-applet HTML within the <applet> tag (the stuff in
<blockquote> above) will be displayed by non-Java
browsers. You can put anything in there you want.
Monitoring Specific Servers
In order to monitor a server or servers other than the one from which
the applet classes are loaded, you must load the classes from your local
hard disk. By loading classes locally, you inform the Java security
monitor that the applet is trusted and may fetch documents from
any server host. A detailed explanation of the local Java environment is
beyond the scope of this document. There are a few key things you need
- The <applet> tag must specify
codebase=... that has a local file path in it.
- You must have the Java Developer's Kit 1.0 or later installed, and
your CLASSPATH environment variable appropriately configured.
- You can embed several copies of the applet in a single HTML
document, providing you with a view of the activity on several servers
- If you do have the JDK, you can use the applet viewer to display
stats on one or more servers without the overhead of running a
full-blown browser. The applet viewer is quite lightweight.
Use this applet as an opportunity
to learn Java and add the feature(s) yourself. The sources are included.