[Xymon] FILES in analysis.cfg
Roland Soderstrom
Rolands at logicaltech.com.au
Fri Feb 21 03:49:13 CET 2014
This is really bugging me.
I had everything working fine for ONE host when I was testing.
Then I added all the other hosts and nothing worked anymore...
Ok,
I went back to first "working" config but that isn't working either.
Now I've been fiddling around so much I can hardly recall what I've tested and not.
Current config
client-local.cfg:
[myhost]
file:/var/tmp/ sys-heartbeat-myhost
file:/var/tmp/ sys-watchfor-myhost
analysis.cfg:
HOST=myhost
FILE %^/var/tmp/sys-watchfor-test4 red MTIME<3700
FILE /var/tmp/sys-watchfor-test5 MTIME<3700 RED
FILE %^/var/tmp/sys-watchfor-test6 MTIME<3700 red
FILE %^/var/tmp/sys-heartbeat-* red MTIME<3700
As before it shows the two files that actually are there on the files test page.
Clicking on those will show the actual data about the file..
/var/tmp/ sys-heartbeat-myhost
/var/tmp/ sys-watchfor-myhost
But nothing happens with my 3 "test" files.
I tried to debug this with
bin/xymond_client --debug --test
28605 2014-02-21 12:53:05 Transport setup is:
28605 2014-02-21 12:53:05 xymondportnumber = 1984
28605 2014-02-21 12:53:05 xymonproxyhost = NONE
28605 2014-02-21 12:53:05 xymonproxyport = 0
28605 2014-02-21 12:53:05 Recipient listed as '192.168.1.1
28605 2014-02-21 12:53:05 Standard protocol on port 1984
28605 2014-02-21 12:53:05 Will connect to address 192.168.1.1 port 1984
28605 2014-02-21 12:53:05 Connect status is 0
28605 2014-02-21 12:53:05 Sent 16 bytes
28605 2014-02-21 12:53:05 Read 3860 bytes
28605 2014-02-21 12:53:05 Closing connection
28605 2014-02-21 12:53:05 Opening file /usr/local/xymon/server/etc/analysis.cfg
<snip>
28605 2014-02-21 12:53:05 Compiling regex ^/var/tmp/swatch-sys-watchfor-test4
28605 2014-02-21 12:53:05 Compiling regex ^/var/tmp/swatch-sys-watchfor-test6
<snip>
So it actually do parse the FILE lines.
The actual test seems to not work with the FILE directive though....
Hostname (.=end, ?=dump, !=reload) []: myhost
Hosttype []:
Test (cpu, mem, disk, proc, log, port): files
Hostname (.=end, ?=dump, !=reload) [myhost]:
And I tried to add this to debug further in tasks,cfg
[clientdata]
ENVFILE /usr/local/xymon/server/etc/xymonserver.cfg
NEEDS xymond
CMD xymond_channel --debug --channel=client --log=$XYMONSERVERLOGS/clientdata.log xymond_client --debug
But can't see anything more in the logfile.
Any more ideas? I'm stuck.
- Roland
-----Original Message-----
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Henrik Størner
Sent: Wednesday, 19 February 2014 8:55 AM
To: xymon at xymon.com
Subject: Re: [Xymon] FILES in analysis.cfg
Den 18-02-2014 21:52, Roland Soderstrom skrev:
> Hi,
>
> That part work just fine.
> Anything the * expands to will be picked up by xymon.
>
> My question is the FILE directive in the analysis.cfg If I just set it
> to FILE /var/tmp/sys-heartbeat-myhost red MTIME<3700 Everything works
> just fine.
> But,
> If I change it to:
> FILE /var/tmp/sys-heartbeat-myhostttt red MTIME<3700 If I read the
> manual correctly it should go RED because there is no file called
> /var/tmp/sys-heartbeat-myhostttt If I touch the new myhostttt file it
> will show up on the test page That means the file:`ls -1
> /var/tmp/sys-heartbeat-*` Works just fine as it should.
>
> So how do I get the files test go RED on a missing file?
OK, I had to do some testing with this.
The problem is that when the file does not exist, then the `ls -1 ...` will not produce any output. Without any output, Xymon cannot tell that there is a file-check happening.
If you have an explicit filename in client-local.cfg, then the FILE check in analysis.cfg works as expected, because the xymon client will report that the specific file is missing.
So:
client-local.cfg:
[myhost]
file:/var/tmp/sys-heartbeat-myhost
analysis.cfg
HOST=myhost
FILE %^/var/tmp/sys-heartbeat-.* MTIME<3700
This will go red if the file is missing, or it exists and is older than
3700 seconds.
Regards,
Henrik
_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon
More information about the Xymon
mailing list