Table of Contents

Name

xperfmon++ - X Window System-based performance monitor

Synopsis

xperfmon++ [-toolkitoption ...] [-additionaloption ...]

Description

xperfmon++ continuously displays multiple system statistics as a set of parallel line graphs. The name of the host is displayed in the upper left hand corner. Immediately under the hostname, the update interval is displayed. The information is scaled so that it always fills the window regardless of geometry changes.

The xperfmon++ application is based on highly modified Athena StripChart Widgets. (The original xerfmon used a custom private Widget.) All scrolling action is smooth, i.e., one pixel at a time, and the scale labels are updated immediately on plotting a new point outside a previous scale range. The program can produce a filled graph or a line graph and the update interval can be set in seconds or 100-millisecond intervals.

While xperfmon++ is running, it is possible to perform certain tasks by pressing keys over the window:


Q/q: Quit... Exit gracefully
l | L: Print out a chart of all current limit settings. This chart will appear in the window from which xperfmon++ was invoked.
s: Decrease update interval (slower) by a small amount
S: Decrease update interval (slower) by a large amount
f: Increase update interval (faster) by a small amount
F: Increase update interval (faster) by a large amount
?: Help

Options

xperfmon++ accepts all of the standard X Toolkit command line options along with the following additional options:

-interval seconds
This options specifies the update interval for the graph. The default is 1. The interpretation of this option is modified by the fast option.

-fast
This option modifies the meaning of the update option. When -fast is specified, the update interval is modified to specify milliseconds. Otherwise, the update interval specifies seconds. When running in fast mode, the minimum update interval is 100 milliseconds.

-fill
This option controls the type of graph produced. When -fill is specified the program produces a filled graph, otherwise a line graph is generated.

-immediate
This option controls what the {high|low} limit {alarms|warnings} are based on. When set, the limit {alarms|warnings} are based on the current data sample only. When not set, (the default) the limits are based on the {min|max} value present in the viewable graph.

Graphing Options

The following options specify the list of statistics to be displayed. If none are present on the command line, then all statistics are displayed. If any "+" options are listed the default list is cleared and only those listed as "+" options are displayed. If any "-" options are listed, then they are taken away from the default list. Specifying both "-" and "+" options will produce unpredictable results.

-sysload | +sysload
Graph percentage of System Load (avaraged over 1 minute).
-usercpu | +usercpu
Graph percentage of User CPU Time.
-nicecpu | +nicecpu
Graph percentage of Nice CPU Time.
-systemcpu | +systemcpu
Graph percentage of System CPU Time.
-intercpu | +intercpu
Graph percentage of Interrupt CPU Time.
-idlecpu | +idlecpu
Graph percentage of Idle CPU Time.
-ttyin | +ttyin
Graph tty input characters per second of.
-ttyout | +ttyout
Graph tty output characters per second of.
-interrputs | +interrupts
Graph System Interrupts.
-freeswap | +freeswap
Graph Free Swap in %. Calculation is done only every 10 intervals.
-diskxfr | +diskxfr
Graph Disk Transfers per second.
-diskmb | +diskmb
Graph amount of Data tranfered from/to Disk in MByte per second.
-tapexfr | +tapexfr
Graph Tape Transfers per second.
-tapemb | +tapemb
Graph amount of Data tranfered from/to Tape in MByte per second.
-cdromxfr | +cdromxfr
Graph CDRom Transfers per second.
-cdrommb | +cdrommb
Graph amount of Data tranfered from CDRom in MByte per second.
-inputpkts | +inputpkts
Graph number of network Input Packets.
-outputpkts | +outputpkts
Graph number of network Output packets.
-collpkts | +collpkts
Graph number of network Collision Packets.
-nfsservercalls | +nfsservercalls
Graph Number of NFS Server transactions.
-nfsserverhits | +nfsserverhits
Graph Number of NFS Server Cache Hits.
-nfsservermisses | +nfsservermisses
Graph Number of NFS Server Cache Misses.
-nfsclientcalls | +nfsclientcalls
Graph Number of NFS Client transactions.
-nfsclienthits | +nfsclienthits
Graph Number of NFS Client Cache Hits.
-nfsclientmisses | +nfsclientmisses
Graph Number of NFS Client Cache Misses.

Limit Options

xperfmon++ will accept a number of limit options. When a data point exceeds a high or low limit the background of that graph changes color to visually reflect the condition. The background color is an indication of the min (low limit) or max (high limit) value currently contained in the graph. When no limit has been exceeded the background color is set to green. If no limits have been set for that graph its background color remains the same as the applications default color, which is usually white.

WARNING: High and Low limits are mutually exclusive, i.e., you can set high limits or low limits, but not both. If both are inadvertently set, the high limits are checked first, and the low limit will be ignored.

There are four possible limit conditions:

