Xymon Mailing List Archive search

File monitoring.

7 messages in this thread

list Thomas Pedersen · Thu, 11 Jan 2007 15:10:30 +0100 ·
hi all,

Trying to get file monitoring to work. Works find with fixed filenames 
but I need to match a pattern in a directory and find the oldest file. 
If more than say 7200 sec old in mtime then generate an alert.

in client-local.cfg I have

file:`ls -t /ftp/input/* | tail -1`

which produces the oldest file name on the web page.

I have the following in hobbit-clients.cfg

   FILE %/ftp/input/*.gz RED mtime<7200

but I get no alarms.

Any ideas ?
list Jerry Yu · Thu, 11 Jan 2007 09:59:36 -0500 ·
For wildcard, you want '.*' to represent any character instead of '*'
alone.  I have a handful of this kind of FILE checks.
quoted from Thomas Pedersen

On 1/11/07, Thomas <user-97316fb2dd2a@xymon.invalid> wrote:
hi all,

Trying to get file monitoring to work. Works find with fixed filenames
but I need to match a pattern in a directory and find the oldest file.
If more than say 7200 sec old in mtime then generate an alert.

in client-local.cfg I have

file:`ls -t /ftp/input/* | tail -1`

which produces the oldest file name on the web page.

I have the following in hobbit-clients.cfg

   FILE %/ftp/input/*.gz RED mtime<7200

but I get no alarms.

Any ideas ?

list Jerry Yu · Thu, 11 Jan 2007 10:03:33 -0500 ·
another thing I do is use /bin/ls instead of 'ls', so the file name
generated by the backticks won't contain any termcap escape characters or
alike.
quoted from Jerry Yu

On 1/11/07, Jerry Yu <user-764c1f364fe0@xymon.invalid> wrote:
For wildcard, you want '.*' to represent any character instead of '*'
alone.  I have a handful of this kind of FILE checks.

On 1/11/07, Thomas <user-97316fb2dd2a@xymon.invalid> wrote:
hi all,

Trying to get file monitoring to work. Works find with fixed filenames
but I need to match a pattern in a directory and find the oldest file.
If more than say 7200 sec old in mtime then generate an alert.

in client-local.cfg I have

file:`ls -t /ftp/input/* | tail -1`

which produces the oldest file name on the web page.

I have the following in hobbit-clients.cfg

   FILE %/ftp/input/*.gz RED mtime<7200

but I get no alarms.

Any ideas ?

list Thomas Pedersen · Thu, 11 Jan 2007 16:06:33 +0100 ·
Do you mean like this ?

FILE %/ftp/input/.*.gz RED mtime<7200 or

FILE %/ftp/input/.* RED mtime<7200
quoted from Jerry Yu

Jerry Yu wrote:
For wildcard, you want '.*' to represent any character instead of '*' 
alone.  I have a handful of this kind of FILE checks.

On 1/11/07, *Thomas * <user-97316fb2dd2a@xymon.invalid 
<mailto:user-97316fb2dd2a@xymon.invalid>> wrote:

    hi all,

    Trying to get file monitoring to work. Works find with fixed filenames
    but I need to match a pattern in a directory and find the oldest file.
    If more than say 7200 sec old in mtime then generate an alert.

    in client-local.cfg I have

    file:`ls -t /ftp/input/* | tail -1`

    which produces the oldest file name on the web page.

    I have the following in hobbit-clients.cfg

       FILE %/ftp/input/*.gz RED mtime<7200

    but I get no alarms.

    Any ideas ?

list Jerry Yu · Thu, 11 Jan 2007 14:46:28 -0500 ·
both are ok,since .* is not greedy as in PERL's. The former is preferred
since it provides more exact match.
quoted from Thomas Pedersen

On 1/11/07, Thomas <user-97316fb2dd2a@xymon.invalid> wrote:
Do you mean like this ?

FILE %/ftp/input/.*.gz RED mtime<7200 or

FILE %/ftp/input/.* RED mtime<7200

Jerry Yu wrote:
For wildcard, you want '.*' to represent any character instead of '*'
alone.  I have a handful of this kind of FILE checks.

On 1/11/07, *Thomas * <user-97316fb2dd2a@xymon.invalid
<mailto:user-97316fb2dd2a@xymon.invalid>> wrote:

    hi all,

    Trying to get file monitoring to work. Works find with fixed
filenames
    but I need to match a pattern in a directory and find the oldest
file.
    If more than say 7200 sec old in mtime then generate an alert.

    in client-local.cfg I have

    file:`ls -t /ftp/input/* | tail -1`

    which produces the oldest file name on the web page.

    I have the following in hobbit-clients.cfg

       FILE %/ftp/input/*.gz RED mtime<7200

    but I get no alarms.

    Any ideas ?

list Jerry Yu · Fri, 12 Jan 2007 11:23:17 -0500 ·
to my surprise, * actually works on my Hobbit-4.2rc1-20060712 server.

what's your test condition?  You want it to alert when your oldest file is
less than 2-hour old ?   More commonly, people want to test if their oldest
file is older than 2-hour old (mtime >7200 instead of mtime < 7200).

To further troubleshoot: on your client, check the
logfetch.ClientNameHere.cfg under ~hobbit/client/tmp/. Also check
msg.ClientNameHere.txt therein to see whether it has a
[file:/ftp/input/oldestFileName.gz]
section.
quoted from Jerry Yu


On 1/11/07, Jerry Yu <user-764c1f364fe0@xymon.invalid> wrote:
both are ok,since .* is not greedy as in PERL's. The former is preferred
since it provides more exact match.

On 1/11/07, Thomas < user-97316fb2dd2a@xymon.invalid> wrote:
Do you mean like this ?

FILE %/ftp/input/.*.gz RED mtime<7200 or

FILE %/ftp/input/.* RED mtime<7200

Jerry Yu wrote:
For wildcard, you want '.*' to represent any character instead of '*'
alone.  I have a handful of this kind of FILE checks.

On 1/11/07, *Thomas * <user-97316fb2dd2a@xymon.invalid
<mailto:user-97316fb2dd2a@xymon.invalid>> wrote:

    hi all,

    Trying to get file monitoring to work. Works find with fixed
filenames
    but I need to match a pattern in a directory and find the oldest
file.
    If more than say 7200 sec old in mtime then generate an alert.

    in client-local.cfg I have

    file:`ls -t /ftp/input/* | tail -1`

    which produces the oldest file name on the web page.

    I have the following in hobbit-clients.cfg

       FILE %/ftp/input/*.gz RED mtime<7200

    but I get no alarms.

    Any ideas ?

list Thomas Pedersen · Fri, 12 Jan 2007 19:06:01 +0100 ·
I left it with the .*.gz to look acuratly for the files I want to 
monitor - and ys you are right I need to switch the contition for mtime 
round.

The tip og using the full file path made it work.
quoted from Jerry Yu

Jerry Yu wrote:
to my surprise, * actually works on my Hobbit-4.2rc1-20060712 server.

what's your test condition?  You want it to alert when your oldest 
file is less than 2-hour old ?   More commonly, people want to test if 
their oldest file is older than 2-hour old (mtime >7200 instead of 
mtime < 7200).

To further troubleshoot: on your client, check the 
logfetch.ClientNameHere.cfg under ~hobbit/client/tmp/. Also check 
msg.ClientNameHere.txt therein to see whether it has a 
[file:/ftp/input/oldestFileName.gz] section.


On 1/11/07, *Jerry Yu* <user-764c1f364fe0@xymon.invalid <mailto:user-764c1f364fe0@xymon.invalid>> 
quoted from Jerry Yu
wrote:

    both are ok,since .* is not greedy as in PERL's. The former is
    preferred since it provides more exact match.


    On 1/11/07, * Thomas* < user-97316fb2dd2a@xymon.invalid
    <mailto:user-97316fb2dd2a@xymon.invalid>> wrote:

        Do you mean like this ?

        FILE %/ftp/input/.*.gz RED mtime<7200 or

        FILE %/ftp/input/.* RED mtime<7200

        Jerry Yu wrote:
For wildcard, you want '.*' to represent any character
        instead of '*'
alone.  I have a handful of this kind of FILE checks.

On 1/11/07, *Thomas * <user-97316fb2dd2a@xymon.invalid

<mailto: user-97316fb2dd2a@xymon.invalid
quoted from Jerry Yu
        <mailto:user-97316fb2dd2a@xymon.invalid>>> wrote:
    hi all,

    Trying to get file monitoring to work. Works find with
        fixed filenames
    but I need to match a pattern in a directory and find the
        oldest file.
    If more than say 7200 sec old in mtime then generate an
        alert.

    in client-local.cfg I have

    file:`ls -t /ftp/input/* | tail -1`

    which produces the oldest file name on the web page.

    I have the following in hobbit-clients.cfg

       FILE %/ftp/input/*.gz RED mtime<7200

    but I get no alarms.

    Any ideas ?

        user-095ef1c764a2@xymon.invalid <mailto:user-095ef1c764a2@xymon.invalid>>