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

William william_munson at comcast.net
Sun Jul 5 17:46:37 UTC 2009


Following up to my own post. Spent some time getting to know regex and I 
think I have things set up correctly now. For those who are interested, 
here is my monitrc minus the personal info.


----------------------

# check the backend log for strings indicating a problem with a firewire
# activity. If found run the external script monit-actions-mythtv to clean
# up the mess.
check file mythbackend.log with path /var/log/mythtv/mythbackend.log
   if match ".*Canceled recording \(Recorder Failed\).*" then exec 
monit-actions-mythtv
   if match ".*Failed to set channel.*"                  then exec 
monit-actions-mythtv
   if match ".*Unable to get handle for port.*"          then exec 
monit-actions-mythtv


# check the backend process to see if its died. allow the pid file to change
# and only alert on the event as a log file event will cause the pid to 
change.
check process mythbackend with pidfile /var/run/mythtv/mythbackend.pid
   start program = "/etc/init.d/mythtv-backend restart"
   stop program  = "/etc/init.d/mythtv-backend stop"
   if failed port 6544 proto http for 3 times within 5 cycles then restart
   if changed pid then alert
   depends on mysql


# check the mysql process. any change in this should trigger a restart.
check process mysql with pidfile /var/run/mysqld/mysqld.pid
   start program = "/etc/init.d/mysql start"
   stop program = "/etc/init.d/mysql stop"
   if failed port 3306 then restart




More information about the mythtv-users mailing list