webps - v .10 Release Notes
[next] |
webps Release Notes: v.10
[This is a release bulletin for webps. For general information about the script, including the latest release download, system requirements, etc., visit the webps main page.]
Welcome to the initial public release of webps! webps is a Web-based
front-end to the familiar Linux/UNIX ps
utility. With webps, administrators can pull up ps
lists using only a Web browser from any Internet connected location.
About ps
If you're already familiar with ps
, you
might want to skip this section. But if you're among those who only know
ps
as a concluding comment that appears after
the signature line on your E-mail, read on...
The ps
command is typically executed from a
Linux/UNIX command prompt, and provides (for the user) a listing of the current
processes executing on the server at any given time. ps
is most helpful to system administrators or their colleagues, because it helps
them to diagnose existing or potential problems on
their servers. For example, if your server suddenly comes to a complete
standstill, ps
(or the closely related
top
, see below for more) can potentially
show the admin which process is hogging all the CPU juice.
By default, ps
lists only the processes that
you actually launched; but with a little prodding (and the right command line
options, of course), ps
can be coaxed into
revealing a full list of all current processes on the machine. Furthermore,
additional parameters have been added to the ps
utility over time enabling the user to specify the exact information that they
would like to see for each process listed, as well as filter out the listed
processes by user or process id, among other options.
As an example, consider this ps
list from
my development server:
A simple (and partial) ps listing
In this listing, I've chosen to display the process ID of each process,
the parent process ID, the user ID number, the percentage of CPU time
and memory utilized by this process, and the cumulative CPU time used
by this process. Multiple options exist--depending on which version of
ps
you're running and on which operating
system--enabling you to specify other fields and/or their format widths
and column headers.
Closely related to ps
is the top
command, another console-based utility that provides much of the same
information that ps
provides, but in an
automatically refreshing table. Top also (typically) provides
a current snapshot of total CPU and memory usage.
About webps
webps is a Web-based front-end to the ps
command line utility. It enables administrators to open a Web browser from
anywhere they have an online connection, and retrieve a ps
listing in their browser of the current processes executing on their Web
server. Further, webps borrows an idea from the top
utility as well, as webps includes an AJAX-based engine that enables it
to automatically refresh the ps
listing
periodically in the user's browser without them having to refresh the entire
browser display. Administrators retain full control over who can see what
fields in webps; they can specify not only what users can access webps
but also which fields each user is able to view in their browser
(available fields can also be specified globally for all webps users).
If you'd like to see webps in action, have a look at our demo page, which allows you to login as a demo user and see a small subset of the available fields and processes on my development server. Once in the main screen, you can sort a particular column by clicking on its header at the top of the main display table. For example, in the following partial webps screen shot, we're sorting on the %MEM field:
This webps listing is sorted in descending order
on the %mem field.
Clicking on the header repeatedly changes the sort on that field from ascending to descending, or vice versa.
You may also select which fields you want to include in the listing by selecting from the "Fields Available" table, which appears on the right side of the webps display:
Users select from the list
of available fields.
The currently selected fields are highlighted in bold. When you click on a field, you either remove it from the list or add it, depending on its current state. The fields appears in the main table immediately; the actual data for the fields will be filled in with the next data refresh from the server.
Many of the key features in webps are borrowed (either literally or algorithmically) from earlier Perl efforts that appear on other pages of this site. Some of webps' primary features include:
- Template-based design: As I've done often in the
past, webps utilizes the
HTML::Template
module, enabling the script's output to be controlled almost entirely via separate template files. In this way, the output of the script can be controlled separately from the Perl code itself. In the case of webps, this is necessary; since the code that executes in the browser is all JavaScript based. To include this code literally in the Perl code would mean that we'd have to change the actual webps script every time we wanted to make the slightest adjustment to the actual browser display--even so slight a change as adjusting the colors! WithHTML::Template
, only one template need be altered to make such a change, and the script itself needn't be touched.One exception to this rule are errors that are generated by the script in relation to the templates themselves. For example, if the script cannot actually read the templates for some reason, it will generate a hard-coded error message to the user.
- AJAX-enabled processing: Once authenticated, the user needn't
do anything: The main view screen is automatically updated via an AJAX-based
engine at a system defined refresh interval. Basic point-and-click
interactivity support allows the user to select which fields to include
in the display, and how to sort the resulting display.
In support of this AJAX engine, the Perl side of the script additionally supports delta-based data tranmissions; wherein the updated data sent to the browser with each refresh includes only that data that has changed since the last request, including any new processes, the removal of deleted processes, and changed fields in ongoing processes. Delta-based data processing helps to reduce the amount of bandwidth needed to deliver the update stream to the browser.
- Administrator controls: The system administrator can
control--via entries in a single configuration file--which users have
access to the script, as well as which
ps
fields are available for viewing to all or selected users. Such entries are defined via simple definitions in the webps XML file, such as this one:
which defines the demo1 user. Fields within the <user>...</user> tags specify the user's encoded password (the above password is bogus, by the way), the default fields that are displayed when this user accesses the system, and the allowed fields that can be displayed to this user. While users are free to request the display of any field, webps will only actually report a field back to the user if their requested field is actually in their allowed fields definition.<user> <id>demo1</id> <password>abcdefghijklmnopqrstuvwxyz0123456789</password> <default_fields>pid,uid,ppid,time,%cpu,%mem</default_fields> <allowed_fields>pid,uid,ppid,time,%cpu,%mem</allowed_fields> </user>
That last point brings up an important consideration both for webps and for all AJAX-based applications; which we'll explore in greater depth on the next page.
[next] |
Created: July 2, 2007
Revised: July 2, 2007
URL: https://webreference.com/programming/perl/webps/v.10/index.html