<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
It won't work the way you are doing it now.  You are using an ls
command to dynamically create the list of files to check in your
client-local, so when that file is missing, the ls command doesn't
output it as a filename to check, so the test drops off when that file
dissappears,<br>
<br>
Since the files are dynamic, I assume created every day, you are going
to have to figure out a way to tell if one of them goes away.  Maybe
you could have a cron job that runs every morning, and does an ls of
the files and saves the output somewhere like
/var/tmp/todays_files.txt, and then in your client-local you could do
something like:<br>
<br>
[hostname]<br>
file:`head -1 /var/tmp/todays_files.txt|tail -1`<br>
file:`head -2 /var/tmp/todays_files.txt|tail -1`<br>
file:`head -3 /var/tmp/todays_files.txt|tail -1`<br>
...<br>
<br>
That would add a file entry for every line of todays_files.txt.  So if
one of the files got deleted, it would still be referenced in
todays_files.txt, and thus continue to be monitored (including
notification that it was no longer there).<br>
<br>
That is a frightful way to do it, but I can't think of anything better
at the moment :)  Dealing with randomly generated filenames is a pain.<br>
<br>
-Charles<br>
<br>
Stuffle, David (Corporate) wrote:
<blockquote
 cite="mid:EE86A53A2E3CA541B7395A898F21A85602DD2D74@US-CORP-MSG-002.adesa.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:navy;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style></o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I found part
of my problem of why the file
existence isn’t working.  I wasn’t specifying the full path in
the hobbit-clients.cfg file.  I also had to escape the forward slashes
and
underscores with backslashes.  Plus, the “red” parameter wasn’t
valid from what the log said.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">But still, I
want to know if a file doesn’t
exist.  The hobbitcleint.log file on the client just keeps saying<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"> “ls:
/usr/local/scripts/logs/dcsmnj8yecotnwbcevyym9t8c_4d7i*: No such file
or
directory”.  Therefore, it doesn’t report anything about
it.  But I want to be alerted that it doesn’t exist.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Is anyone
successfully monitoring file
existence?<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">D. Stuffle<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;"> Stuffle, David
(Corporate) [<a class="moz-txt-link-freetext" href="mailto:David.Stuffle@adesa.com">mailto:David.Stuffle@adesa.com</a>] <br>
  <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
November 27, 2007
5:15 PM<br>
  <b><span style="font-weight: bold;">To:</span></b> <a class="moz-txt-link-abbreviated" href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</a><br>
  <b><span style="font-weight: bold;">Subject:</span></b> RE: [hobbit]
File
existence monitoring</span></font><o:p></o:p></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Thanks Greg,
  <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">The
filenames do change, they have the
date appended to them.  I’m wanting to check that the files are
there and that they’re not 0 bytes.  <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I know that
when I was first setting it up
I messed up something and it said “File missing” when it
didn’t find the file.  Now it doesn’t seem to care.  <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">D. Stuffle<o:p></o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;"> Hubbard, Greg L
[<a class="moz-txt-link-freetext" href="mailto:greg.hubbard@eds.com">mailto:greg.hubbard@eds.com</a>] <br>
  <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
November 27, 2007
4:49 PM<br>
  <b><span style="font-weight: bold;">To:</span></b> <st1:PersonName
 w:st="on"><a class="moz-txt-link-abbreviated" href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</a></st1:PersonName><br>
  <b><span style="font-weight: bold;">Subject:</span></b> RE: [hobbit]
File
existence monitoring</span></font><o:p></o:p></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: blue;">If the file
names never change, then
specify the file name in the client-local.cfg instead of running the ls
command.  If you delete the file, then the ls command will return
nothing.  That is what I would try first, anyway.</span></font><o:p></o:p></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"> <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: blue;">Or, it could
be your check -- you are only
asking for an alarm if the file size is bigger than 1K.  A missing file
is
not bigger than 1K is it?  And it seems like you need to do some other
things as well to get this correct.  I am working from memory...</span></font><o:p></o:p></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"> <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="blue" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: blue;">GLH</span></font><o:p></o:p></p>
  <blockquote
 style="margin-top: 5pt; margin-right: 0in; margin-bottom: 5pt;">
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p> </o:p></span></font></p>
    <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
    <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
    <p class="MsoNormal" style="margin-bottom: 12pt;"><b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;"> Stuffle,
