[ 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.
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.
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.
The graph is colour coded as follows
Green | OK |
---|---|
Orange | Host was reachable but monitor is not running |
Red | Host did not reply. Host and/or network is down. |
Grey | Result was not defined. |
The title will alternate between red and white to draw your attention to a tranisition from OK to Host/Network down.
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 number | OK |
---|---|
unknown | Host was reachable but monitor is not running |
unavail | Host did not reply. Host and/or network is down. |
undef | Result was not defined. |
Load 1m | Moving average of load. |
---|---|
Load 5m | Moving average of load. |
Load 15m | Moving average of load. |
Procs/50 | Number of processes (all states) / 50 |
Mem Free | Proportion of memory free. |
Swap Free | Proportion of swap free. |
RTT | Round trip time from client to server and back. |
Source: | xmonitor-1.3.tar.bz2 Browse sources |
---|---|
Binaries: | xmon-client xmon-tclient xmon-server |
Peter Benie <peterb+xmon@chiark.greenend.org.uk>
Linux