xymon-procmem is an extension for Xymon
that reports on memory usage for one or more configured processes. It runs on
the Xymon server, but requires the xymon client to be running on the remote and
reporting the process list (in the [ps] section of the client data, of [cpu] for bbwin).
If the default test name if "procs" is preserved,
the existing procs status is modified to:
This script uses Xymon's modify mechanism to adjust an existing status.
- take on the colour of the memory test, if worse
- include a message to indicate the reason for the status
If the test name is modified (in the PROCMEM: tags in hosts.cfg), then
the updates will be sent to a new test with that name, and graphs
will be created.
xymon-procmem is hererby released into the public domain. Use it however you
need. It'd be nice if you let me know how well it works for you.
Disclaimer: xymon-procmem comes with no warranty. You use this software
at your own risk. The software might not work as expected, or at all, and that
would be your problem. The software might cause other things to break. If you
decide to use it, then you are entirely responsible for anything that happens as
Download/view v0.4 or 0.3 or 0.2 or v0.1, or the changelog.
To install and use, follow the instructions in the comments at the
start of the script. In brief:
- copy the script somewhere on your xymon server
- create a file in tasks.d/ to launch, or add a section to tasks.cfg
- add PROCMEM definitions to hosts.cfg
- optionally change the test name (eg to procmem)
- create a graph.d/graph-procmem.cfg
- add TRENDS overrides to hosts.cfg (eg to the default entry)
Example hosts.cfg entries are shown here:
10.1.1.1 linux1.example.com # testip ssh PROCMEM::rule[proc(named=/usr/sbin/named);yellow(VSZ>10000000,MEMPC>80);red(VSZ>20000000,MEMPC>95)]
10.1.1.2 bbwin2.example.com # testip ssh PROCMEM:os=bbwin,testname=procmem:rule[proc(svchost.exe);yellow(RSZ>1);red(RSZ>2000)
The format of the PROCMEM specification in hosts.cfg is something like this:
Options for PROCMEM:
Comparisons are of the form VAR>VAL or VAR
VAL can be one of:
- first field is the testname (defaults to procs)
if "procs", modifies existing procs; otherwise
makes a new test page and also creates RRD files
- second field contains semicolon-separated list of rules, each in square brackets
- process name (regex) specifying a regular expression for egrep
and optionally prefixed with "othername=" to set the RRD filename
- yellow(), red() specifies comparisons to alert on
RSZ is "resident set" for bbwin OS (Windows running BBWin or compatible)
VSZ doesn't apply to bbwin OS
If the specified process doesn't exist, the host is skipped.
If the host has no "procs" status, the host is skipped.
- MEMPC = memory percentage;
eg yellow(MEMPC>80) sets CPU to yellow when memory percentage exceeds 80%
- VSZ = virtual memory size (kB);
eg red(VSZ>1000) sets CPU to red when VM usage exceeds 1000kB (1MB)
- RSZ = resident set size, or working set for bbwin (kB);
eg yel(RSZ<2000) sets CPU to yellow when resident set size falls below 2000kB (2MB)