SUT Home

ptdisp

SUT graphical display tool

Description

ptdisp is a graphical display tool that reads well formatted data from standard in or a pipe and displays a grid based on that data. It is well-suited to the display of status data from other SUT tools.

Command Line Arguments

ptdisp [-hHpPst]

-h
hide the hostnames in the grid.
-H
show the hostnames in the grid.
-p
make a pipe with name /tmp/ptdisp.<pid> (where <pid> is the process id of the ptdisp process) and read all input from that pipe. The pipe is deleted when the program exits normally.
-P <pipe>
read all input from the named pipe <pipe>.
-s <grid size>
set the initial size of the grid to <grid size>x<grid size>
-t <title>
Make <title> the window title

Input Format

ptdisp takes input in the form:

<hostname>: <command> [<arguments>]
<hostname> is the hostname of the machine to which the data given refers. There is also a special hostname, "$LEGEND$" that allows the user to specify a color coded legend for the display. See the section "Legend" below.

<command> is one of the following:

percentage <percentage> [<color1> <color2>]
this command specifies that the data for <hostname> is a percentage. When -H is given and when -h is not given, a percentage bar is shown in the grid for <hostname>. If <color1> and <color2> are given, they refer to the bar's foreground and background colors, respectively. If -h is given, a small button is shown in the grid for <hostname>. The color of this button is interpolated between <color1> and <color2>, where <color1> means 0% and <color2> means 100%.
color <foreground color> <background color>
this command specifies that the data for <hostname> should be reflected in a color scheme. A button is shown in the grid for <hostname> with the given colors.
text <text>
this command specifies that the data for <hostname> should be displayed as text. The given text is displayed in the grid for <hostname>.
<number>
when <number> is 0, this command is an alias for 'color black red'. When <number> is not 0, this command is an alias for 'color black green'.

In any of the above commands that accept color arguments, the color may be any that is accepted by XParseColor(3X11), i.e. valid X colors.

Legend

A legend can be specified in the input with a special hostname, "$LEGEND$", with the following syntax:

$LEGEND$: [<text1> <foreground1> <background1> [<text2>...]]
This input will cause a separate window to appear on the screen with a box for each text item given with the specified foreground and background colors. The legend is most useful in conjuction with the percentage and color commands.

Examples

To see which nodes have the file '/home/johndoe/myfile', one might use the following command:

ptpred -all '-f /home/johndoe/myfile' | ptdisp
This will display a grid of all the nodes in the current mpd ring, with those nodes where /home/johndoe/myfile exists shown as a green button with black text and those nodes where /home/johndoe/myfile does not exist shown as a red button with black text.

See Also

ptpred(1), XParseColor(3X11), SUT(1)







Contact Emil Ong about issues concerning this page.