On the server, you can get the total amount of RAM from the "top" client data like so:
xymon localhost 'clientlog name.of.server section=top' | sed -n '/^Mem:/{s/ total.*$//;s/^.* //;p}'
A client-side script like this should check that the memory is as it should be:
#!/bin/sh
TEST=ram-check
xymongrep "$TEST:*" | while read LINE; do
set - ""$LINE; HN="$2"
[ "$HN" ] || continue
RAMREQUIRED=`echo "$LINE" | sed "s/^.*${TEST}://;s/ .*$//;s/k$//" HNCOMMAS=echo "$HN" | sed 's/\./,/g' RAMFOUND=xymon $XYMSRV "clientlog $HN section=top" | sed -n '/^Mem:/{s/
total.*$//;s/^.* //;s/k$//p}' if [ "$RAMFOUND" -lt "$RAMREQUIRED" ]; then COL=red MSG="RAM count ${RAMFOUND}kB is less than ${RAMREQUIRED}kB" else COL=green MSG="RAM count ${RAMFOUND}kB is at least ${RAMREQUIRED}kB" fi echo $XYMON $XYMSRV "status $HNCOMMAS.$TEST $COLdate` $MSG"
done
This script checks any server tagged with "ram-check:NNN" where NNN is a number of kB" and creates a "ram-check" status page with the result.
J
On Mon, Jun 18, 2012 at 5:25 PM, Mark Wagner <mark+xymon at carnildo.com>wrote:
One of my servers has a quirk where it will occasionally fail to detect two-thirds of its RAM on startup. Is it possible to set things up to send an alert if *total* RAM is below a certain amount?
-- Mark Wagner
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon