[mythtv-users] Monit help needed! Howto monitor myth's log file?

William william_munson at comcast.net
Sat Jul 4 20:15:51 UTC 2009


First off, I really suck at regex. That out of the way I want to set up 
monit to monitor mythbackend log for a logged failure to record from 
firewire event and to restart the backend. I already have a patch in 
place to re-sync the STB as part of a restart of the backend service so 
that part is taken care of. What I need help with is the regex and 
control statement for the monitrc file. A failed firewire recording 
always generates the following text in the log:

Canceled recording (Recorder Failed)

I dont care at the moment what the recording is only that the system 
restart to clear the error. What is the correct regex to match that 
exact text anywhere in the line?

I think I need to use something like this:

#/etc/monit/monitrc

set daemon 120
set httpd port 2812

check file mythbackend.log at /var/log/mythtv/mythbackend.log
  if <fill in the regex> then exec "/etc/init.d/mythbackend restart"

however this results in a syntax error on the command following the exec 
command. Any thoughts on a more correct way to do this? I also get an 
error if i add the conditional statement "with start delay 60" to the 
daemon line even though the man pages plainly show it should work. I 
wonder if I have a really old version of monit? System is fully up to 
date afaik.

I am running ubuntu 8.10 if that matters.

TIA,
Bill



More information about the mythtv-users mailing list