0

I need to send an alert if one daemon (linux) stops writing in his log file. This dameon not work properly and it not write any when shutdown.

I am using an inotify for watch this problem.

I see this:

inotifywait -e modify -t 10 /usr/local/assp/maillog.txt
Setting up watches.
Watches established.
/usr/local/assp/maillog.txt MODIFY

I create this cron:

*/1 * * * * inotifywait -e modify -t 120 /usr/local/assp/maillog.txt || echo "Assp stopped" | mail -s "$(hostname) ASSP stopped" mymail@mail.me

I think is a bad code. Any better ideas?

abkrim
  • 407
  • 6
  • 18

0 Answers0