<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Mark,<br>
<br>
thanks, but this doesn't work either. I assume the problem is that
the backticks are evaluated, but the "$(date)" isn't as that is
done by sh and sh doesn't know $(variable). So what we need is
some thing like one backtick expansion after the other. or a way
to let ksh do the job. But I don't know if there is way to achieve
that.<br>
<br>
The workaround is ok for the moment. If the log is missing it
wouldn't be very serious as we are checking for <span
style="font-family:"Arial","sans-serif"">MTIME<600
(last access more then 10 minutes ago). So xymon will get red in
case todays file is missing as it is older than that,<br>
kind regards<br>
Rolf<br>
</span></div>
<blockquote
cite="mid:5423B232CA65934E965B64588ED5D5EB192D56BB@USA7109MB015.na.xerox.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Arial","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">Wonder
if you need to preface the operation with an eval to get the
date command to operate first – don’t know if this will work
with Xymon.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">FILE
`eval find /home/mypath/log/update_out_$(date +%Y%m%d).txt`
MTIME<red<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">The
other thing I would be a little leery of, is having any
expression calculation in the filepath variable in the find
command – some older Unix flavors may get upset over this
syntax. Calculations/regex tend to be better supported with
the –name attribute. Ditto with presumed output versus need
to use “-print “ in older find commands. If you don’t need
to support older Unix flavors, then ignore all of this.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">FILE
`eval find /home/mypath/log –name “update_out_$(date
+%Y%m%d).txt” –print` MTIME<red<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">Above
would need more work though as by itself it will keep
hunting down the log directory tree for possibly other
files.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D">The
thing I don’t particular care for with `ls –tr
/home/mypath/log/update_put_*.txt| tail -1` is what happens
if the current day’s file is missing? Then you are parsing
yesterday’s or the last log file. No complaints if the wrong
file is being operated on. Would ~assume you want some kind
of alert if the today’s log file is missing….<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Xymon [<a class="moz-txt-link-freetext" href="mailto:xymon-bounces@xymon.com">mailto:xymon-bounces@xymon.com</a>]
<b>On Behalf Of </b>Rolf Schrittenlocher<br>
<b>Sent:</b> Thursday, September 26, 2013 7:44 AM<br>
<b>To:</b> deepak deore<br>
<b>Cc:</b> xymon<br>
<b>Subject:</b> Re: [Xymon] File monitoring with `date`
in filename<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thanks Deepak,<br>
<br>
unfortunately that won't help as I need the file with the
present date in its name. I did now:<br>
`ls -tr /home/mypath/log/update_out_*.txt|tail -1` <br>
This workaround helped. But I'm still curious if there is a
solution for first expanding the date and second the whole
expression<br>
`find /home/mypath/log/update_out_$(date +%Y%m%d).txt`
(sorry, I dropped the find in my first posting)<br>
<br>
kind regards<br>
Rolf<br>
<br>
<br>
Looks like your analysis.cfg entry is wrong.Try this. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:8.0pt;font-family:"Arial","sans-serif"">FILE
/home/mypath/log/update_out_</span><span
style="font-family:"Arial","sans-serif"">[0-9]*-[0-9]*-[0-9]*\.txt
MTIME<600 red</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Sep 26, 2013 at 1:04 PM, Rolf
Schrittenlocher <<a moz-do-not-send="true"
href="mailto:schritte@ub.uni-frankfurt.de"
target="_blank">schritte@ub.uni-frankfurt.de</a>>
wrote:<o:p></o:p></p>
<p class="MsoNormal">Dear xymon users,<br>
<br>
I got stuck while trying to monitor a file which should
be updated regularly and which has got a timestamp in
its name.<br>
"files" on the server remains clear, no data . Could
someone tell me what is wrong with these settings or
what have i forgotten?<br>
<br>
On the server we have in<br>
analysis.cfg<br>
HOST=myserver<br>
FILE `/home/mypath/log/update_out_$(date
+%Y%m%d).txt` MTIME<600 red<br>
<br>
in client-local.cfg:<br>
[myserver]<br>
file:`find /mypath/log/update_out_$(date +%Y%m%d).txt`<br>
<br>
<br>
I see an entry for this file on the client<br>
in tmp logfetch.myserver.cfg<br>
file:`find /mypath/log/update_out_$(date +%Y%m%d).txt`<br>
<br>
but there is nothing for this file in msg.myserver.txt<br>
<br>
File exists and is readable:<br>
find /home/mypath/log/update_out_$(date +%Y%m%d).txt
-exec ls -l {} \;<br>
-rw-rw-r-- 1 ... 2467070 Sep 26 08:43
/home/mypath/log/update_out_20130926.txt<br>
<br>
In xymonclient.log I see an entry<br>
sh: syntax error at line 1: `(' unexpected<br>
but I don't know if it is related to the file problem or
to anything else.<br>
I know that sh can't deal with $(xy), I tried as well<br>
FILE /home/mypath/log/update_out_`date +%Y%m%d`.txt
MTIME<600 red<br>
but in vain.<br>
<br>
Any help appreciated,<br>
kind regards<br>
Rolf<br>
<br>
<br>
-- <br>
Mit freundlichen Gruessen<br>
Rolf Schrittenlocher<br>
<br>
Lokales Bibliothekssystem Frankfurt<br>
Senckenberganlage 31, 60054 Frankfurt<br>
Tel: (49) 69 - 798 28908 Fax: (49) 69 798 28817<br>
LBS: <a moz-do-not-send="true"
href="mailto:lbs-f@mlist.uni-frankfurt.de"
target="_blank">lbs-f@mlist.uni-frankfurt.de</a><br>
Persoenlich: <a moz-do-not-send="true"
href="mailto:schritte@ub.uni-frankfurt.de"
target="_blank">schritte@ub.uni-frankfurt.de</a><br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
<a moz-do-not-send="true" href="mailto:Xymon@xymon.com"
target="_blank">Xymon@xymon.com</a><br>
<a moz-do-not-send="true"
href="http://lists.xymon.com/mailman/listinfo/xymon"
target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Mit freundlichen Gruessen<o:p></o:p></pre>
<pre>Rolf Schrittenlocher<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Lokales Bibliothekssystem Frankfurt<o:p></o:p></pre>
<pre>Senckenberganlage 31, 60054 Frankfurt<o:p></o:p></pre>
<pre>Tel: (49) 69 - 798 28908 Fax: (49) 69 798 28817<o:p></o:p></pre>
<pre>LBS: <a moz-do-not-send="true" href="mailto:lbs-f@mlist.uni-frankfurt.de">lbs-f@mlist.uni-frankfurt.de</a><o:p></o:p></pre>
<pre>Persoenlich: <a moz-do-not-send="true" href="mailto:schritte@ub.uni-frankfurt.de">schritte@ub.uni-frankfurt.de</a> <o:p></o:p></pre>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Mit freundlichen Gruessen
Rolf Schrittenlocher
Lokales Bibliothekssystem Frankfurt
Senckenberganlage 31, 60054 Frankfurt
Tel: (49) 69 - 798 28908 Fax: (49) 69 798 28817
LBS: <a class="moz-txt-link-abbreviated" href="mailto:lbs-f@mlist.uni-frankfurt.de">lbs-f@mlist.uni-frankfurt.de</a>
Persoenlich: <a class="moz-txt-link-abbreviated" href="mailto:schritte@ub.uni-frankfurt.de">schritte@ub.uni-frankfurt.de</a> </pre>
</body>
</html>