Hello,

I am a monit newbie and need some help to get it working. I have used
it fo a while with apache and mysql (quite basic standalone usage) but
now I want to have a more advanced setup.

I have four services that I need to monitor/start/restart

mysql (listening on port 3306)
newcs (listening on port 15000)
sasc (listening on port 5456)
mythbackend (listening on ports 6543 and 6544)

The dependency chain looks:
mythbackend => sasc => newcs
mythbackend => mysql

- So "sasc" can not be started until "newcs" are started and listening
on 15000 and
"mythbackend" can not be started until "sasc" are started and
listening on port 5456.
- Also I want "sasc" and "mythtv" to be restarted if "newcs" have been
restarted, etc


I have done a first fragment of configuration but it does't work that good.
Can you see anything that should be added/changed to get it working ??

# ==[Start Database Group]=============================
# --[mySQL]------------------------------------------
check process mysql with pidfile /var/run/mysqld/mysqld.pid
   group database
   start program = "/etc/init.d/mysql start"
   stop program = "/etc/init.d/mysql stop"
   if failed host 127.0.0.1 port 3306 then restart
   if 5 restarts within 5 cycles then timeout
# ==[End Database Group]=============================

# ==[Start MythTv Group]=============================
# --[Newcs]------------------------------------------
check process newcs with pidfile /var/run/newcs.pid
   group mythtv
   start program = "/etc/init.d/newcs start"
   stop program  = "/etc/init.d/newcs stop"
   if failed port 15000 then restart
   if 10 restarts within 15 cycles then timeout
   mode active

# --[Sasc-ng]----------------------------------------
check process sasc-ng with pidfile /var/run/sasc-ng.pid
   group mythtv
   start program = "/etc/init.d/sasc-ng start"
   stop program  = "/etc/init.d/sasc-ng stop"
   if failed port 5456 then restart
   if 10 restarts within 15 cycles then timeout
   mode active
   depends on newcs

# --[MythTv]-----------------------------------------
check process mythbackend with pidfile /var/run/mythbackend.pid
   group mythtv
   start program = "/etc/init.d/mythbackend start"
   stop program  = "/etc/init.d/mythbackend stop"
   if failed port 6543 then restart
   if failed port 6544 then restart
   if 10 restarts within 15 cycles then timeout
   mode active
   depends on mysql, sasc-ng

# ==[End MythTv Group]===============================

--
// Jocke
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to