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

Don Kuhlman Don.Kuhlman at schawk.com
Fri Oct 5 16:17:29 CEST 2012


Thanks Ryan. Do you have any suggestions on how to get an alert if the
file doesn't exist ?  It only gives me "no files checked" when the file
isn't there.  That's okay if I can get that translated into an email that
informs someone that no file was created.

Does that make sense, or is my logic flawed ?

Don

On 10/5/12 9:08 AM, "Novosielski, Ryan" <novosirj at umdnj.edu> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>I'd meant there "head -1" by itself, which means "show the first
>line." BTW, if you wanted to show just the last line, that would be
>"tail -1".
>
>On 10/05/2012 09:46 AM, Don Kuhlman wrote:
>> Thanks Cynthia, Larry, and Ryan!
>> 
>> I modified the client-local.cfg file as below: [MYSQLSERVER01]
>> file:`find /Volumes/MySQL_Backups/ -name "*.sql" -mtime 0
>> 2>/dev/null | sort -r |head -1 --lines=1`
>> 
>> The webpage shows the file is present -
>> 
>> 
>> Fri Oct 5 08:35:16 CDT 2012 - Files ok
>> 
>> green /Volumes/MySQL_Backups/mysql_backup_20121005.sql
>> 
>><http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql>
>>
>>  If I click the link on the webpage it gives this:
>> [file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql]
>> 
>> type:100000 (file) mode:644 (-rw-r--r--) linkcount:1 owner:0
>> (root) group:0 (root) size:501060 clock:1349444303
>> (2012/10/05-08:38:23) atime:1349425844 (2012/10/05-03:30:44)
>> ctime:1349413801 (2012/10/05-00:10:01) mtime:1349413801
>> (2012/10/05-00:10:01)
>> 
>> Next I changed the directory so no file matches the find command
>> and then the files icon goes white and gives me the "No files
>> checked" message.
>> 
>> 
>> Fri Oct 5 08:45:23 CDT 2012 - Files ok
>> 
>> No files checked
>> 
>> Can anyone advise how I translate that into an email to our DBA to
>> indicate the file doesn't exist ?
>> 
>> Thanks
>> 
>> Don K
>> 
>> 
>> From: "Novosielski, Ryan" <novosirj at umdnj.edu
>> <mailto:novosirj at umdnj.edu>> Date: Fri, 5 Oct 2012 01:33:14 -0400
>> To: "'lebarber at gmail.com <mailto:'lebarber at gmail.com>'"
>> <lebarber at gmail.com <mailto:lebarber at gmail.com>>, Don Kuhlman
>> <don.kuhlman at schawk.com <mailto:don.kuhlman at schawk.com>> Cc:
>> "'xymon at xymon.com <mailto:'xymon at xymon.com>'" <xymon at xymon.com
>> <mailto:xymon at xymon.com>> Subject: Re: [Xymon] File monitor not
>> working in Xymon - using file list generated by wildcard
>> 
>> head -1 is probably a lot more standard (I've been encountering a
>> lot of GNU scripts lately that have made me crazy).
>> 
>> 
>> *From*: Larry Barber [mailto:lebarber at gmail.com] *Sent*: Thursday,
>> October 04, 2012 05:39 PM *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
>> 
>> Perhaps if you set up your client-local.cfg entry like:
>> 
>> file:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0
>> 2>/dev/null | sort -r | head --lines=1`
>> 
>> so that only the most recent file (by name) will be returned.
>> 
>> Thanks, Larry Barber
>> 
>> 
>> 
>> On Thu, Oct 4, 2012 at 4:11 PM, Don Kuhlman
>> <Don.Kuhlman at schawk.com <mailto:Don.Kuhlman at schawk.com>> wrote:
>> 
>> Hi folks. I've been trying to figure this out for a while and
>> would appreciate any help.
>> 
>> I'm trying to monitor for a sql backup by watching for a set of
>> files that are created every morning at 00:05 AM by a cron job on
>> a server. There are several files created each night the sql dump
>> runs. It creates them as filename_backup__yyyymmdd.sql So each day
>> there are new file names created (never the same name) I want to
>> alert if the file doesn't get created each day with the new name.
>> 
>> I have configured the client-local.cfg file as follows:
>> [MYSQLSERVER01] # dir:`find /Volumes/MySQL_Backups/ -name '*.sql'
>> -mtime 0 2>/dev/null` #
>> file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql file:`find
>> /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 2>/dev/null`
>> 
>> Analysis.cfg is as follows: HOST=MYSQLSERVER01 FILE %^.sql
>> COLOR=red mtime<600 # FILE
>> /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<600 #
>> FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql COLOR=red
>> mtime<600 # FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql
>> red mtime>86400 # FILE
>> /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<86400 #
>> FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red
>> mtime>600 # FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql
>> mtime>86400 noexist
>> 
>> Xymon generates this msg when I use the full filename ­ eg
>> mysqlbackup20121004.sql in analysis.cfg It doesn't work when I try
>> to use a wildcard name (which I need because the filename will
>> change each day) - eg FILE %^.sql
>> 
>> Example alert is below using full real filename:
>> 
>> 
>> Thu Oct 4 16:02:11 CDT 2012 - Files NOT ok
>> 
>> red /Volumes/MySQL_Backups/mysql_backup_20121004.sql
>> 
>><http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql>
>>
>> 
>File was modified 57134 seconds ago - should be <600
>> 
>> 
>> green /Volumes/MySQL_Backups/herbalife_backup_20121004.sql
>> 
>><http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&
>>SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql>
>>
>> 
>> 
>> Example below using %^.sql:
>> 
>> 
>> Thu Oct 4 16:10:15 CDT 2012 - Files ok
>> 
>> green /Volumes/MySQL_Backups/mysql_backup_20121004.sql
>> 
>><http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql>green
>> /Volumes/MySQL_Backups/herbalife_backup_20121004.sql
>> 
>><http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&
>>SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql>
>>
>>  Thanks
>> 
>> 
>> Don K
>> 
>> 
>> 
>> _______________________________________________ Xymon mailing list
>> Xymon at xymon.com <mailto:Xymon at xymon.com>
>> http://lists.xymon.com/mailman/listinfo/xymon
>> 
>> 
>
>
>- -- 
>- ---- _  _ _  _ ___  _  _  _
>|Y#| |  | |\/| |  \ |\ |  | |Ryan Novosielski - Sr. Systems Programmer
>|$&| |__| |  | |__/ | \| _| |novosirj at umdnj.edu - 973/972.0922 (2-0922)
>\__/ Univ. of Med. and Dent.|IST/EI-Academic Svcs. - ADMC 450, Newark
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.11 (GNU/Linux)
>Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
>iEYEARECAAYFAlBu6cYACgkQmb+gadEcsb4+nwCgmDPWgoqU3CArx2qcUMklTceW
>ky8An1+npPWhxkVCANKk+DUu8sXkrIXO
>=7gwh
>-----END PGP SIGNATURE-----
>
>





More information about the Xymon mailing list