xymon-procmem

Introduction

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:

  1. take on the colour of the memory test, if worse
  2. include a message to indicate the reason for the status
This script uses Xymon's modify mechanism to adjust an existing 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.

Licence

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 a result.

Installation

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:

  1. copy the script somewhere on your xymon server
  2. create a file in tasks.d/ to launch, or add a section to tasks.cfg
  3. add PROCMEM definitions to hosts.cfg
  4. optionally change the test name (eg to procmem)
  5. create a graph.d/graph-procmem.cfg
  6. 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: 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.

Other