<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-family: Calibri, sans-serif; ">
<div style="font-size: 14px; ">Hi Larry. Thanks for the reply.</div>
<div style="font-size: 14px; "><br>
</div>
<div style="font-size: 14px; ">There should always be files in the directories.  The dba keeps 7 days of backups and deletes anything > 8 days old.</div>
<div style="font-size: 14px; ">So, here's an update to see if anyone has other suggestions.  It's still not working.  Details on current settings for client-local.cfg and analysis.cfg are below:</div>
<div style="font-size: 14px; "><br>
</div>
<div style="font-size: 14px; ">Any further help or alertnative method appreciatedˇ¦</div>
<div style="font-size: 14px; "><br>
</div>
<div style="font-size: 14px; ">Don K</div>
<div style="font-size: 14px; "><br>
</div>
<div style="font-size: 14px; "><span style="font-family: Arial; ">client-local.cfg for mysqlserver01:</span></div>
<div><span style="font-size: 12px; font-family: Courier; ">[MYSQLSERVER01]</span></div>
<div>
<div><span style="font-size: 12px; font-family: Courier; "># dir:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 2>/dev/null`</span></div>
<div><span style="font-size: 12px; font-family: Courier; "># file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql  </span></div>
<div><span style="font-size: 12px; font-family: Courier; ">file:`find /Volumes/MySQL_Backups/ -name '*.sql' 2>/dev/null | sort -r | head -1`</span></div>
</div>
<div style="font-size: 14px; "><br>
</div>
<div style="font-size: 14px; ">This returns a file with the latest timestamp -</div>
<div>
<h3 style="font-size: 14px; "><span style="font-family: Arial; "> Fri Oct 5 12:59:57 CDT 2012 - Files ok</span></h3>
<span style="font-family: Arial; "></span>
<pre><span class="Apple-style-span" style="font-size: 14px;"><span style="font-family: Arial; "><img src="http://srmxymon.ambrosi.com/xymon/gifs/green.gif" alt="green" height="16" border="0" width="16"></span><span style="font-family: Arial; "> </span></span><a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql" style="font-size: 14px; "><span style="font-family: Arial; ">/Volumes/MySQL_Backups/mysql_backup_20121005.sql</span></a><span class="Apple-style-span" style="font-size: 14px; font-family: Arial; ">
</span><span style="font-family: Arial; font-size: 12px;"><br></span></pre>
<pre><span style="font-family: Arial; font-size: 12px;">Clicking the link above gives this:</span></pre>
<pre><span style="font-family: Arial; font-size: 12px;"><pre>[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:1349460427 (2012/10/05-13:07:07)
atime:1349444863 (2012/10/05-08:47:43)
ctime:1349444867 (2012/10/05-08:47:47)
mtime:1349444867 (2012/10/05-08:47:47)
</pre></span></pre>
<pre><span style="font-family: Arial; font-size: 12px;">From the directory listing snip below:</span></pre>
<pre><span style="font-family: Arial; font-size: 12px;"><span style="font-family: Courier; ">[root@MySQLServer01 MySQL_Backups]# ls -la
total 9933676
drwxr-xr-x 2 root root       4096 Oct  5 08:47 .
drwxrwxrwx 4 root root       4096 Oct  5 08:48 ..
-rw-r--r-- 1 root root     501060 Oct  3 00:10 mysql_backup_20121003.sql
-rw-r--r-- 1 root root     501060 Oct  4 00:10 mysql_backup_20121004.sql
-rw-r--r-- 1 root root     501060 Oct  5 08:47 mysql_backup_20121005.sql
[root@MySQLServer01 MySQL_Backups]# </span>
</span><span style="font-size: 12px; font-family: Arial; "><br></span></pre>
<pre><span style="font-size: 12px; font-family: Arial; ">
I have setup analysis.cfg as below:</span></pre>
<pre><span style="font-family: Arial; font-size: 12px;"><span class="Apple-style-span" style="font-family: Courier; ">HOST=MYSQLSERVER01
FILE /Volumes/MySQL_Backups/mysql_backup_20121005.sql red mtime<600  
# FILE %^.sql COLOR=red mtime<86400
# 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</span><span style="font-family: Courier; ">
</span></span></pre>
</div>
<div><br>
</div>
<div style="font-size: 14px; "><br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-size: 14px; ">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Larry Barber <<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Fri, 5 Oct 2012 09:40:44 -0500<br>
<span style="font-weight:bold">To: </span>Don Kuhlman <<a href="mailto:don.kuhlman@schawk.com">don.kuhlman@schawk.com</a>><br>
<span style="font-weight:bold">Cc: </span>Xymon Email List <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Xymon] File monitor not working in Xymon - using file list generated by wildcard<br>
</div>
<div><br>
</div>
If there will always be files in that directory you might want to consider getting rid of the -mtime argument to your find command. That way you will always get a file returned and then your mtime test in analysis.cfg will catch that the returned file, which
 should be the newest one in the directory thanks to  the sort,  is too old. <br>
