[Xymon] File monitor not working in Xymon - using file list generated by wildcard

Don Kuhlman Don.Kuhlman at schawk.com
Mon Oct 8 19:59:23 CEST 2012


Jeremy. Thanks very much! That worked.  I was googling and trying to read all the regex tutorials I could find. I tried pcre on the server, but wasn't able to get the combinations right.

I really appreciate the help!

Don K


From: Jeremy Laidman <jlaidman at rebel-it.com.au<mailto:jlaidman at rebel-it.com.au>>
Date: Mon, 8 Oct 2012 09:56:26 +1100
To: Don Kuhlman <don.kuhlman at schawk.com<mailto:don.kuhlman at schawk.com>>
Cc: Xymon Email List <xymon at xymon.com<mailto:xymon at xymon.com>>
Subject: Re: [Xymon] File monitor not working in Xymon - using file list generated by wildcard

On 6 October 2012 05:49, Don Kuhlman <Don.Kuhlman at schawk.com<mailto:Don.Kuhlman at schawk.com>> wrote:
Hi folks. I believe the issue is my regex on the file name in the analysis.cfg.
I've used about 15 different values and the only thing I seem to get working is using the direct full filename vs, a regex to match any files.

In regular expressions the asterisk is not a wildcard in the same way as in DOS/Windows.  Instead, it is read as "zero or more of the previous character or symbol."  So what you probably want is ".*".  The dot "." is a one-character-width wildcard, which is why it needs to be escaped if you want to match a literal dot.  So ".*" means zero or more of any character.

Also, a regular expression match is applied only when the match string STARTS with a percent.

However, using any combos that I can think of as a regex do not:
# FILE %/Volumes/MySQL_Backups/*\.sql red mtime<86400

Here, you are asking to match zero or more slash characters before a ".sql".

# FILE /Volumes/MySQL_Backups/%*\.sql red mtime<600

Doesn't start with percent.

#FILE %^*.sql red mtime>86400

Again, ".*" rather than "*".

Can anyone suggest a way to format the analysis.cfg statement to match anything that ends in .sql ?

Try this:


FILE %/Volumes/MySQL_Backups/mysql_backup_.*\.sql red mtime<86400

This should go red if the matching file is older than 1 day.

J

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20121008/e098450c/attachment.html>


More information about the Xymon mailing list