David (Corporate) [<a class="moz-txt-link-freetext" href="mailto:David.Stuffle@adesa.com">mailto:David.Stuffle@adesa.com</a>] <br>
    <b><span style="font-weight: bold;">Sent:</span></b> Tuesday,
November 27, 2007
2:59 PM<br>
    <b><span style="font-weight: bold;">To:</span></b> <st1:PersonName
 w:st="on"><a class="moz-txt-link-abbreviated" href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</a></st1:PersonName><br>
    <b><span style="font-weight: bold;">Subject:</span></b> [hobbit]
File existence
monitoring</span></font><o:p></o:p></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Hi,<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I’m wanting to check the
existence of specific files
in a directory and that they are at leat 1K in size.  I have this in
the
hobbit-clients.cfg file:<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">HOST=hostname1<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        PROC httpd<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE %^sdc_.*
MTIME<3600
TIME=W:0730:2200 red<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcs1xaz9saotnw713cmtaut8c_6w3j.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcsaplg0kbotnwvrj16x28msg_1i2n.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcsdq1p60cotnw32xcywlbisg_9i5q.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcsmnj8yecotnwbcevyym9t8c_4d7i.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcsp6ro5kbotnwvjh6yh0dmsg_3j1y.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">        FILE
%^dcsu5rokrbotnwb01tmd19mat_4w7s.* red size>1K TIME=*:0730:1800<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">And this in
client-local.cfg:<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">[hostname1]<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`find
/usr/local/webtrends/sdc/weblog -type f | xargs
ls -1tr | tail -1`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcs1xaz9saotnw713cmtaut8c_6w3j*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcsaplg0kbotnwvrj16x28msg_1i2n*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcsdq1p60cotnw32xcywlbisg_9i5q*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcsmnj8yecotnwbcevyym9t8c_4d7i*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcsp6ro5kbotnwvjh6yh0dmsg_3j1y*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">file:`ls -1
/usr/local/scripts/logs/dcsu5rokrbotnwb01tmd19mat_4w7s*`<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">They all show up under
the files column.  To test it, I
deleted the file specified in the last line from the directory, but all
Hobbit
does is remove it from displaying.  I want it to go red saying that the
file does not exist.<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">The man pages says “</span></font>By
default, a
warning is triggered for files that have a FILE entry, but which do not
exist.”  But, I’m not seeing this occur.<o:p></o:p></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">Any ideas?<o:p></o:p></span></font></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p> </o:p></span></font></p>
    <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">D. Stuffle</span></font><font face="Arial"
 size="2"><span style="font-size: 10pt; font-family: Arial;">   <o:p></o:p></span></font></p>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">DISCLAIMER:<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">The information transmitted is intended only for the person or entity to <o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">which it is addressed and may contain confidential and/or privileged material.<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">Any review, retransmission, dissemination or other use of, or taking of<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">any action in reliance upon, this information by persons or entities other<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">than the intended recipient is prohibited. If you received this in error,<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">please contact the sender and destroy any copies of this document and<o:p></o:p></span></font></pre>
    <pre><font face="Courier New" size="2"><span
 style="font-size: 10pt;">any attachments.<o:p></o:p></span></font></pre>
  </blockquote>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">DISCLAIMER:<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">The information transmitted is intended only for the person or entity to <o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">which it is addressed and may contain confidential and/or privileged material.<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">Any review, retransmission, dissemination or other use of, or taking of<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">any action in reliance upon, this information by persons or entities other<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">than the intended recipient is prohibited. If you received this in error,<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">please contact the sender and destroy any copies of this document and<o:p></o:p></span></font></pre>
  <pre><font face="Courier New" size="2"><span style="font-size: 10pt;">any attachments.<o:p></o:p></span></font></pre>
  </div>
  <pre>DISCLAIMER:
The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received this in error,
please contact the sender and destroy any copies of this document and
any attachments.
  </pre>
</blockquote>
<br>
</body>
</html>