monit-general
[Top][All Lists]
Advanced

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

Re: how to monitor syslog.log for a certain string and then reboot if it


From: Martin Pala
Subject: Re: how to monitor syslog.log for a certain string and then reboot if it finds it
Date: Thu, 29 Mar 2012 19:44:14 +0200

According to the message the file doesn't exist - can you verify the file exists with "ls -l /var/log/syslog.log"? Does the user under which is monit running have the permissions to access the /var/log directory?

Regards,
Martin


On Mar 29, 2012, at 7:25 PM, Trent Leonard wrote:

I have a certain network condition that affects my Debian Squeeze (running monit 5.1.1) server every now and again. I am looking for a temporary measure to work around the issue, and this is what I need.

I need to configure monit to monitor /var/log/syslog.log for the string "NETDEV WATCHDOG: eth0 (e1000e): transmit queue 0 timed out" and reboot ONE time if it should find this string. This string could have characters before and after it.

Here is my /etc/monit/conf.d/syslog file contents:

check file syslog.log with path /var/log/syslog.log
  if match "NETDEV WATCHDOG: eth0 (e1000e): transmit queue 0 timed out" then exec "/sbin/init 6"

However, monit shows the below contents when configured this way. I have echo'ed the string into syslog.log, and still nothing. What am I missing?

Parameter Value
Name syslog.log
Path /var/log/syslog.log
Status Does not exist
Monitoring mode active
Monitoring status monitored
Check service every 1 cycle
Data collected Thu Mar 29 13:20:54 2012
Permission -
UID -
GID -
Timestamp -
Size -
Match regex -
Associated regex If match "NETDEV WATCHDOG: eth0 (e1000e): transmit queue 0 timed out" 1 times within 1 cycle(s) then exec '/sbin/init 6' timeout 0 cycle(s)

--
thanks,

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


reply via email to

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