1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
Loadmeter
=========
This is a useful little system monitoring utility I've hacked up to keep
track of various system stats. It monitors:
- Load average
- Uptime
- Disk usage
- Memory usage
In its normal state it displays a window with a coloured bar graph
showing the load average for the past minute. This is also shown
in digits at the top of the window. Both are updated every second. A red
'notch' marks the maximum load since it was started, and can be reset
by pressing button2 or hidden with button3. The blue notch shows the
5 minute load average.
By clicking with button1, a pop-up window appears showing the uptime,
the capacity of each filesystem, and memory/swap usage. More detailed
info on each filesystem is available by highlighting the corresponding
one. The way this window pops down is intentional, just to make it
interesting. :)
Any filesystems with higher usage than specified by the -warn option
(default 90%) are shown with a (default) green background. The '-disk' option
can also be used as an 'instant warn' feature.
Press Escape in the top level window to exit.
Loadmeter also has the ability to override window managers. Giving the
option '-override' causes the top-level window to have the
override_redirect bit set. This is useful for window managers that
insist upon decorating standard clients (e.g. Enlightenment, at
least up to DR0.9). If you've given this option, then you can
still resize and move the window. During moving and resizing, the
cursor displays the geometry.
Ctrl-button1 lowers the window.
Ctrl-button2 raises and moves the window.
Ctrl-button3 raises and resizes the window.
A SIGUSR1 sent to the process will also raise the top level window.
There is also a '-parent' switch, which can be used to specify another
window (in decimal or hex form) to use as the parent for the toplevel
one (default is the root). This is useful for banking several together
inside another window for easy positioning, etc. The 'lower' function
doesnt work if -parent is specified. Also note that you can't use
both -override and -parent at the same time.
Command-line options:
-disp <display> Specify which X server to connect to
-geom <+x+y> Specify position on the screen
-sync Call sync() when checking disk usage
-numfont <font> Use <font> for the load digits
-labelfont <font> Use <font> for the hostname label
-popupfont <font> Use <font> for the cursor and popup window
-popupbg <colour> Use <colour> for the popup background
-popupfg <colour> Use <colour> for the foreground of the popup
-warnbg <colour> Use <colour> for the high disk usage warning colour
-meter <colour> Use <colour> for the disk usage meter bar
-warn <pct> Min percent capacity reqd to highlight a filesystem
-label <label> Bari graph label to use instead of the hostname
-name <name> Name of the app to present to the WM
-bh <blockheight> Height of individual bar graph blocks (in pixels)
-override Always override window manager
-parent <window> Use <window> as the parent for the toplevel window
-noshrink Don't do fancy popup window shrinking
-disk Show a warning when disk usage exceeds '-warn' value
-nogeom Disables displaying the window geometry in the cursor
whilst moving/resizing the main window
These features are also available using Xresources. E.g. you can have:
loadmeter*sync: True
loadmeter*label: load
loaded into the server database.
Features:
- Easy to read coloured bar graph display.
- Hostname displayed.
- Maximum load indicator.
- Uptime, memory and filesystem usage stats.
- Low memory usage (around half that of xload) as it uses raw Xlib.
- Forks no child processes, but gathers stats directly from the system.
- Efficient, both X11 network-wise (except stats pop-down :) and memory wise.
- Built-in resize and move functions.
- Can display itself within another window.
- Takes advantage of the X resource database.
- Can be ported to other Unices fairly easily. Look at getinfo.tmpl for
what's needed.
Bugs:
- If colours don't get allocated or files can't be opened, it'll probably
crash. The reason for this is lack of checking, but this saves memory
and should succeed almost always anyway (unless /proc isn't mounted :).
- Memory info in Solaris isn't particularly correct. Patches for this
would be appreciated... unfortunately I haven't found much documentation
on getting good memory stats yet...
Changes since version 1.17
- I've ported to Solaris! Almost all differences are in getinfo.c
so porting doesn't require major changes. Note that loadmeter must
be run with root privileges under Solaris in order to read the
kernel symbols to get info. So far only GCC has been tested - it
might not work with other compilers.
- Added 'getinfo.tmpl', a template for porting to other Unices. Just
fill the functions with code to grab the right values from the
system and that should be it.
- Added '-nogeom' option.
- Formats large numbers with commas to improve readability.
Changes since version 1.15
- Install target added to Makefile.
- NFS usages bug fixed.
Changes since version 1.1
- Memory leaks fixed.
- Problem where some filesystem don't show up is fixed.
- Displays used disk space.
Changes since version 1.0
- No longer crashes when too many filesystems are mounted.
- -disk, -parent, -noshrink options.
- Manpage.
Having it display values from a pipe is something I hope to have in
a later version, plus the ability to have the orientation either
vertical or horizontal. Patches please!
Patches/contributions included so far from:
Patrik.Flykt@iki.fi
bob@acm.org
salnick@salnick.cac.washington.edu
dcrowley@san.rr.com
Check http://www.zip.com.au/~bb/linux/ for updates.
Hack by Ben Buxton (bb@zip.com.au)
17 Sept 98.
|