High Warning
When any value in the current graph exceeds the high warning limit the background color of that graph is changed to yellow.
Low Warning
When any value in the current graph is less than the low warning limit the background color of that graph is changed to yellow.
High Alarm
When any value in the current graph exceeds the high alarm limit the background color of that graph is changed to red.
Low Alarm
When any value in the current graph is less that the low alarm limit the background color of that graph is changed to red.

Limits can be set with command line options or with application resources. The syntax of setting a limit option from the command line is (Note: Case IS sensitive):

-low*Alarm value
Set low Alarm value for *.
-low*Warn value
Set low Warning value for *.
-high*Alarm value
Set high Alarm value for *.
-high*Warn value
Set high Warning value for *.

Where "*" is one of the following:

load
Set limit value for Load Average.
user
Set limit value for User CPU Percentage.
nice
Set limit value for Nice CPU Percentage.
sys
Set limit value for System CPU Percentage.
inter
Set limit value for Interrupt CPU Percentage.
idle
Set limit value for Idle CPU Percentage.
ttyin
Set limit value for TTY input characters per second.
ttyout
Set limit value for TTY output characters per second.
intrpts
Set limit value for System Interrupts.
swap
Set limit value for Free Swap.
diskxfr
Set limit value for Disk Transfers.
diskmb
Set limit value for Disk Transfers.
tapexfr
Set limit value for Tape Transfers.
tapemb
Set limit value for Tape Transfers.
cdromxfr
Set limit value for CDRom Transfers.
cdrommb
Set limit value for CDRom Transfers.
input
Set limit value for network Input Packets.
output
Set limit value for network Output Packets.
collision
Set limit value for network Collision Packets.
nfsservercalls
Set limit value for NFS Server Transactions.
nfssserverhits
Set limit value for NFS Server Cache Hits.
nfsservermisses
Set limit value for NFS Server Cache Misses.
nfsclientcalls
Set limit value for NFS Client Transactions.
nfsclienthits
Set limit value for NFS Client Cache Hits.
nfsclientmisses
Set limit value for NFS Client Cache Misses.

For example:

-lowuserA 25
Set low user Alarm value to 25.

As with any X-based command line specification you only need specify the minimum number of characters required to make the string unique. See below for a description of setting limit values using application resource specifications.

Toolkit Options

The following standard X Toolkit arguments are commonly used with xperfmon++:

-d | -display display
This option specifies the X server to contact.

-g | -geometry geometry
The xperfmon++ window is created with the specified size and location determined by the supplied geometry specification. See X(1) for a full explanation.

-bd | -bordercolor color
This option specifies the border color. The default is black.

-bg | -background color
This option specifies the background color. The default is white.

-bw | -borderwidth pixels
This option specifies the width in pixels of the border around the window. The default value is 2.

-fg | -foreground color
This option specifies the foreground color. The default color is black.

-fn | -font fontname
This options specifies the font to be used in displaying the hostname and labels. The default is 6X10.

-xrm resourcestring
This option specifies a resource string to be used. This is especially useful for setting resources that do not have separate command line options.

X Defaults

xperfmon++ understands all of the core resource names and classes as well as:

width (class Width)
Specifies the width of the load average graph.
height (class Height)
Specifies the height of the load average graph.
update (class Interval)
Specifies the frequency in seconds at which the performance statistics should be redisplayed.
foreground (class Foreground)
Specifies the color for the foreground. The default is black since the core default for background is white.
font (class Font)
Specifies the font to be used for the label. The default is fixed.
reverseVideo (class ReverseVideo)
Specifies that the foreground and background should be reversed.

Limit Resources

To set a limit that applies to all active graphs use the class name as in the following syntax:
*PerfChart.{lowAlarm|lowWarn|highAlarm|highWarn}
Individual graph limit alarm and warning values can be set with resource specifications.

To set a limit that applies to any individual graph use the following syntax:

*perfChart&.lowAlarm:
value
*perfChart&.lowWarn:
value
*perfChart&.highAlarm:
value
*perfChart&.highWarn:
value

Where "&" is one of the following (Note: Case IS important):

Load
Set System Load resource.
User
Set User CPU Percentage resource.
Nice
Set Nice CPU Percentage resource.
System
Set System CPU Percentage resource.
Inter
Set Interrupt CPU Percentage resource.
Idle
Set Idle CPU Percentage resource.
Ttyin
Set TTY characters input resource.
Ttyout
Set TTY output characters resource.
Intrpts
Set System Interrupts resource.
Swap
Set Free Swap resource.
DiskXfr
Set Disk Transfer count resource.
DiskMB
Set Disk Transfer MByte/s resource.
TapeXfr
Set Tape Transfer count resource.
TapeMB
Set Tape Transfer MByte/s resource.
CDRomXfr
Set CDRom Transfer count resource.
CDRomMB
Set CDRom Transfer MByte/s resource.
Input
Set network Input Packets resource.
Output
Set network Output Packets resource.
Collision
Set network Collision Packets resource.
NFSServerCalls
Set NFS Server Transactions resource.
NFSServerHits
Set NFS Server Cache Hits resource.
NFSServerMisses
Set NFS Server Cache Misses resource.
NFSClientCalls
Set NFS Client Transactions resource.
NFSClientHits
Set NFS Client Cache Hits resource.
NFSClientMisses
Set NFS Client Cache Misses resource.

