[Xymon] FILES in analysis.cfg
Phil Crooker
Phil.Crooker at orix.com.au
Mon Feb 17 23:38:25 CET 2014
Coming out of left field - when we were using heartbeat (just a simple pair) I set up a client script on each box that ran cl_status:
HOST=`uname -n`
RESULT=`/usr/bin/cl_status nodestatus $HOST`
if test -n "$RESULT" # IF WE HAVE OUTPUT...
then
if echo "$RESULT" | egrep -qi "error|cannot"
then
COLOR="red"
elif echo "$RESULT" | egrep -qi "active"
then
COLOR="green"
else
COLOR="yellow"
fi
else
RESULT="No result for cl_status, please check."
COLOR="yellow"
fi
You'd probably want to tweak it but this worked pretty well. You can also just run cl_status from one host to test both but sometimes cl_status hangs when heartbeat doesn't respond, so two hosts are a bit more reliable. You can also better parse the cl_status response for when the normal slave becomes master....
cheers, Phil
________________________________
From: Xymon on behalf of Roland Soderstrom
Sent: Tuesday, 18 February 2014 8:18 AM
To: xymon at xymon.com
Subject: [Xymon] FILES in analysis.cfg
Hi,
I started monitoring some files.
I can't really understand how this works.
Xymon 4.3.10 on Solaris 10
client-local.cfg:
[sunos]
file:`ls -1 /var/tmp/sys-heartbeat-*`
analysis.cfg:
HOST=myhost
FILE /var/tmp/sys-heartbeat-myhost red MTIME<3700
FILE /var/tmp/sys-heartbeat-testing red MTIME<3700
On myhost I got a file /var/tmp/sys-heartbeat-myhost but /var/tmp/sys-heartbeat-testing is missing (for testing)
If sys-heartbeat-myhost is older than 3700 second the files test goes red.
If sys-heartbeat-testing doesn't exist nothing happens at all.
The sys-heartbeat-testing line does not show up on the test but sys-heartbeat-myhost does.
Clicking on the sys-heartbeat-myhost shows me all the file data.
The syntax in the manual states.
FILE filename [color] [things to check] [TRACK]
noexist
triggers a warning if the file exists. By default, a warning is triggered for files that have a FILE entry, but which do not exist.
That should mean that if the file doesn't exist it should go red.
In the examples in analysis.cfg the color is in another spot.
# Example: Check that the /var/log/messages file is not empty and was updated
# within the past 10 minutes, and go yellow if either fails:
# FILE /var/log/messages SIZE>0 MTIME<600 yellow
I guess that is just a typo.
I have tried both and it seems it doesn't matter.
What am I doing wrong?
- Roland Soderstrrom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140217/dbe7afea/attachment.html>
More information about the Xymon
mailing list