[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CHECK FILE with script to determine filepath

From: Marc Rossi
Subject: Re: CHECK FILE with script to determine filepath
Date: Thu, 13 Dec 2018 06:51:18 -0600

Thanks for reply.  

Maybe I'm not understanding. We already run several different scripts for monitoring other things but I would like to use the simple file content monitoring supported out of the box.
I already do this for several other apps that have a fixed name logfile (or their startup scripts create a soft-link to the logfile that I use) but for a few apps we are deploying now the logfile has a timestamp embedded in it which obviously can't be represented by a static entry on the "with path" line -- so I would like to have monit execute a script every time it runs this check to determine the logfile path.

On Wed, Dec 12, 2018 at 4:28 PM SZÉPE Viktor <address@hidden> wrote:
Idézem/Quoting Marc Rossi <address@hidden>:

> Have an app that like many other apps has a timestamp in the filename.
> Would like to monitor this logfile without having to create a symlink.
> Something like below.
> check file foo.log
>     with path `ls -rt /var/log/foo*| tail -n1`
>     if content = "ERROR" then alert

You may monitor a shell script's output that does regexp matching.
See *_script files in

SZÉPE Viktor, honlap üzemeltetés / Running your application
ügyelet/hotline: +36-20-4242498  address@hidden  skype: szepe.viktor
Budapest, III. kerület

To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]