<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Thanks Cynthia, Larry, and Ryan!</div>
<div><br>
</div>
<div>I modified the client-local.cfg file as below:</div>
<div>[MYSQLSERVER01]</div>
<div>
<div>file:`find /Volumes/MySQL_Backups/ -name "*.sql" -mtime 0  2>/dev/null | sort -r |head -1 --lines=1`</div>
</div>
<div><br>
</div>
<div>The webpage shows the file is present - </div>
<div>
<div>
<h3> Fri Oct 5 08:35:16 CDT 2012 - Files ok</h3>
<pre><img src="http://srmxymon.ambrosi.com/xymon/gifs/green.gif" alt="green" height="16" border="0" width="16"> <a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql">/Volumes/MySQL_Backups/mysql_backup_20121005.sql</a></pre>
</div>
</div>
<div>If I click the link on the webpage it gives this:</div>
<div><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">[file:/Volumes/MySQL_Backups/mysql_backup_20121005.sql]</span></div>
<div>
<pre>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)</pre>
</div>
<div>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.</div>
<div><br>
</div>
<div>
<center>
<form action="/xymon-cgi/history.sh"></form>
</center>
<center>
<table summary="Detail Status" align="CENTER" border="0">
<tbody>
<tr>
<td align="LEFT">
<h3>Fri Oct 5 08:45:23 CDT 2012 - Files ok</h3>
<pre>No files checked

</pre>
</td>
</tr>
</tbody>
</table>
</center>
</div>
<div>Can anyone advise how I translate that into an email to our DBA to indicate the file doesn't exist ?</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>Don K</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<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>"Novosielski, Ryan" <<a href="mailto:novosirj@umdnj.edu">novosirj@umdnj.edu</a>><br>
<span style="font-weight:bold">Date: </span>Fri, 5 Oct 2012 01:33:14 -0400<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:'lebarber@gmail.com">'lebarber@gmail.com</a>'" <<a href="mailto:lebarber@gmail.com">lebarber@gmail.com</a>>, Don Kuhlman <<a href="mailto:don.kuhlman@schawk.com">don.kuhlman@schawk.com</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:'xymon@xymon.com">'xymon@xymon.com</a>'" <<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>
<font style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">head -1 is probably a lot more standard (I've been encountering a lot of GNU scripts lately that have made me crazy).
<br>
</font><br>
 <br>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<font style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><b>From</b>: Larry Barber [<a href="mailto:lebarber@gmail.com">mailto:lebarber@gmail.com</a>]
<br>
<b>Sent</b>: Thursday, October 04, 2012 05:39 PM<br>
<b>To</b>: Don Kuhlman <<a href="mailto:Don.Kuhlman@schawk.com">Don.Kuhlman@schawk.com</a>>
<br>
<b>Cc</b>: Xymon Email List <<a href="mailto:xymon@xymon.com">xymon@xymon.com</a>>
<br>
<b>Subject</b>: Re: [Xymon] File monitor not working in Xymon - using file list generated by wildcard
<br>
</font> <br>
</div>
Perhaps if you set up your client-local.cfg entry like:<br>
<br>
<div>file:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 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,<br>
Larry Barber<br>
</div>
<div><br>
</div>
<br>
<br>
<div class="gmail_quote">On Thu, Oct 4, 2012 at 4:11 PM, 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">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Hi folks. I've been trying to figure this out for a while and would appreciate any help.</div>
<div><br>
</div>
<div>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.</div>
<div>There are several files created each night the sql dump runs.</div>
<div>It creates them as filename_<span style="font-style:italic">backup__yyyymmdd.sql</span></div>
<div>So each day there are new file names created (never the same name)</div>
<div>I want to alert if the file doesn't get created each day with the new name.</div>
<div><br>
</div>
<div>I have configured the client-local.cfg file as follows:</div>
<div>
<div>[MYSQLSERVER01]</div>
<div># dir:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 2>/dev/null`</div>
<div># file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql</div>
<div>file:`find /Volumes/MySQL_Backups/ -name '*.sql' -mtime 0 2>/dev/null`</div>
<div><br>
</div>
</div>
<div>Analysis.cfg is as follows:</div>
<div>
<div>HOST=MYSQLSERVER01</div>
<div>FILE %^.sql COLOR=red mtime<600</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<600</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql COLOR=red mtime<600</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime>86400</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime<86400</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql red mtime>600</div>
<div># FILE /Volumes/MySQL_Backups/mysql_backup_20121004.sql mtime>86400 noexist</div>
<div><br>
</div>
<div>Xymon generates this msg when I use the full filename – eg mysql<span style="font-style:italic">backup</span>20121004.sql in analysis.cfg</div>
<div>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</div>
<div><br>
</div>
<div>Example alert is below using full real filename:</div>
<center>
<form action="http://xymon-cgi/history.sh" target="_blank" onsubmit="return window.confirm("You are submitting information to an external page.\nAre you sure?");">
</form>
</center>
<center>
<table summary="Detail Status" align="CENTER" border="0">
<tbody>
<tr>
<td align="LEFT">
<h3>Thu Oct 4 16:02:11 CDT 2012 - Files NOT ok</h3>
<pre><img src="http://srmxymon.ambrosi.com/xymon/gifs/red.gif" alt="red" height="16" width="16" border="0"> <a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql" target="_blank">/Volumes/MySQL_Backups/mysql_backup_20121004.sql</a>
File was modified 57134 seconds ago - should be <600


<img src="http://srmxymon.ambrosi.com/xymon/gifs/green.gif" alt="green" height="16" width="16" border="0"> <a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql" target="_blank">/Volumes/MySQL_Backups/herbalife_backup_20121004.sql</a><br></pre>
<pre><br></pre>
<pre>Example below using %^.sql:</pre>
<pre><h3> Thu Oct  4 16:10:15 CDT 2012 - Files ok</h3><pre><img src="http://srmxymon.ambrosi.com/xymon/gifs/green.gif" alt="green" height="16" width="16" border="0"> <a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/mysql_backup_20121004.sql" target="_blank">/Volumes/MySQL_Backups/mysql_backup_20121004.sql</a><img src="http://srmxymon.ambrosi.com/xymon/gifs/green.gif" alt="green" height="16" width="16" border="0"> <a href="http://srmxymon.ambrosi.com/xymon-cgi/svcstatus.sh?CLIENT=MYSQLSERVER01&SECTION=file:/Volumes/MySQL_Backups/herbalife_backup_20121004.sql" target="_blank">/Volumes/MySQL_Backups/herbalife_backup_20121004.sql</a></pre><pre>Thanks</pre><pre><br></pre><pre>Don K</pre><pre><br></pre></pre>
</td>
</tr>
</tbody>
</table>
</center>
</div>
</div>
<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>
<br>
</blockquote>
</div>
<br>
</span>
</body>
</html>