[Xymon] FILES in analysis.cfg

Roland Soderstrom Rolands at logicaltech.com.au
Tue Feb 18 00:16:03 CET 2014


Hi,

This is actually not a cluster it is just a homebrew perl app that sort of looses it sometimes.
We use a function that creates this heartbeat file within the perl code so we know it's not hung.

It is on all our hosts so I wanted to use the native FILE function.


-      Roland


From: Phil Crooker [mailto:Phil.Crooker at orix.com.au]
Sent: Tuesday, 18 February 2014 9:38 AM
To: Roland Soderstrom; xymon at xymon.com
Subject: RE: FILES in analysis.cfg

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<mailto: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
--
Please consider the environment before printing this e-mail

This message from ORIX Australia may contain confidential and/or privileged information. If you are not the intended recipient, any use, disclosure or copying of this message (or of any attachments to it) is not authorised. If you have received this message in error, please notify the sender immediately and delete the message and any attachments from your system. Please inform the sender if you do not wish to receive further communications by email. ORIX handles personal information according to a Privacy Policy that is consistent with the National Privacy Principles. Please let us know if you would like a copy.
It is also available at http://www.orix.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140217/c13c20b9/attachment.html>


More information about the Xymon mailing list