For example:

*perfChartIdle.lowAlarm: 25
Set low Idle Alarm (Idle CPU Percentage) value to 25.

There is a sample Application Defaults file included in the distribution called XPerfmon++.ad. Copy this file to your private directory and edit it to your hearts content. Then load it into xrbd with a command like:

xrdb -m XPerfmon++.ad

Environment Variables

DISPLAY - specifies the default host and display number.

See Also

X(1) , uwm(1) , xload(1) , mem(4)

Bugs

xperfmon++ requires the ability to open and read the special system file /dev/kmem. On most systems, this requires the suid (set user id) bit to be set with root ownership, or the sgid (set group id) bit to be set and membership in the same group as /dev/kmem.

Reading /dev/kmem is inherently non-portable. Therefore, the widget upon which this application is based must be ported to each new operating system.

There is a known bug in the refresh logic that occassionally occurs when a partially occluded xperfmon++ window is partially or fully exposed. This is manifested in the redraw logic overwriting some or all of one or more graphs, and/or the timestamps. It can be corrected by fully covering the xperfmon++ window and then exposing it, or by iconifying the xperfmon++ window and then de-iconifying it.

Authors

The X11 version of xperfmon was written by Emanuel Jay Berkenbilt, Project Athena on 1/21/1988. There is no record of previous authors.

xperfmon was modified by Thomas Bagli, PCS Computer Systeme GmbH, West Germany, to be a toolkit-based client.

xperfmon++ was created from xperfmon, and the Athena StripChart Widget, by Roger Smith, Sterling Software @ NASA-Ames Research Center, Moffett Field, California. Version 1.0 was released in January, 1994.

If you like this program, or if you have difficulties, I would like to hear your comments. E-Mail me at rsmith@proteus.arc.nasa.gov.

xperfmon++ was written for Suns running SunOs and X11R5 Windows software. If some energetic soul out there would like to port this program to any other operating system or architecture I would be glad to incorporate the modifications into this master copy. Send me your changes via E-Mail at the above address.

xperfmon++ V1.2 for FreeBSD was written by Lars Köller with a lot of helpful notes by Jörg Wunsch.

xperfmon++ V1.31 for FreeBSD closes some memory leaks, fix geometry (resize) bug, display free swap in percent and avoids resizing of the graph.

xperfmon++ V1.33 for FreeBSD contains some fixes due to event problems and compiles fine under FreeBSD 2.2 (changes in get_swapspace). Now the -geometry switch works well!

xperfmon++ V1.40 for FreeBSD contains some fixes due to changes in the networking structs and cleans up the FreeBSD version number #if's. Now it should compile fine from FreeBSD 2.0 up to FreeBSD-3.0-current.

xperfmon++ V2.0 for FreeBSD 2.2.X and 3.X added System Load, Nice and Interrupt CPU graphs. Should compile fine from FreeBSD 2.2 up to FreeBSD-3.X with CAM and devstat library (Many thanks to Gary Jennejohn <garyj@muc.de> and Simon Shapiro <shimon@simon-shapiro.org> for integrating the devstat changes into xperfmon++.

xperfmon++ V3.0 for FreeBSD 3.X added graphs for terminal IO, disk/tape/cdrom transfers and IO in MByte/s. Further NFS server/client cache hits and misses. Rewriting of freebsd_system.c and migration to the devstat library (Many thanks to Kenneth D. Merry <ken@plutotech.com>). Scaling of the graphs changed from integer to floating point values (-> system load is now displayed as is, and not mutliplied with 100!, this improvement was also necessary to display useful tranfer rates in MBytes/s). Further bugs in autocalculating the window size dependent on the number of graphs and rescaling the window fixed (hope this was the last time). Output of Warn/Alarm values (press L|l in xperfmon++ window) corrected.

xperfmon++ V3.1 for FreeBSD 3.X/4.X (several bugfixes) Calc etime correct for multi CPU machines, show disk stats for new "ad" disk devices, count number of network in/out packets correctly, get free swapspace only every 10 intervals to limit CPU usage.

Please E-Mail any bugs or comments with the subject "xperfmon++ V3: ..." to Lars.Koeller@Uni-Bielefeld.DE or lkoeller@cc.FH-Lippe.DE.

Enjoy!


Table of Contents