[mythtv-users] Status check/monitoring of mythbackend
Jay Mallar
jaymallar at gmail.com
Thu Dec 6 17:53:14 UTC 2007
Josh wrote:
> On Dec 6, 2007 7:56 AM, Ismo Tanskanen <ismot at telemail.fi
> <mailto:ismot at telemail.fi>> wrote:
>
> Is there a way to check status of mythbackend reliable?
>
> My backend (svn) crashes sometimes and misses recordings. This
> fortunately happens quite seldom.
>
> I'm monitoring it with monit, but it does not seem to allways notice
> that backend is crashed. Or it is not "crashed" completely, I can see
> activity on mythbackend.log, for example eit scanning and expiring
> programs. But livetv, mythweb or recordings does not work without
> restarting. I assume that some part of backend is crashed but not all.
>
> - Kane
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org <mailto:mythtv-users at mythtv.org>
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
>
> http://www.mythtv.org/wiki/index.php/Using_pcsk_to_Supervise_mythbackend
> <http://www.mythtv.org/wiki/index.php/Using_pcsk_to_Supervise_mythbackend>
>
> Josh
> ------------------------------------------------------------------------
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
I've been using monit for some time now, and it has yet to miss a
crash. Here's my setup if it helps...
#!/bin/sh
set logfile /var/log/monit.log
set daemon 5
set statefile /var/run/monit.state
set httpd port 2812
allow localhost
allow 192.168.0.0/255.255.255.0
allow admin:monit
check process lircd
with pidfile "/var/run/lircd.pid"
start = "/etc/init.d/lircd start"
stop = "/etc/init.d/lircd stop"
check process mysql
with pidfile "/var/run/mysqld/mysqld.pid"
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed port 3306 then restart
check process mythbackend
with pidfile "/var/run/mythbackend.pid"
start = "/etc/init.d/mythbackend restart"
stop = "/etc/init.d/mythbackend stop"
depends mysql
You can also tell monit to check the http connection to see if the
server is still active by adding this to the mythbackend stanza:
if failed port 6544 proto http with timeout 15 seconds then restart
However, - I found that mythfilldatabase cause this to make monit think
the backend had died and restart it. You might need to play with the
timeout setting to your liking.
More information about the mythtv-users
mailing list