monit-general
[Top][All Lists]
Advanced

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

Re: Question about monitrc file.


From: alex
Subject: Re: Question about monitrc file.
Date: Thu, 04 Oct 2007 11:55:31 +0300

   Hi Jovan.
   Thank you for detail answer. But one question you don't explain.
   Can you tell me from where you know about this feature (that heartbeat
don't monitoring scripts from /etc/rc.d/init.d or /etc/init.d)? I haven't
doubts that you are right (but i don't check this yet) but want to see
this fact in official documentation (as you wrote in previouse letter).

   Thank you very much,
   Alex


Note: httpd and smb are the name of startup scripts for Apache and Samba,
respectively. Heartbeat will look for startup scripts of the same name in
the following paths:
     /etc/ha.d/resource.d
     /etc/rc.d/init.d

Yes that's right, but leave the /etc/rc.d or /etc/init.d for the
"real" startup scripts ;)
Add the wrapper scripts to /etc/ha.d/resource.d

I've never tried linking the init.d scripts in  /etc/ha.d/resource.d.
Try it it may work.

Here is the wrappers script named ha-mysql that I wrote for
starting/stoping mysql
----------------------------
#!/bin/bash
exec_name=mysql
path_to_exec=/etc/init.d

start() {
      echo -n "Starting : "
      $path_to_exec/$exec_name start &&
      return
}

stop() {
      echo -n "Shutting down : "
                              killproc $exec_name
      return
}

case "$1" in
  start)
      start
      ;;
  stop)
      stop
      ;;
  *)
      echo "Usage: $0 {start|stop}"
      exit 1
      ;;
esac
-----------------------------------

It is located in /etc/ha.d/resource.d

Now you can add it to the monitrc part which monitors the mysql server
-----------------------
check process mysql_DBserver with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/ha.d/resoruce.d/ha-mysql start"
stop program = "/etc/ha.d/resoruce.d/ha-mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 2 restarts within 2 cycles then timeout
#if 2 restarts within 2 cycles then exec "/usr/sbin/monit heartbeat stop"
group Inet-Primaire
mode manual
---------------------

BR, Jovan


------
СХВАТКА за ADSL.BY началась. В первом отборочном туре сыграло более 2500 человек. Присоединяйтесь!
Заходи на http://adsl.cx.by и выигрывай каждый день совершенный интернет!








reply via email to

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