<br>
Thanks,<br>
Larry Barber<br>
<br>
<div class="gmail_quote">On Fri, Oct 5, 2012 at 9:17 AM, Don Kuhlman <span dir="ltr">
<<a href="mailto:Don.Kuhlman@schawk.com" target="_blank">Don.Kuhlman@schawk.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks Ryan. Do you have any suggestions on how to get an alert if the<br>
file doesn't exist ?  It only gives me "no files checked" when the file<br>
isn't there.  That's okay if I can get that translated into an email that<br>
informs someone that no file was created.<br>
<br>
Does that make sense, or is my logic flawed ?<br>
<span class="HOEnZb"><font color="#888888"><br>
Don<br>
</font></span>
<div class="HOEnZb">
<div class="h5"><br>
On 10/5/12 9:08 AM, "Novosielski, Ryan" <<a href="mailto:novosirj@umdnj.edu">novosirj@umdnj.edu</a>> wrote:<br>
<br>
>-----BEGIN PGP SIGNED MESSAGE-----<br>
>Hash: SHA1<br>
><br>
>I'd meant there "head -1" by itself, which means "show the first<br>
>line." BTW, if you wanted to show just the last line, that would be<br>
>"tail -1".<br>
><br>
>On 10/05/2012 09:46 AM, Don Kuhlman wrote:<br>
>> Thanks Cynthia, Larry, and Ryan!<br>
>><br>
>> I modified the client-local.cfg file as below: [MYSQLSERVER01]<br>
>> file:`find /Volumes/MySQL_Backups/ -name "*.sql" -mtime 0<br>
>> 2>/dev/null | sort -r |head -1 --lines=1`<br>
>><br>
>> The webpage shows the file is present -<br>
>><br>
>><br>
>> Fri Oct 5 08:35:16 CDT 2012 - Files ok<br>
>><br>
>> green /Volumes/MySQL_Backups/mysql_backup_20121005.sql<br>
>><br>
>><<a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&" target="_blank">http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&</a><br>
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql><br>
>><br>
>>  If I click the link on the webpage it gives this:<br>
>> [file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql]<br>
>><br>
>> type:100000 (file) mode:644 (-rw-r--r--) linkcount:1 owner:0<br>
>> (root) group:0 (root) size:501060 clock:1349444303<br>
>> (2012/10/05-08:38:23) atime:1349425844 (2012/10/05-03:30:44)<br>
>> ctime:1349413801 (2012/10/05-00:10:01) mtime:1349413801<br>
>> (2012/10/05-00:10:01)<br>
>><br>
>> Next I changed the directory so no file matches the find command<br>
>> and then the files icon goes white and gives me the "No files<br>
>> checked" message.<br>
>><br>
>><br>
>> Fri Oct 5 08:45:23 CDT 2012 - Files ok<br>
>><br>
>> No files checked<br>
>><br>
>> Can anyone advise how I translate that into an email to our DBA to<br>
>> indicate the file doesn't exist ?<br>
>><br>
>> Thanks<br>
>><br>
>> Don K<br>
>><br>
>><br>
>> From: "Novosielski, Ryan" <<a href="mailto:novosirj@umdnj.edu">novosirj@umdnj.edu</a><br>
>> <mailto:<a href="mailto:novosirj@umdnj.edu">novosirj@umdnj.edu</a>>> Date: Fri, 5 Oct 2012 01:33:14 -0400<br>
>> To: "'<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a> <mailto:'<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a>>'"<br>
>> <<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a> <mailto:<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a>>>, Don Kuhlman<br>
>> <<a href="mailto:don.kuhlman@schawk.com">don.kuhlman@schawk.com</a> <mailto:<a href="mailto:don.kuhlman@schawk.com">don.kuhlman@schawk.com</a>>> Cc:<br>
>> "'<a href="mailto:xymon@xymon.com">xymon@xymon.com</a> <mailto:'<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>>'" <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
>> <mailto:<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>>> Subject: Re: [Xymon] File monitor not<br>
>> working in Xymon - using file list generated by wildcard<br>
>><br>
>> head -1 is probably a lot more standard (I've been encountering a<br>
>> lot of GNU scripts lately that have made me crazy).<br>
>><br>
>><br>
>> *From*: Larry Barber [mailto:<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a>] *Sent*: Thursday,<br>
>> October 04, 2012 05:39 PM *To*: Don Kuhlman <<a href="mailto:Don.Kuhlman@schawk.com">Don.Kuhlman@schawk.com</a><br>
>> <mailto:<a href="mailto:Don.Kuhlman@schawk.com">Don.Kuhlman@schawk.com</a>>> *Cc*: Xymon Email List<br>
>> <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a> <mailto:<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>>> *Subject*: Re: [Xymon]<br>
>> File monitor not working in Xymon - using file list generated by<br>
>> wildcard<br>
>><br>
>> Perhaps if you set up your client-local.cfg entry like:<br>
>><br>
>> file:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0<br>
>> 2>/dev/null | sort -r | head --lines=1`<br>
>><br>
>> so that only the most recent file (by name) will be returned.<br>
>><br>
>> Thanks, Larry Barber<br>
>><br>
>><br>
>><br>
>> On Thu, Oct 4, 2012 at 4:11 PM, Don Kuhlman<br>
>> <<a href="mailto:Don.Kuhlman@schawk.com">Don.Kuhlman@schawk.com</a> <mailto:<a href="mailto:Don.Kuhlman@schawk.com">Don.Kuhlman@schawk.com</a>>> wrote:<br>
>><br>
>> Hi folks. I've been trying to figure this out for a while and<br>
>> would appreciate any help.<br>
>><br>
>> I'm trying to monitor for a sql backup by watching for a set of<br>
>> files that are created every morning at 00:05 AM by a cron job on<br>
>> a server. There are several files created each night the sql dump<br>
>> runs. It creates them as filename_backup__yyyymmdd.sql So each day<br>
>> there are new file names created (never the same name) I want to<br>
>> alert if the file doesn't get created each day with the new name.<br>
>><br>
>> I have configured the client-local.cfg file as follows:<br>
>> [MYSQLSERVER01] # dir:`find /Volumes/MySQL_Backups/ -name '*.sql'<br>
>> -mtime 0 2>/dev/null` #<br>
>> file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql file:`find<br>
>> /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 2>/dev/null`<br>
>><br>
>> Analysis.cfg is as follows: HOST=MYSQLSERVER01 FILE %^.sql<br>
>> COLOR=red mtime<600 # FILE<br>
>> /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<600 #<br>
>> FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql COLOR=red<br>
>> mtime<600 # FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql<br>
>> red mtime>86400 # FILE<br>
>> /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<86400 #<br>
>> FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red<br>
>> mtime>600 # FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql<br>
>> mtime>86400 noexist<br>
>><br>
>> Xymon generates this msg when I use the full filename ˇ© eg<br>
>> mysqlbackup20121004.sql in analysis.cfg It doesn't work when I try<br>
>> to use a wildcard name (which I need because the filename will<br>
>> change each day) - eg FILE %^.sql<br>
>><br>
>> Example alert is below using full real filename:<br>
>><br>
>><br>
>> Thu Oct 4 16:02:11 CDT 2012 - Files NOT ok<br>
>><br>
>> red /Volumes/MySQL_Backups/mysql_backup_20121004.sql<br>
>><br>
>><<a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&" target="_blank">http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&</a><br>
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql><br>
>><br>
>><br>
>File was modified 57134 seconds ago - should be <600<br>
>><br>
>><br>
>> green /Volumes/MySQL_Backups/herbalife_backup_20121004.sql<br>
>><br>
>><<a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&" target="_blank">http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&</a><br>
>>SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql><br>
>><br>
>><br>
>><br>
>> Example below using %^.sql:<br>
>><br>
>><br>
>> Thu Oct 4 16:10:15 CDT 2012 - Files ok<br>
>><br>
>> green /Volumes/MySQL_Backups/mysql_backup_20121004.sql<br>
>><br>
>><<a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&" target="_blank">http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&</a><br>
>>SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql>green<br>
>> /Volumes/MySQL_Backups/herbalife_backup_20121004.sql<br>
>><br>
>><<a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&" target="_blank">http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&</a><br>
>>SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql><br>
>><br>
>>  Thanks<br>
>><br>
>><br>
>> Don K<br>
>><br>
>><br>
>><br>
>> _______________________________________________ Xymon mailing list<br>
>> <a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a> <mailto:<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a>><br>
>> <a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
>><br>
>><br>
><br>
><br>
>- --<br>
>- ---- _  _ _  _ ___  _  _  _<br>
>|Y#| |  | |\/| |  \ |\ |  | |Ryan Novosielski - Sr. Systems Programmer<br>
>|$&| |__| |  | |__/ | \| _| |<a href="mailto:novosirj@umdnj.edu">novosirj@umdnj.edu</a> -
<a href="tel:973%2F972.0922" value="+19739720922">973/972.0922</a> (2-0922)<br>
>\__/ Univ. of Med. and Dent.|IST/EI-Academic Svcs. - ADMC 450, Newark<br>
>-----BEGIN PGP SIGNATURE-----<br>
>Version: GnuPG v1.4.11 (GNU/Linux)<br>
>Comment: Using GnuPG with Mozilla - <a href="http://www.enigmail.net/" target="_blank">
http://www.enigmail.net/</a><br>
><br>
>iEYEARECAAYFAlBu6cYACgkQmb+gadEcsb4+nwCgmDPWgoqU3CArx2qcUMklTceW<br>
>ky8An1+npPWhxkVCANKk+DUu8sXkrIXO<br>
>=7gwh<br>
>-----END PGP SIGNATURE-----<br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</span>
</body>
</html>