xmon

[ Server | X11 client | Text client | Statistics | Download ]

Remote load monitoring for Linux systems.

The software splits into two. The client runs on the machine that wishes to display the statistics. The server runs on the machine that is to be monitored. The client polls the server every 30 seconds. The motivation for this is that if the server crashes or if the network fails, the client can take action.

Server

The monitoring program runs as a network daemon which listens for incoming queries and replies with the results from sysinfo(2). The code is designed to be very lightweight so as not to influence the measurements.

What makes this program special is that it does not pull in complicated libraries such as libc. Instead, it calls kernel syscalls directly. This is mainly for the hack value. Under no circumstances should anyone take this as an example of how one should write code; it is most certainly not portable.

The server is started from inetd, so the code doesn't incorportate the code for options parsing and setting up a listener, code which is useless once the main loop has started.

To protection against rogue clients, the main loop incorporates a small delay to prevent the server consuming all the CPU.

X11 client

The X11 client uses a strip chart in the same style as xload, however, it is only linked against X11, not Xt, Xaw, Xau etc. This makes it much simpler, but slightly larger than xload since it has to do more housekeeping itself.

Clicking on the top section (on the hostname or statistic name) cycles through the available statistics. Right-click will cycle in the opposite direction.

Example graph

The graph is colour coded as follows

GreenOK
OrangeHost was reachable but monitor is not running
RedHost did not reply. Host and/or network is down.
GreyResult was not defined.

The title will alternate between red and white to draw your attention to a tranisition from OK to Host/Network down.

Text client

This client uses most of the same sources as the X11 client, save for the display handling and options parsing. All the statistics are printed, one record per line.

Each entry in a record can be:

A numberOK
unknownHost was reachable but monitor is not running
unavailHost did not reply. Host and/or network is down.
undefResult was not defined.

Statistics

Load 1mMoving average of load.
Load 5mMoving average of load.
Load 15mMoving average of load.
Procs/50Number of processes (all states) / 50
Mem FreeProportion of memory free.
Swap FreeProportion of swap free.
RTTRound trip time from client to server and back.

Download

Source: xmonitor-1.3.tar.bz2
Browse sources
Binaries: xmon-client
xmon-tclient
xmon-server

Valid HTML 4.01! Valid CSS!

Peter Benie <peterb+xmon@chiark.greenend.org.uk>
Linux