webps: An AJAX-Enabled, Browser-Based Front End to the Linux ps Command | WebReference

webps: An AJAX-Enabled, Browser-Based Front End to the Linux ps Command

webps

An AJAX-Enabled, Browser-Based Front End to Linux ps

By Dan Ragle

Current release: v.20
Release date: August 29, 2007
Download

On this page is a collection of information pertaining to WebRef's webps script, which provides a browser-based front end to the familiar ps utility in UNIX/Linux. Here you'll find the latest webps zipped distribution file, a link to the latest changelog (also included in the distribution), basic features and requirements of the system, links to the individual release notes, and whatever else I can think of. To get started with webps, I recommend that you read this page in its entirety. While not mandatory, the release notes for the versions may also provide some potentially helpful pieces of information--especially from a developer's perspective--and may be beneficial both from an implementation and an educational perspective. i.e., even if you're not interested in using the webps script, you might want to read about some of the issues I've encountered in the development process; points that are elaborated upon in the release notes.

Contents:

Features
Demo
Requirements
Downloads
Setup
Release Notes

Features

The key features and capabilities of the most recent version of webps include:

  • Template-based design: With one exception, you can craft the XML and HTML output by the script by adjusting template files separately from the Perl code.

  • Flat File Data Storage: A separate database application setup is unnecessary; user state and configuration data are maintained in text and XML files.

  • AJAX-enabled processing: Once authenticated, the user doesn't need to do anything--since the view screen is automatically updated in a top-like fashion (via an AJAX-based engine) at a system defined refresh interval (which is determined by the administrator at configuration time). 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.

  • Delta-based data transmission: With each refresh of the ps list in the user's browser, only the changed data (new processes, deleted processes, new fields, or changed field data) is sent to the browser; minimizing the amount of bandwidth needed to transmit the periodic updates.

  • Administrator control: 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.

  • Drag-n-drop controls: End users can reorder the fields displayed on their screens via drag-n-drop controls.

Demo

Have a look at our Demo page to interact with an actual, working (though limited) version of the webps script, which is pointed at my testing/development server.

Requirements

To set up and use this system, you'll need a compatible version of ps running on your Linux/UNIX server, Perl 5.6 or later installed on your server, the Apache Web Server, access rights to create a directory outside the Web server's document root on your server and access to place scripts into your cgi-bin. Further, the Web user must have access to execute ps (it probably does, but I'm mentioning it just in case...).

An SSL server for delivery of the script is strongly recommended; otherwise, all the data that is transferred from the script to the browser will be delivered "in the clear," and potentially open to packet sniffers between you and your server. Since ps data can be somewhat sensitive in nature and may reveal important information about how your system works, it's strongly recommended that you protect that data stream as much as possible.

We define a "compatible version of ps" as one that allows you to list processes using your own user-defined format, using standard format specifiers. An easy way to verify this is to get to a console prompt on your server and type:

ps -eo pid

If you see a listing of pid numbers, then you're running a compatible version of ps.

On the client side, webps initially supports later versions of Firefox (2), Internet Explorer (7), Opera (9), and Safari (3). We'll expand that support for more browsers--as possible--if there's a need for it (or, you're welcome to tweak the HTML template pages to support additional browsers on your own).

You'll also need the following Perl modules installed on your system:

  • CGI
  • XML::Simple (and XML::Parser)
  • HTML::Entities
  • HTML::Template
  • Fcntl
  • Digest::MD5

All but the HTML::Template module are typically installed with your Perl distribution; HTML::Template (and any others that may be missing) you can pick up from CPAN. Some systems may also be missing XML::Simple and its required XML::Parser; again, hit CPAN or your system-specific package manager to get these.

webps will work on a mod_perl server; though it has not yet been optimized for this environment.

Downloads

You can download the latest version of webps by clicking this link: webps.zip. The download is provided as a zipped file; use your favorite extractor to unzip it.

To view a list of changes from version to version, read the CHANGES.TXT file.

Setting Up webps

Refer to the README.TXT, included in the Zip distribution, for setup instructions.

Release Notes

These articles contain notes pertaining to each individual release of webps. Developers who are learning Perl and/or AJAX may find these release notes of interest. The first release article (v.10) includes a basic how-to section as well as a description of the basic architecture of the script.


Created: July 2, 2007
Revised: August 29, 2007

URL: https://webreference.com/programming/perl/webps/index.html