Hello Nick,

> I'm trying to detect that a program has stopped writing to its logfile but
> have been unable to come up with a working monit config to do so, has
> someone already done this and willing to share?

If you use Monit >= 5.22.0, you can define a check like this.

check file myapp_log with path /var/log/myapp.log
        if timestamp is older than 1 hour then exec "/usr/bin/monit restart 
myapp"

The test will restart "myapp" service if the timestamp was not modified
within last hour.

With regards,
Lutz


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to