monit-dev
[Top][All Lists]
Advanced

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

autostart->mode - forgotten attachement


From: Martin Pala
Subject: autostart->mode - forgotten attachement
Date: Sun, 03 Nov 2002 20:50:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020913 Debian/1.1-1


diff -Naur monit/CHANGES.txt monit.cvs-20021103/CHANGES.txt
--- monit/CHANGES.txt   2002-10-13 23:01:16.000000000 +0200
+++ monit.cvs-20021103/CHANGES.txt      2002-11-03 20:42:43.000000000 +0100
@@ -8,6 +8,17 @@
    monitor processes which are forged with ssl.  Monit's server can
    run with ssl, too.
 
+*  This release replaces 'autostart' statement with 'mode' keyword.
+   'autostart' is now deprecated.
+
+*  This release supports three monitoring modes. In addition to present
+   active (equals obsolete autostart=yes) and passive (equals tricky
+   obsolete autostart=no) there is manual mode, that allows to use
+   monit as simple cluster process monitor in addition to usual tasks.
+   Thanks to Oliver Jehle <address@hidden> for proposal and
+   helping with patch.
+
+
 Version 3.0
 
 *  A new feature to check and utilize systems and process information
diff -Naur monit/alert.c monit.cvs-20021103/alert.c
--- monit/alert.c       2002-09-07 14:15:01.000000000 +0200
+++ monit.cvs-20021103/alert.c  2002-11-03 19:11:55.000000000 +0100
@@ -36,6 +36,7 @@
 #define DO_CHECKSUM 2
 #define DO_RESOURCE 3
 #define DO_STOP     4
+#define DO_FAILED   5
 
 
 /* Private Prototypes */
@@ -47,10 +48,12 @@
 
 /* Private Variables */
 static char desc[][STRLEN]= {"timed out", "restarted", "checksum error", 
-                            "matches resource limitation", "stopped"};
+                             "matches resource limitation", "stopped",
+                             "failed"};
 
 static char desclog[][STRLEN]= {"Timeout", "Restart", "Checksum error", 
-                               "Resource limit matched", "Stop"};
+                                "Resource limit matched", "Stop",
+                                "Failed"};
 
 
 /**
@@ -154,6 +157,22 @@
 }
 
 
+/**
+ * Send an alert failed message to the email address for this process
+ * @param p A process_t object
+ * @param m An optional message string. May be NULL.
+ */
+void smtp_alert_failed(Process_T p, char *m, ...) {
+
+  va_list ap;
+
+  va_start(ap, m);
+  smtp_alert(p, DO_FAILED, m, ap);
+  va_end(ap);
+
+}
+
+
 /* ----------------------------------------------------------------- Private */
 
 
diff -Naur monit/alert.h monit.cvs-20021103/alert.h
--- monit/alert.h       2002-08-30 02:16:50.000000000 +0200
+++ monit.cvs-20021103/alert.h  2002-11-03 19:12:37.000000000 +0100
@@ -39,5 +39,6 @@
 void  smtp_alert_checksum(Process_T, char *, ...);
 void  smtp_alert_resource(Process_T, char *, ...);
 void  smtp_alert_stop(Process_T, char *, ...);
+void  smtp_alert_failed(Process_T, char *, ...);
 
 #endif
diff -Naur monit/control.c monit.cvs-20021103/control.c
--- monit/control.c     2002-10-16 20:26:56.000000000 +0200
+++ monit.cvs-20021103/control.c        2002-11-03 19:17:45.000000000 +0100
@@ -65,7 +65,7 @@
  */
 void control_process(Process_T p, char *action, int daemon) {
 
-  /* stop dependant processes */
+  /* Stop dependant processes */
   control_dependant_process(p, "stop", daemon);
 
   /* Start/stop the process we asked for */
@@ -133,6 +133,9 @@
   }
 
   if(is(action, "start")) {
+    LOCK(Run.mutex)
+      p->do_validate= TRUE;
+    END_LOCK;
     if ( (pid= is_process_running(p)) ) {
       error("%s: '%s' is already running with pid%d\n", prog, P, pid);
       return;
@@ -143,10 +146,10 @@
     }
   }
   else if(is(action, "stop")) {
+    LOCK(Run.mutex)
+      p->do_validate= FALSE;
+    END_LOCK;
     if(! is_process_running(p)) {
-      LOCK(Run.mutex)
-       p->do_validate= FALSE;
-      END_LOCK;
       error("%s: '%s' is not running\n", prog, P);
       return;
     }
diff -Naur monit/http/cervlet.c monit.cvs-20021103/http/cervlet.c
--- monit/http/cervlet.c        2002-10-27 18:47:24.000000000 +0100
+++ monit.cvs-20021103/http/cervlet.c   2002-11-03 19:21:35.000000000 +0100
@@ -663,6 +663,9 @@
   out_print(res,
            "<tr><td>Check process</a></td><td>Every %d cycle</td></tr>",
            p->every?p->every:1);
+  out_print(res,
+           "<tr><td>Monitoring mode</a></td><td>%s</td></tr>",
+           modenames[p->mode]);
   {
     Port_T n;
     for(n= p->portlist; n; n= n->next) {
diff -Naur monit/l.l monit.cvs-20021103/l.l
--- monit/l.l   2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/l.l      2002-11-03 19:22:16.000000000 +0100
@@ -141,6 +141,10 @@
 autostart         { return AUTOSTART; }
 yes              { return YES; }
 no               { return NO; }
+mode              { return MODE; }
+active            { return ACTIVE; }
+passive           { return PASSIVE; }
+manual            { return MANUAL; }
 group             { return GROUP; }
 request           { return REQUEST; }
 depend            { return DEPEND; }
diff -Naur monit/monit.pod monit.cvs-20021103/monit.pod
--- monit/monit.pod     2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/monit.pod        2002-11-03 19:39:30.000000000 +0100
@@ -215,6 +215,61 @@
   monit -g <groupname> status
 
 
+=head1 MONITORING MODE SELECTION
+
+Monit supports three monitoring modes: active, passive and
+manual.
+
+In I<active> mode, monit will monitor the program - in the
+case that the program is not running it will start/restart
+it (this is the default behaviour).
+
+In I<passive> mode, monit will only monitor the service.
+Resource related restart and stop options are ignored in
+this mode as well and will only send alert.
+
+For clustered environments there is I<manual> option. If it
+is defined, monit will enter I<active> mode only if the
+service was started under monit's control, for example by:
+
+  monit start sybase
+
+or
+
+  monit -g database start (for service group)
+
+If the service wasn't started by monit or was stopped for
+example by:
+
+  monit stop sybase
+
+or
+
+  monit -g database stop (for service group)
+
+it woun't monitor the service at all. It allows to have
+service configured in monitrc and start it along with its
+process monitor only if it should run. It could be used for
+building simple cluster. You can use for example heartbeat
+to watch health of nodes and in the case of one machine
+failure start the service on secondary node.
+
+Appropriate scripts that can call monit to start/stop
+specific service are needed on both nodes - typical usage:
+
+  FILE                    DESCRIPTION
+  -----------------------------------
+  /etc/inittab            starts monit
+  /etc/rcS.d/S41heartbeat execute "monit start heartbeat"
+  /etc/init.d/monit-node1 execute "monit -g node1 start"
+  /etc/init.d/monit-node2 execute "monit -g node2 start"
+
+so hearbeat can control easy the cluster state and if one
+node fails, hearbeat starts monit-xxxxx of the failing
+node => monit is instructed to start the services of the
+failing node and monitor them...
+
+
 =head1 ALERT MESSAGES
 
 monit will send an email alert if a program timed out, if monit
@@ -550,7 +605,7 @@
  
  host www.tildeslash.com port 80 protocol http
 
-At the moment monit knows how to speak I<HTTP>, I<SMPT>, I<FTP>,
+At the moment monit knows how to speak I<HTTP>, I<SMTP>, I<FTP>,
 I<POP>, I<IMAP> and I<NNTP>. If you have compiled monit with ssl
 support, monit can also speak I<HTTPS>, I<FTPS>, I<POPS> and
 I<IMAPS>.
@@ -985,9 +1040,17 @@
                  cycle. Usefull in daemon mode when the
                  poll-cycle is short and the program takes
                  some time to start. 
- autostart       Must be followed by the keywords yes or no. 
-                 If yes, monit will restart the program if 
-                 it is not running (the default behaviour).
+ mode            Must be followed either by the keyword active,
+                 passive or manual. If active, monit will restart
+                 the program if it is not running (this is the
+                 default behaviour). If passive, monit will not
+                 (re)start the program if it is not running - it
+                 will only monitor and send alerts (resource
+                 related restart and stop options are ignored
+                 in this mode also). If manual, monit will enter
+                 active mode only if service was started under
+                 monit's control otherwise the service isn't
+                 monitored.
  cpuusage        Must be followed by a compare operator, a 
                  floating point number, optionally a maximum
                  number of cycles and an action. This statement
@@ -1020,9 +1083,9 @@
 I<port(number)>, I<unix(socket)>, I<type>, I<proto(col)>, I<tcp>,
 I<tcpssl>, I<udp>, I<alert>, I<mail-format>, I<restart>,
 I<timeout>, I<checksum>, I<resource>, I<expect>, I<mailserver>,
-I<every>, I<autostart>, I<yes>, I<no>, I<host>, I<default>,
-I<http>, I<ftp>, I<smtp>, I<pop>, I<nntp>, I<imap>, I<request>,
-I<cpuusage>, I<memusage>, I<memkbyte> and I<loadavg>.
+I<every>, I<mode>, I<active>, I<passive>, I<manual>, I<host>,
+I<default>, I<http>, I<ftp>, I<smtp>, I<pop>, I<nntp>, I<imap>,
+I<request>, I<cpuusage>, I<memusage>, I<memkbyte> and I<loadavg>.
 
 And here is a complete list of B<noise keywords> ignored by
 monit:
@@ -1122,20 +1185,20 @@
    every 2 cycle
 
 Here is an example where we group together two database entries.
-The autostart statement is also illustrated in the first entry and
+The mode statement is also illustrated in the first entry and
 have the effect that monit will not try to (re)start this program
 if it is not running:
 
  check sybase with pidfile /var/run/sybase.pid
    start program = "/etc/init.d/sybase start"
    stop program  = "/etc/init.d/sybase stop"
-   autostart no
+   mode passive
    group database
 
  check oracle with pidfile /var/run/oracle.pid
    start program = "/etc/init.d/oracle start"
    stop program  = "/etc/init.d/oracle stop"
-   autostart yes # Not necessary really, since this is the default
+   mode active # Not necessary really, since this is the default
    port 9001
    alert address@hidden
    group database
@@ -1251,7 +1314,7 @@
    alert address@hidden on { restart, timeout } with
      mail-format { from: address@hidden }
    every 2 cycles
-   autostart yes
+   mode active
    depend webfoo
 
 Note; only the B<check-> and B<pidfile statement> are mandatory,
diff -Naur monit/monit_process.c monit.cvs-20021103/monit_process.c
--- monit/monit_process.c       2002-11-01 20:30:38.000000000 +0100
+++ monit.cvs-20021103/monit_process.c  2002-11-03 19:44:11.000000000 +0100
@@ -79,6 +79,7 @@
 char operatornames[][STRLEN]={"greater than", "less than",
                              "equal to", "not equal to"};
 char operatorshortnames[][3]={">", "<", "=", "!="};
+char modenames[][STRLEN]={"active", "passive", "manual"};
 
 int num_cpus=1;
 
diff -Naur monit/monit_process.h monit.cvs-20021103/monit_process.h
--- monit/monit_process.h       2002-10-28 19:02:16.000000000 +0100
+++ monit.cvs-20021103/monit_process.h  2002-11-03 19:45:33.000000000 +0100
@@ -34,6 +34,7 @@
 extern char actionnames[][STRLEN];
 extern char operatornames[][STRLEN];
 extern char operatorshortnames[][3];
+extern char modenames[][STRLEN];
 extern int num_cpus;
 
 #define RESOURCE_ID_CPU_PERCENT 1
diff -Naur monit/monitor.h monit.cvs-20021103/monitor.h
--- monit/monitor.h     2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/monitor.h        2002-11-03 19:50:29.000000000 +0100
@@ -66,6 +66,10 @@
 #define FORCE_CONTROL      0
 #define HTTP_CONTROL       1
 
+#define MODE_ACTIVE        0
+#define MODE_PASSIVE       1
+#define MODE_MANUAL        2
+
 #define MAXIMUM(x,y)       ((x) > (y) ? (x) : (y))
 #define is(a,b)                   ((a&&b)?!strcasecmp(a, b):0)
 
@@ -247,6 +251,7 @@
   Command_T start;                    /**< The start command for the process */
   Command_T stop;                      /**< The stop command for the process */
   int  do_validate;    /**< validation flag, if FALSE, no validation is done */
+  int  mode;                            /**< Monitoring mode for the process */
   int  ncycle;                          /**< The number of the current cycle */
   int  nstart;           /**< The number of current starts with this process */
   int  to_start;                                  /**< Timeout start ceiling */
diff -Naur monit/monitrc monit.cvs-20021103/monitrc
--- monit/monitrc       2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/monitrc  2002-11-03 19:54:34.000000000 +0100
@@ -97,11 +97,14 @@
 #
 #   every          -- Only check the program at every n cycles. Optional.
 #
-#   autostart      -- Must be followed by the keywords yes or no. If yes
-#                     monit will restart the program if it is not running
-#                     (this is the default behaviour). If no monit will not
-#                     (re)start the program if it is not running. It is 
-#                     recommended that you use yes or don't use this statement.
+#   mode           -- Must be followed either by the keyword active, passive
+#                    or manual. If active, monit will restart the program
+#                    if it is not running (this is the default behaviour).
+#                    If passive, monit will only monitor and send alerts
+#                    (resource related restart and stop options are ignored
+#                    in this mode also). If manual, monit will enter active
+#                    mode only if service was started under monit's control
+#                    otherwise the service isn't monitored.
 #
 #   cpuusage       -- Must be followed by a compare operator, a floating
 #                     point number, optionally a maximum number of cycles
@@ -216,9 +219,9 @@
 #  check sybase with pidfile /var/run/sybase.pid
 #    start program = "/etc/init.d/sybase start"
 #    stop program  = "/etc/init.d/sybase stop"
+#    mode passive
 #    port 4001 
 #    timeout if 2 restarts within 3 cycles
 #    alert address@hidden
-#    autostart no
 #    group database
 #    depend apache
diff -Naur monit/p.y monit.cvs-20021103/p.y
--- monit/p.y   2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/p.y      2002-11-03 19:58:54.000000000 +0100
@@ -177,7 +177,7 @@
 %token <number> NUMBER
 %token <real> REAL
 %token CPUUSAGE MEMUSAGE MEMKBYTE RESOURCE LOADAVG1 LOADAVG5 LOADAVG15
-%token AUTOSTART YES NO 
+%token AUTOSTART YES NO MODE ACTIVE PASSIVE MANUAL
 %token GROUP REQUEST DEPEND
 
 %nonassoc CHECKSUM
@@ -222,6 +222,7 @@
                 | alert
                | checksum
                | autostart
+               | mode
                | group
                 | depend
                | resource resourcecycle resourceaction  {
@@ -481,8 +482,17 @@
                 | PATH EXPECT STRING { addchecksum($1, $3); }
                 ;
 
-autostart      : AUTOSTART YES { current->do_validate=TRUE; }
-               | AUTOSTART NO  { current->do_validate=FALSE; }
+autostart       : AUTOSTART YES {
+                    yyerror("%s: Warning: 'autostart yes' is deprecated - use 
'mode active' statement instead");
+                  }
+                | AUTOSTART NO  {
+                    yyerror("%s: Warning: 'autostart no' is deprecated - use 
'mode passive' statement instead");
+                  }
+                ;
+
+mode            : MODE ACTIVE  { current->mode= MODE_ACTIVE; }
+                | MODE PASSIVE { current->mode= MODE_PASSIVE; }
+                | MODE MANUAL  { current->mode= MODE_MANUAL; 
current->do_validate= FALSE; }
                ;
 
 group          : GROUP STRING { current->group= $2; }
@@ -662,6 +672,7 @@
 
   /* Set default values */
   current->do_validate= TRUE;
+  current->mode= MODE_ACTIVE;
 
   current->name= name;
   current->pidfile= pidfile;
diff -Naur monit/util.c monit.cvs-20021103/util.c
--- monit/util.c        2002-11-03 17:45:08.000000000 +0100
+++ monit.cvs-20021103/util.c   2002-11-03 20:06:16.000000000 +0100
@@ -321,7 +321,7 @@
 
 /**
  * @param name A process name as stated in the config file
- * @return the named process or NULL of not found
+ * @return the named process or NULL if not found
  */
 Process_T get_process(char *name) {
   
@@ -581,7 +581,7 @@
     
   }
   
-  printf(" %-20s = %s\n", "Autostart", p->do_validate?"yes":"no");
+  printf(" %-20s = %s\n", "Monitoring mode", modenames[p->mode]);
   printf("\n");
   
 }
diff -Naur monit/validate.c monit.cvs-20021103/validate.c
--- monit/validate.c    2002-10-27 18:47:23.000000000 +0100
+++ monit.cvs-20021103/validate.c       2002-11-03 20:30:37.000000000 +0100
@@ -109,7 +109,7 @@
  * Validate the given process - If the process is not running,
  * start it. If the process listens on a port try to connect to
  * the port and test the stated protocol at the port, if the
- * connect or protocol test fails, restart the process. 
+ * connect or protocol test fails, optionaly restart the process. 
  *
  * We block for the signals SIGTERM while in this function.
  */
@@ -241,29 +241,25 @@
   va_list ap;
   char *tmp = NULL;
 
-  if(!p->start || !p->stop || !p->do_validate) {
-  
+  if(!p->start || !p->stop || !p->do_validate)
     return;
-    
-  }
-
-  log("Trying to restart '%s'\n", p->name);
-  
-  control_process(p, "stop", FORCE_CONTROL);
-  sleep(10); /* Wait for process termination */
 
   va_start(ap, m);
+  if(m)
+    tmp=format(m, ap);
+  va_end(ap);
 
-  if (m) { 
+  if(p->mode!= MODE_PASSIVE) {
 
-    tmp=format(m,ap);
+    log("Trying to restart '%s'\n", p->name);
+
+    control_process(p, "stop", FORCE_CONTROL);
+    sleep(10); /* Wait for process termination */
 
   }
 
-  va_end(ap);
-  
-  
-  do_start(p, "%s", tmp );
+  do_start(p, "%s", tmp);
+
   free(tmp);
 
 }
@@ -278,36 +274,34 @@
   va_list ap;
   char *tmp = NULL;
 
-  if (!p->start || !p->do_validate) {
-    
+  if( !p->start || !p->do_validate )
     return;
-    
-  }
 
-  if (p->def_timeout) {
-    
-      p->nstart++;
+  if(p->def_timeout)
+    p->nstart++;
 
-  }
+  /* Start alert */
+  va_start(ap, m);
+  if(m)
+    tmp=format(m, ap);
+  va_end(ap);
 
-  /* Start process and take care of dependants */
-  control_process(p, "start", FORCE_CONTROL);
+  if(p->mode!= MODE_PASSIVE) {
 
-  /* (Re)start alert */
-    
-  sleep(3); /* In case we just started our own smtp server */
+    /* Start process and take care of dependants */
+    control_process(p, "start", FORCE_CONTROL);
 
-  va_start(ap, m);
+    /* In the case we just started our own smtp server we'll
+     * sleep before attempting to send alert */
+    sleep(3);
 
-  if (m) { 
+    smtp_alert_restart(p, "%s", tmp);
 
-    tmp=format(m,ap);
+  } else {
 
-  }
+    smtp_alert_failed(p, "%s", tmp);
 
-  va_end(ap);
-  
-  smtp_alert_restart(p, "%s", tmp);
+  }
 
   free(tmp);
   
@@ -323,36 +317,40 @@
   va_list ap;
   char *tmp = NULL;
 
-  if ( !p->stop || !p->do_validate ) {
-    
+  if( !p->stop || !p->do_validate )
     return;
-    
-  }
+
+  /* Stop alert */
+  va_start(ap, m);
+  if(m)
+    tmp=format(m, ap);
+  va_end(ap);
 
   LOCK(Run.mutex)
     p->do_validate= FALSE;
   END_LOCK;
 
-  /* Stop alert */
-  va_start(ap, m);
+  if(p->mode!= MODE_PASSIVE) {
 
-  if (m) { 
+    smtp_alert_stop(p, "%s", tmp);
 
-    tmp=format(m,ap);
+    /* In the case we just stop our own smtp server we'll
+     * sleep before stopping it */
+    sleep(3);
 
-  }
+    /* Stop the process and dependants */
+    control_process(p, "stop", FORCE_CONTROL);
 
-  va_end(ap);
-  
-  
-  smtp_alert_stop(p, "%s", tmp);
+  } else {
 
-  free(tmp);
+    if(p->def_timeout)
+      p->nstart++;
 
-  sleep(3); /* In case we gonna stop our own smtp server */
+    smtp_alert_failed(p, "%s", tmp);
 
-  /* Stop the process and dependants */
-  control_process(p, "stop", FORCE_CONTROL);
+  }
+
+  free(tmp);
 
 }
 
@@ -363,8 +361,10 @@
  */
 static int do_not_validate(Process_T p) {
   
-  return (!p->do_validate || check_skip(p) || check_timeout(p) ||
-          check_checksum(p));
+  return (!p->do_validate  ||
+          check_skip(p)    ||
+          check_timeout(p) ||
+          check_checksum(p));
 
 }
 
@@ -874,8 +874,8 @@
       smtp_alert_checksum(p, NULL);
       
       LOCK(Run.mutex)
-         p->do_validate= FALSE;
-      p->has_checksum_error= TRUE;
+        p->do_validate= FALSE;
+        p->has_checksum_error= TRUE;
       END_LOCK;
       
       rv= FALSE;
diff -Naur monit/web/index.html monit.cvs-20021103/web/index.html
--- monit/web/index.html        2002-09-18 08:57:45.000000000 +0200
+++ monit.cvs-20021103/web/index.html   2002-11-03 20:34:53.000000000 +0100
@@ -33,18 +33,21 @@
         <BR>&nbsp;</BR> <U>monit supports:</U>
       <UL>
         <LI> Daemon mode - poll programs at a specified interval
+       <LI> Monitoring modes - active, passive or manual
         <LI> Start, stop and restart of programs
-        <LI> Group- and manage groups of programs
+        <LI> Group - and manage groups of programs
         <LI> Logging - syslog or own logfile
         <LI> Configuration - comprehensive controlfile
         <LI> Runtime and TCP/IP port checking (<I>tcp</I> and <I>udp</I>)
         <LI> Unix domain socket checking
         <LI> Process status and process timeout
-        <LI> Process memory usage and process cpu usage
-        <LI> Alert, stop or restart a process based on it's characteristics
+       <LI> Process cpu usage
+       <LI> Process memory usage
         <LI> Check the systems load average
+        <LI> Alert, stop or restart a process based on it's characteristics
         <LI> MD5 checksum for programs started and stopped by monit
-        <LI> Alert notification for program timeout, restart and checksum error
+       <LI> Alert notification for program timeout, restart, checksum, stop
+            and resource error
         <LI> Flexible and customizable email alert messages 
         <LI> Protocol verification. HTTP, FTP, SMTP, POP, IMAP and NNTP
         <LI> A <a href="screen.html">http interface</a> 
diff -Naur monit/web/monit.html monit.cvs-20021103/web/monit.html
--- monit/web/monit.html        2002-09-20 07:59:58.000000000 +0200
+++ monit.cvs-20021103/web/monit.html   2002-11-03 20:37:51.000000000 +0100
@@ -1,310 +1,367 @@
-<HTML>
-<HEAD>
-<TITLE>monit - system for monitoring programs</TITLE>
-<LINK REV="made" HREF="mailto:address@hidden";>
-</HEAD>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+<head>
+<title>monit - system for monitoring programs</title>
+<link rev="made" href="mailto:address@hidden"; />
+</head>
 
-<BODY>
+<body style="background-color: white">
 
-<A NAME="__index__"></A>
+<p><a name="__index__"></a></p>
 <!-- INDEX BEGIN -->
 
-<UL>
+<ul>
 
-       <LI><A HREF="#name">NAME</A></LI>
-       <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
-       <LI><A HREF="#description">DESCRIPTION</A></LI>
-       <LI><A HREF="#general operation">GENERAL OPERATION</A></LI>
-       <UL>
-
-               <LI><A HREF="#general options and arguments">General Options 
and Arguments</A></LI>
-       </UL>
-
-       <LI><A HREF="#logging">LOGGING</A></LI>
-       <LI><A HREF="#daemon mode">DAEMON MODE</A></LI>
-       <LI><A HREF="#init support">INIT SUPPORT</A></LI>
-       <LI><A HREF="#group support">GROUP SUPPORT</A></LI>
-       <LI><A HREF="#alert messages">ALERT MESSAGES</A></LI>
-       <UL>
-
-               <LI><A HREF="#setting a global mail format">Setting a global 
mail format</A></LI>
-       </UL>
-
-       <LI><A HREF="#program timeout">PROGRAM TIMEOUT</A></LI>
-       <LI><A HREF="#resource testing">RESOURCE TESTING</A></LI>
-       <LI><A HREF="#connection testing">CONNECTION TESTING</A></LI>
-       <LI><A HREF="#monit httpd">MONIT HTTPD</A></LI>
-       <UL>
-
-               <LI><A HREF="#monit httpd authentication">Monit HTTPD 
Authentication</A></LI>
-       </UL>
-
-       <LI><A HREF="#md5 checksum">MD5 CHECKSUM</A></LI>
-       <LI><A HREF="#the run control file">THE RUN CONTROL FILE</A></LI>
-       <UL>
-
-               <LI><A HREF="#run control syntax">Run Control Syntax</A></LI>
-               <LI><A HREF="#configuration examples">CONFIGURATION 
EXAMPLES</A></LI>
-       </UL>
-
-       <LI><A HREF="#files">FILES</A></LI>
-       <LI><A HREF="#signals">SIGNALS</A></LI>
-       <LI><A HREF="#notes">NOTES</A></LI>
-       <LI><A HREF="#authors">AUTHORS</A></LI>
-       <LI><A HREF="#copyright">COPYRIGHT</A></LI>
-       <LI><A HREF="#see also">SEE ALSO</A></LI>
-</UL>
+       <li><a href="#name">NAME</a></li>
+       <li><a href="#synopsis">SYNOPSIS</a></li>
+       <li><a href="#description">DESCRIPTION</a></li>
+       <li><a href="#general_operation">GENERAL OPERATION</a></li>
+       <ul>
+
+               <li><a href="#general_options_and_arguments">General Options 
and Arguments</a></li>
+       </ul>
+
+       <li><a href="#logging">LOGGING</a></li>
+       <li><a href="#daemon_mode">DAEMON MODE</a></li>
+       <li><a href="#init_support">INIT SUPPORT</a></li>
+       <li><a href="#group_support">GROUP SUPPORT</a></li>
+       <li><a href="#monitoring_mode_selection">MONITORING MODE 
SELECTION</a></li>
+       <li><a href="#alert_messages">ALERT MESSAGES</a></li>
+       <ul>
+
+               <li><a href="#setting_a_global_mail_format">Setting a global 
mail format</a></li>
+       </ul>
+
+       <li><a href="#program_timeout">PROGRAM TIMEOUT</a></li>
+       <li><a href="#resource_testing">RESOURCE TESTING</a></li>
+       <li><a href="#connection_testing">CONNECTION TESTING</a></li>
+       <li><a href="#dependency_checking">DEPENDENCY CHECKING</a></li>
+       <li><a href="#monit_httpd">MONIT HTTPD</a></li>
+       <ul>
+
+               <li><a href="#monit_httpd_authentication">Monit HTTPD 
Authentication</a></li>
+       </ul>
+
+       <li><a href="#md5_checksum">MD5 CHECKSUM</a></li>
+       <li><a href="#the_run_control_file">THE RUN CONTROL FILE</a></li>
+       <ul>
+
+               <li><a href="#run_control_syntax">Run Control Syntax</a></li>
+               <li><a href="#configuration_examples">CONFIGURATION 
EXAMPLES</a></li>
+       </ul>
+
+       <li><a href="#files">FILES</a></li>
+       <li><a href="#signals">SIGNALS</a></li>
+       <li><a href="#notes">NOTES</a></li>
+       <li><a href="#authors">AUTHORS</a></li>
+       <li><a href="#copyright">COPYRIGHT</a></li>
+       <li><a href="#see_also">SEE ALSO</a></li>
+</ul>
 <!-- INDEX END -->
 
-<HR>
-<P>
-<H1><A NAME="name">NAME</A></H1>
-<P>monit - system for monitoring programs</P>
-<P>
-<HR>
-<H1><A NAME="synopsis">SYNOPSIS</A></H1>
-<P><STRONG>monit</STRONG> [options] {arguments}</P>
-<P>
-<HR>
-<H1><A NAME="description">DESCRIPTION</A></H1>
-<P><STRONG>monit</STRONG> is a utility for monitoring and managing daemons or
+<hr />
+<p>
+</p>
+<h1><a name="name">NAME</a></h1>
+<p>monit - system for monitoring programs</p>
+<p>
+</p>
+<hr />
+<h1><a name="synopsis">SYNOPSIS</a></h1>
+<p><strong>monit</strong> [options] {arguments}</p>
+<p>
+</p>
+<hr />
+<h1><a name="description">DESCRIPTION</a></h1>
+<p><strong>monit</strong> is a utility for monitoring and managing daemons or
 similar programs running on a Unix system; monit will start
 specified programs if they are not running and restart programs
-not responding.</P>
-<P>The monit utility can run in a daemon mode to repeatedly poll one
-or more programs at a specified interval.</P>
-<P>
-<HR>
-<H1><A NAME="general operation">GENERAL OPERATION</A></H1>
-<P>The behavior of monit is controlled by command-line options
-<EM>and</EM> a run control file, <EM>~/.monitrc</EM>, the syntax of which we
+not responding.</p>
+<p>The monit utility can run in a daemon mode to repeatedly poll one
+or more programs at a specified interval.</p>
+<p>
+</p>
+<hr />
+<h1><a name="general_operation">GENERAL OPERATION</a></h1>
+<p>The behavior of monit is controlled by command-line options
+<em>and</em> a run control file, <em>~/.monitrc</em>, the syntax of which we
 describe in a later section. Command-line options override
-<EM>.monitrc</EM> declarations.</P>
-<P>The following options are recognized by monit. It's recommended
+<em>.monitrc</em> declarations.</p>
+<p>The following options are recognized by monit. It's recommended
 that you set the log and daemon options in the control
-<EM>.monitrc</EM> file.</P>
-<P>
-<H2><A NAME="general options and arguments">General Options and 
Arguments</A></H2>
-<P><STRONG>-c</STRONG> <EM>file</EM>
-   Use this control file</P>
-<P><STRONG>-l</STRONG> <EM>logfile</EM>
-   Print log information to this file.</P>
-<P><STRONG>-d</STRONG> <EM>n</EM>
-   Run as a daemon once per <EM>n</EM> seconds</P>
-<P><STRONG>-I</STRONG>
-   Run from init (do not run in background)</P>
-<P><STRONG>-g</STRONG> 
-   Set group name for start, stop, restart and status</P>
-<P><STRONG>-v</STRONG>
-   Verbose mode, work noisy (diagnostic output)</P>
-<P><STRONG>-V</STRONG>
-   Print version number and patchlevel</P>
-<P><STRONG>-h</STRONG>
-   Print a help text</P>
-<P>In addition to the options above, monit can be started with one
+<em>.monitrc</em> file.</p>
+<p>
+</p>
+<h2><a name="general_options_and_arguments">General Options and 
Arguments</a></h2>
+<p><strong>-c</strong> <em>file</em>
+   Use this control file</p>
+<p><strong>-l</strong> <em>logfile</em>
+   Print log information to this file.</p>
+<p><strong>-d</strong> <em>n</em>
+   Run as a daemon once per <em>n</em> seconds</p>
+<p><strong>-I</strong>
+   Run from init (do not run in background)</p>
+<p><strong>-g</strong> 
+   Set group name for start, stop, restart and status</p>
+<p><strong>-v</strong>
+   Verbose mode, work noisy (diagnostic output)</p>
+<p><strong>-V</strong>
+   Print version number and patchlevel</p>
+<p><strong>-h</strong>
+   Print a help text</p>
+<p>In addition to the options above, monit can be started with one
 of the following action arguments; monit will then execute the
-action and exit without transforming itself to a deamon.</P>
-<P><STRONG>start</STRONG>
+action and exit without transforming itself to a deamon.</p>
+<p><strong>start</strong>
     Start all programs listed in the control file. If
     the group option is set, only start the programs in
-    the named group.</P>
-<P><STRONG>start name</STRONG>
+    the named group.</p>
+<p><strong>start name</strong>
     Start the named program. The name must exist in the
-    monitrc file, after a <EM>check</EM> keyword. See also
-    the MONIT HTTPD section below.</P>
-<P><STRONG>stop</STRONG>     
+    monitrc file, after a <em>check</em> keyword. See also
+    the MONIT HTTPD section below.</p>
+<p><strong>stop</strong>     
     Stop all programs listed in the control file. If
     the group option is set, only stop the programs in
-    the named group.</P>
-<P><STRONG>stop name</STRONG>
+    the named group.</p>
+<p><strong>stop name</strong>
     Stop the named program. The name must exist in the
-    monitrc file, after a <EM>check</EM> keyword. See also 
-    the MONIT HTTPD section below.</P>
-<P><STRONG>restart</STRONG>
+    monitrc file, after a <em>check</em> keyword. See also 
+    the MONIT HTTPD section below.</p>
+<p><strong>restart</strong>
     Stop and start all programs. If the group option is
-    set, only restart the programs in the named group.</P>
-<P><STRONG>restart name</STRONG>
+    set, only restart the programs in the named group.</p>
+<p><strong>restart name</strong>
     Restart the named program. The name must exist in
-    the monitrc file, after a <EM>check</EM> keyword. also
-    the MONIT HTTPD section below.</P>
-<P><STRONG>status</STRONG>
+    the monitrc file, after a <em>check</em> keyword. also
+    the MONIT HTTPD section below.</p>
+<p><strong>status</strong>
     Print status information for each program. If the
     group option is set, only print the status for the
-    named group.</P>
-<P><STRONG>quit</STRONG>
-    Kill monit daemon process</P>
-<P><STRONG>validate</STRONG>
+    named group.</p>
+<p><strong>quit</strong>
+    Kill monit daemon process</p>
+<p><strong>validate</strong>
     Check all programs and start the ones not running.
     Also if a program indicates (in the control file)
     that it's listening on a port number, although 
     monit cannot connect to the port, then restart the
     program. This action is also the default 
-    behavior when monit runs in daemon mode.</P>
-<P>
-<HR>
-<H1><A NAME="logging">LOGGING</A></H1>
-<P>monit will log status and error messages to a log file. If
-<STRONG>syslog</STRONG> is given as a value for the <EM>-l</EM> option (or the
-keyword <EM>set logfile syslog</EM> is found in the control file) monit
-will use the <STRONG>syslog</STRONG> system daemon for logging messages. To
+    behavior when monit runs in daemon mode.</p>
+<p>
+</p>
+<hr />
+<h1><a name="logging">LOGGING</a></h1>
+<p>monit will log status and error messages to a log file. If
+<strong>syslog</strong> is given as a value for the <em>-l</em> option (or the
+keyword <em>set logfile syslog</em> is found in the control file) monit
+will use the <strong>syslog</strong> system daemon for logging messages. To
 turn off logging, simply do not set the logfile in the control
-file (and of course, do not use the -l switch)</P>
-<P>
-<HR>
-<H1><A NAME="daemon mode">DAEMON MODE</A></H1>
-<P>The <EM>-d interval</EM> option runs monit in daemon mode. You must
+file (and of course, do not use the -l switch)</p>
+<p>
+</p>
+<hr />
+<h1><a name="daemon_mode">DAEMON MODE</a></h1>
+<p>The <em>-d interval</em> option runs monit in daemon mode. You must
 specify a numeric argument which is a polling interval in
-seconds.</P>
-<P>In daemon mode, monit puts itself in the background and runs
+seconds.</p>
+<p>In daemon mode, monit puts itself in the background and runs
 continously, monitoring each specified program and then sleeping
-for the given polling interval.</P>
-<PRE>
-       Simply invoking</PRE>
-<PRE>
-              monit -d 300</PRE>
-<P>will poll all programs described in your <EM>~/.monitrc</EM> file every
-5 minutes.</P>
-<P>It is possible to set a polling interval in your ~/.monitrc file
-by saying 'set daemon <STRONG>n</STRONG>', where <STRONG>n</STRONG> is an 
integer number of
+for the given polling interval.</p>
+<pre>
+       Simply invoking</pre>
+<pre>
+              monit -d 300</pre>
+<p>will poll all programs described in your <em>~/.monitrc</em> file every
+5 minutes.</p>
+<p>It is possible to set a polling interval in your ~/.monitrc file
+by saying 'set daemon <strong>n</strong>', where <strong>n</strong> is an 
integer number of
 seconds.  If you do this, monit will always start in daemon mode
-(as long as no action arguments are given).</P>
-<P>Only one daemon process is permitted per user; in daemon mode,
-monit makes a per-user lockfile to guarantee this.</P>
-<P>Calling monit with a daemon in the background sends a wakeup
-signal to the daemon, forcing it to check programs immediately.</P>
-<P>The <EM>quit</EM> argument will kill a running daemon process instead
-of waking it up.</P>
-<P>If you touch or change the <EM>.monitrc</EM> file while monit is
+(as long as no action arguments are given).</p>
+<p>Only one daemon process is permitted per user; in daemon mode,
+monit makes a per-user lockfile to guarantee this.</p>
+<p>Calling monit with a daemon in the background sends a wakeup
+signal to the daemon, forcing it to check programs immediately.</p>
+<p>The <em>quit</em> argument will kill a running daemon process instead
+of waking it up.</p>
+<p>If you touch or change the <em>.monitrc</em> file while monit is
 running in daemon mode, this will be detected at the beginning of
-the next poll cycle. When a changed <EM>.monitrc</EM> is detected,
+the next poll cycle. When a changed <em>.monitrc</em> is detected,
 monit rereads it and reinitialize itself. Note also that if you
-break the <EM>.monitrc</EM> file's syntax, the monit daemon will exit
-after logging the appropriate error message.</P>
-<P>
-<HR>
-<H1><A NAME="init support">INIT SUPPORT</A></H1>
-<P>Monit can be run and controlled from <EM>init</EM>. In the (unlikely)
-case of a monit crash init will respawn a new monit process.</P>
-<P>You can use either the 'set init' statement in monit's
+break the <em>.monitrc</em> file's syntax, the monit daemon will exit
+after logging the appropriate error message.</p>
+<p>
+</p>
+<hr />
+<h1><a name="init_support">INIT SUPPORT</a></h1>
+<p>Monit can be run and controlled from <em>init</em>. In the (unlikely)
+case of a monit crash init will respawn a new monit process.</p>
+<p>You can use either the 'set init' statement in monit's
 configuration file or use the -I option from the command line.
-Here's a sample /etc/inittab entry for monit:</P>
-<PRE>
+Here's a sample /etc/inittab entry for monit:</p>
+<pre>
   # Run monit in standard runlevels
-  mo:2345:respawn:/usr/local/sbin/monit -Ic /etc/monitrc</PRE>
-<P>After you have modified init's configuration file, you can run
-the following command to re-examine /etc/inittab and start monit:</P>
-<PRE>
+  mo:2345:respawn:/usr/local/sbin/monit -Ic /etc/monitrc</pre>
+<p>After you have modified init's configuration file, you can run
+the following command to re-examine /etc/inittab and start monit:</p>
+<pre>
   telinit q 
-</PRE>
-<PRE>
-
-For systems without telinit:</PRE>
-<PRE>
-  kill -1 1</PRE>
-<P>Make sure that if you run monit from init, that you do not start
-monit in your startup scripts as well.</P>
-<P>
-<HR>
-<H1><A NAME="group support">GROUP SUPPORT</A></H1>
-<P>Program entries in the control file, <EM>monitrc</EM>, can be grouped
-together by the <EM>group</EM> statement. The syntax is simply (keyword
-in capital):</P>
-<PRE>
-  GROUP groupname</PRE>
-<P>With this statement it is possible to group similar program
+  
+For systems without telinit:</pre>
+<pre>
+  kill -1 1</pre>
+<p>Make sure that if you run monit from init, that you do not start
+monit in your startup scripts as well.</p>
+<p>
+</p>
+<hr />
+<h1><a name="group_support">GROUP SUPPORT</a></h1>
+<p>Program entries in the control file, <em>monitrc</em>, can be grouped
+together by the <em>group</em> statement. The syntax is simply (keyword
+in capital):</p>
+<pre>
+  GROUP groupname</pre>
+<p>With this statement it is possible to group similar program
 entries together and manage them as a whole. Monit provides
 functions to start, stop and restart a group of programs, like
-so:</P>
-<P>To start a group of programs:</P>
-<PRE>
-  monit -g &lt;groupname&gt; start</PRE>
-<P>To stop a group of programs:</P>
-<PRE>
-  monit -g &lt;groupname&gt; stop</PRE>
-<P>To restart a group of programs:</P>
-<PRE>
-  monit -g &lt;groupname&gt; restart</PRE>
-<P>Show the status of a program group:</P>
-<PRE>
-  monit -g &lt;groupname&gt; status</PRE>
-<P>
-<HR>
-<H1><A NAME="alert messages">ALERT MESSAGES</A></H1>
-<P>monit will send an email alert if a program timed out, if monit
+so:</p>
+<p>To start a group of programs:</p>
+<pre>
+  monit -g &lt;groupname&gt; start</pre>
+<p>To stop a group of programs:</p>
+<pre>
+  monit -g &lt;groupname&gt; stop</pre>
+<p>To restart a group of programs:</p>
+<pre>
+  monit -g &lt;groupname&gt; restart</pre>
+<p>Show the status of a program group:</p>
+<pre>
+  monit -g &lt;groupname&gt; status</pre>
+<p>
+</p>
+<hr />
+<h1><a name="monitoring_mode_selection">MONITORING MODE SELECTION</a></h1>
+<p>Monit supports three monitoring modes: active, passive and
+manual.</p>
+<p>In <em>active</em> mode, monit will monitor the program - in the
+case that the program is not running it will start/restart
+it (this is the default behaviour).</p>
+<p>In <em>passive</em> mode, monit will only monitor the service.
+Resource related restart and stop options are ignored in
+this mode as well and will only send alert.</p>
+<p>For clustered environments there is <em>manual</em> option. If it
+is defined, monit will enter <em>active</em> mode only if the
+service was started under monit's control, for example by:</p>
+<pre>
+  monit start sybase</pre>
+<p>or</p>
+<pre>
+  monit -g database start (for service group)</pre>
+<p>If the service wasn't started by monit or was stopped for
+example by:</p>
+<pre>
+  monit stop sybase</pre>
+<p>or</p>
+<pre>
+  monit -g database stop (for service group)</pre>
+<p>it woun't monitor the service at all. It allows to have
+service configured in monitrc and start it along with its
+process monitor only if it should run. It could be used for
+building simple cluster. You can use for example heartbeat
+to watch health of nodes and in the case of one machine
+failure start the service on secondary node.</p>
+<p>Appropriate scripts that can call monit to start/stop
+specific service are needed on both nodes - typical usage:</p>
+<pre>
+  FILE                    DESCRIPTION
+  -----------------------------------
+  /etc/inittab            starts monit
+  /etc/rcS.d/S41heartbeat execute &quot;monit start heartbeat&quot;
+  /etc/init.d/monit-node1 execute &quot;monit -g node1 start&quot;
+  /etc/init.d/monit-node2 execute &quot;monit -g node2 start&quot;</pre>
+<p>so hearbeat can control easy the cluster state and if one
+node fails, hearbeat starts monit-xxxxx of the failing
+node =&gt; monit is instructed to start the services of the
+failing node and monitor them...</p>
+<p>
+</p>
+<hr />
+<h1><a name="alert_messages">ALERT MESSAGES</a></h1>
+<p>monit will send an email alert if a program timed out, if monit
 restarted or stopped a program, a resource statement matches 
 (see also the section RESOURCE TESTING below) or if a checksum 
 error occurred (see also the section MD5 CHECKSUM below). More 
 than one alert statement can be used in a process entry. This 
 means that you can send different emails to different addresses.
 The full syntax for the alert statement is as follows: 
-(keywords are in capital)</P>
-<PRE>
- ALERT mail-address [{events}] [MAIL-FORMAT {mail-format}]</PRE>
-<P>Simply using:</P>
-<PRE>
- alert address@hidden</PRE>
-<P>will send a default email alert to the address address@hidden whenever a
-timeout, restart, checksum, stop or resource error occurs.</P>
-<P>If you only want an alert message sent when a certain event
+(keywords are in capital)</p>
+<pre>
+ ALERT mail-address [{events}] [MAIL-FORMAT {mail-format}]</pre>
+<p>Simply using:</p>
+<pre>
+ alert address@hidden</pre>
+<p>will send a default email alert to the address address@hidden whenever a
+timeout, restart, checksum, stop or resource error occurs.</p>
+<p>If you only want an alert message sent when a certain event
 occurs for example a timeout or when a program is restarted;
-postfix the alert-statement respectively</P>
-<PRE>
+postfix the alert-statement respectively</p>
+<pre>
  alert address@hidden only on { timeout } or
- alert address@hidden { timeout }</PRE>
-<P>(<EM>only</EM> and <EM>on</EM> are noise keywords, ignored by monit)</P>
-<P>or</P>
-<PRE>
- alert address@hidden { restart }</PRE>
-<P>The same applies for a checksum error</P>
-<PRE>
- alert address@hidden { checksum }</PRE>
-<P>It is also possible to combine events and send mail to different
-email addresses like:</P>
-<PRE>
+ alert address@hidden { timeout }</pre>
+<p>(<em>only</em> and <em>on</em> are noise keywords, ignored by monit)</p>
+<p>or</p>
+<pre>
+ alert address@hidden { restart }</pre>
+<p>The same applies for a checksum error</p>
+<pre>
+ alert address@hidden { checksum }</pre>
+<p>It is also possible to combine events and send mail to different
+email addresses like:</p>
+<pre>
  alert address@hidden { restart, timeout, resource } 
  alert address@hidden on { checksum, stop }
- alert address@hidden</PRE>
-<P>This will send an alert message to address@hidden when a timeout or
+ alert address@hidden</pre>
+<p>This will send an alert message to address@hidden when a timeout or
 restart occurs and a message to address@hidden if a checksum error
 occurs. And finally, a message to address@hidden whenever any error
 event occurs.
-</P>
-<PRE>
+</p>
+<pre>
 
-The following alert-statement:</PRE>
-<PRE>
+The following alert-statement:</pre>
+<pre>
 
- alert address@hidden { timeout, restart, checksum, resource, stop }</PRE>
-<P>is equivalent to:</P>
-<PRE>
- alert address@hidden</PRE>
-<P>which as stated above, will send a message when a timeout, a
+ alert address@hidden { timeout, restart, checksum, resource, stop }</pre>
+<p>is equivalent to:</p>
+<pre>
+ alert address@hidden</pre>
+<p>which as stated above, will send a message when a timeout, a
 restart or a checksum error occurs. (If the post fix variant is
-used, then note that the parenthesis are <EM>mandatory</EM>).</P>
-<P>A restart alert is also sent <EM>if monit fails to execute</EM> the
-start or the stop program for an entry. <STRONG>It is therefor strongly
-advised</STRONG> that at least one alert statement register interest for
-restart alerts.</P>
-<P>monit will provide a default mail message layout that is short
+used, then note that the parenthesis are <em>mandatory</em>).</p>
+<p>A restart alert is also sent <em>if monit fails to execute</em> the
+start or the stop program for an entry. <strong>It is therefor strongly
+advised</strong> that at least one alert statement register interest for
+restart alerts.</p>
+<p>monit will provide a default mail message layout that is short
 and to the point. Here's an example of a standard alert mail sent
-by monit:</P>
-<PRE>
+by monit:</p>
+<pre>
  From: address@hidden
  Subject: monit alert -- apache restarted
  To: address@hidden
- Date: Tue, 28 May 2002 20:42:30 +0200</PRE>
-<PRE>
- Program apache restarted</PRE>
-<PRE>
+ Date: Tue, 28 May 2002 20:42:30 +0200</pre>
+<pre>
+ Program apache restarted</pre>
+<pre>
         Date: Tue May 28 20:42:30 2002
-        Host: www.tildeslash.com</PRE>
-<PRE>
+        Host: www.tildeslash.com</pre>
+<pre>
  Your faithful employee,
- monit</PRE>
-<P>If you want to, you can change the format of this message with
-the optional <EM>mail-format</EM> statement. The syntax for this
-statement is as follows:</P>
-<PRE>
+ monit</pre>
+<p>If you want to, you can change the format of this message with
+the optional <em>mail-format</em> statement. The syntax for this
+statement is as follows:</p>
+<pre>
  mail-format {
       from: address@hidden
    subject: apache $EVENT at $DATE
@@ -321,401 +378,472 @@
         * Where's the DIR command?
         * Why is my &quot;rm&quot; taking so long?
         * System coming down in 0 min ...
- }</PRE>
-<P>Where the keyword <EM>from:</EM> is the email address monit should
+ }</pre>
+<p>Where the keyword <em>from:</em> is the email address monit should
 pretend it is sending from. It does not have to be a real mail
 address, but must be a proper formated mail address, on the form;
address@hidden The keyword <EM>subject:</EM> is for the email subject
-line. The subject must be on only <EM>one</EM> line. The <EM>message:</EM>
address@hidden The keyword <em>subject:</em> is for the email subject
+line. The subject must be on only <em>one</em> line. The <em>message:</em>
 keyword denotes the mail body. If used, this keyword should
 always be the last in a mail-format statement.  The mail body can
-be as long as you want and must <STRONG>not</STRONG> contain the '}' 
character.</P>
-<P>All of these format keywords are optional but you must provide at
+be as long as you want and must <strong>not</strong> contain the '}' 
character.</p>
+<p>All of these format keywords are optional but you must provide at
 least one. Thus if you only want to change the from address monit
-is using you can do:</P>
-<PRE>
- alert address@hidden with mail-format { from: address@hidden }</PRE>
-<P>From the previous example you will notice that 4 special
+is using you can do:</p>
+<pre>
+ alert address@hidden with mail-format { from: address@hidden }</pre>
+<p>From the previous example you will notice that 4 special
 variables was used. If used they will be substituted into the
-text with a special value:</P>
-<P><EM>$EVENT</EM> A string describing the event that occured. The values
+text with a special value:</p>
+<p><em>$EVENT</em> A string describing the event that occured. The values
 are fixed and are, ``restarted'', ``timed out'', ``stopped and
-''checksum error``</P>
-<P><EM>$PROGRAM</EM> The program entry name in monitrc</P>
-<P><EM>$DATE</EM> The current time and date (C time style).</P>
-<P><EM>$HOST</EM> The name of the host monit is running on</P>
-<P>
-<H2><A NAME="setting a global mail format">Setting a global mail 
format</A></H2>
-<P>Finally, it is possible to set a standard mail format with the
+''checksum error``</p>
+<p><em>$PROGRAM</em> The program entry name in monitrc</p>
+<p><em>$DATE</em> The current time and date (C time style).</p>
+<p><em>$HOST</em> The name of the host monit is running on</p>
+<p>
+</p>
+<h2><a name="setting_a_global_mail_format">Setting a global mail 
format</a></h2>
+<p>Finally, it is possible to set a standard mail format with the
 following global set-statement (keywords are in capital):
-</P>
-<PRE>
+</p>
+<pre>
 
- SET MAIL-FORMAT {mail-format}</PRE>
-<P>Format set with this statement will apply to every alert
-statement that does <EM>not</EM> have its own specified mail-format.
+ SET MAIL-FORMAT {mail-format}</pre>
+<p>Format set with this statement will apply to every alert
+statement that does <em>not</em> have its own specified mail-format.
 This statement is most usefull for setting a default from address
-for messages sent by monit, like so:</P>
-<PRE>
- set mail-format { from: address@hidden }</PRE>
-<P>
-<HR>
-<H1><A NAME="program timeout">PROGRAM TIMEOUT</A></H1>
-<P><STRONG>monit</STRONG> provides a program timeout mechanism for situations
+for messages sent by monit, like so:</p>
+<pre>
+ set mail-format { from: address@hidden }</pre>
+<p>
+</p>
+<hr />
+<h1><a name="program_timeout">PROGRAM TIMEOUT</a></h1>
+<p><strong>monit</strong> provides a program timeout mechanism for situations
 where a program simply refuses to start or respond over a longer
 period. In cases like this, and particularly if monits poll-cycle
 is low, monit will simply increase the machine load by trying to
-restart the program.</P>
-<P>The timeout mechanism monit provides is based on two variables,
+restart the program.</p>
+<p>The timeout mechanism monit provides is based on two variables,
 i.e. the number the program has been started and the number of
-poll-cycles. For example, if a program had <EM>x</EM> restarts within
-<EM>y</EM> poll-cycles (where <EM>x</EM> &lt;= <EM>y</EM>) then monit will 
timeout and
+poll-cycles. For example, if a program had <em>x</em> restarts within
+<em>y</em> poll-cycles (where <em>x</em> &lt;= <em>y</em>) then monit will 
timeout and
 not (re)start the program on the next cycle. It's a good idea to
 use the alert statement in conjunction with timeout, so if a
 timeout occurs monit will send an alert notification. A legal
 (but verbose) way to write a timeout statement for a program
-entry in the control file is:</P>
-<PRE>
- timeout if 3 restarts within 3 cycles</PRE>
-<P>The shorthand version is:</P>
-<PRE>
- timeout(3,3)</PRE>
-<P>Where the first digit is the number of program restarts, the
+entry in the control file is:</p>
+<pre>
+ timeout if 3 restarts within 3 cycles</pre>
+<p>The shorthand version is:</p>
+<pre>
+ timeout(3,3)</pre>
+<p>Where the first digit is the number of program restarts, the
 second is the number of poll-cycles. If the number of cycles was
 reached without a timeout, the program start-counter is reset to
 zero. This provides some granularity to catch expectional cases
 and do a program timeout, but to let occasional program restarts
-happen without having an accumulated timeout.</P>
-<P>If you use timeout (it's optional), then be sure to add an alert
+happen without having an accumulated timeout.</p>
+<p>If you use timeout (it's optional), then be sure to add an alert
 statement to notify the responsible administrator. Such as:
-</P>
-<PRE>
+</p>
+<pre>
 
- timeout(3, 5) and alert address@hidden on { timeout }</PRE>
-<P>To have monit check the program again after a timeout, run 'monit
+ timeout(3, 5) and alert address@hidden on { timeout }</pre>
+<p>To have monit check the program again after a timeout, run 'monit
 start program' from the command line. This will remove the
 timeout lock in the daemon and make the daemon start and check
-the program again.</P>
-<P>
-<HR>
-<H1><A NAME="resource testing">RESOURCE TESTING</A></H1>
-<P>Monit can examine how much system resources a service or the
-system is using.</P>
-<P>Depending on this indicators services can be stopped or restarted
+the program again.</p>
+<p>
+</p>
+<hr />
+<h1><a name="resource_testing">RESOURCE TESTING</a></h1>
+<p>Monit can examine how much system resources a service or the
+system is using.</p>
+<p>Depending on this indicators services can be stopped or restarted
 and alerts can be generated.  Thus it is possible to utilize
-systems which are idle and to spare system under high load.</P>
-<P>The full syntax for the resource-statements used for resource
+systems which are idle and to spare system under high load.</p>
+<p>The full syntax for the resource-statements used for resource
 testing is as follows (keywords are in capital and optional
-statements in [brackets]),</P>
-<PRE>
- resource operator value [cycles] action</PRE>
-<P><EM>resource</EM> is a choice of ``CPUUSAGE'', ``MEMUSAGE'', ``MEMKBYTE'', 
-``LOADAVG([1min|5min|15min])'':</P>
-<P>CPUUSAGE is the CPU usage of the process and it's children in
-parts of hundred (percent). This resource <EM>value</EM> is a floating
-point number. For instance, 60.0.</P>
-<P>In case the system has more then one CPU and the process has
-child processes the CPU usage can raise above 100%.</P>
-<P>MEMUSAGE is the memory usage of the process in parts of hundred
-(percent). This resource <EM>value</EM> is also a floating point
-number.</P>
-<P>MEMKBYTE is the memory amount of the process in KiB (1024
-byte). This resource <EM>value</EM> is an integer number.</P>
-<P><CODE>LOADAVG([1min|5min|15min])</CODE> refers to the system's load average.
+statements in [brackets]),</p>
+<pre>
+ resource operator value [cycles] action</pre>
+<p><em>resource</em> is a choice of ``CPUUSAGE'', ``MEMUSAGE'', ``MEMKBYTE'', 
+``LOADAVG([1min|5min|15min])'':</p>
+<p>CPUUSAGE is the CPU usage of the process and it's children in
+parts of hundred (percent). This resource <em>value</em> is a floating
+point number. For instance, 60.0.</p>
+<p>MEMUSAGE is the memory usage of the process in parts of hundred
+(percent). This resource <em>value</em> is also a floating point
+number.</p>
+<p>MEMKBYTE is the memory amount of the process in KiB (1024
+byte). This resource <em>value</em> is an integer number.</p>
+<p><code>LOADAVG([1min|5min|15min])</code> refers to the system's load average.
 The load average is the number of processes in the system run
 queue averaged over the specified time period. This resource
-<EM>value</EM> is again a floating point number.</P>
-<P><EM>operator</EM> is a choice of ``&lt;'',``&gt;'',``!='',``=='' in c 
notation, ``gt'',
+<em>value</em> is again a floating point number.</p>
+<p><em>operator</em> is a choice of ``&lt;'',``&gt;'',``!='',``=='' in c 
notation, ``gt'',
 ``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'',
-``equal'', ``notequal'' in human readable form.</P>
-<P><EM>cycles</EM> is the maximum number of cycles the expression above
-has to be true in order to start an action.  If <EM>cylces</EM> is
-omitted then it is set to one.</P>
-<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP''.</P>
-<P>ALERT sends the user a resource alert in case the maximum number
-of cycles has been reached.</P>
-<P>RESTART restarts the service in case the maximum number of cycles
-has been reached.</P>
-<P>STOP stops the service in case the maximum number of cycles has
+``equal'', ``notequal'' in human readable form.</p>
+<p><em>cycles</em> is the maximum number of cycles the expression above
+has to be true in order to start an action.  If <em>cylces</em> is
+omitted then it is set to one.</p>
+<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP''.</p>
+<p>ALERT sends the user a resource alert in case the maximum number
+of cycles has been reached.</p>
+<p>RESTART restarts the service in case the maximum number of cycles
+has been reached.</p>
+<p>STOP stops the service in case the maximum number of cycles has
 been reached. If monit stops a service it will not be checked by
 monit anymore nor restarted again later. You must explicit start
 it again from the web interface or from the console, like: 'monit
 start apache' if you want the monit daemon to monitor the service
-again.</P>
-<P>To calculate the cycles a counter is raised whenever the
+again.</p>
+<p>To calculate the cycles a counter is raised whenever the
 expression above is true and it is lowered whenever it is false
 (but not below 0).  All counters are reseted in case of a
-restart.</P>
-<P>In order to check that the CPU usage of a service is not going
+restart.</p>
+<p>In order to check that the CPU usage of a service is not going
 beyond 50% for five cycles before restarting it, the following
-expression could be used:</P>
-<PRE>
- if cpuusage is greater than 50.0 for 5 cylces then restart</PRE>
-<P>Or the short version without noise keywords:</P>
-<PRE>
- cpuusage &gt; 50.0 5 restart</PRE>
-<P>See also the example section below.</P>
-<P>
-<HR>
-<H1><A NAME="connection testing">CONNECTION TESTING</A></H1>
-<P>Monit is able to perfom connection testing via networked ports
-and via unix sockets.</P>
-<P>If a program listens on one or more sockets, monit can connect to
+expression could be used:</p>
+<pre>
+ if cpuusage is greater than 50.0 for 5 cylces then restart</pre>
+<p>Or the short version without noise keywords:</p>
+<pre>
+ cpuusage &gt; 50.0 5 restart</pre>
+<p>See also the example section below.</p>
+<p>
+</p>
+<hr />
+<h1><a name="connection_testing">CONNECTION TESTING</a></h1>
+<p>Monit is able to perfom connection testing via networked ports
+and via unix sockets.</p>
+<p>If a program listens on one or more sockets, monit can connect to
 the port (using either tcp or udp) and verify that the program
 will accept a connection and that it is possible to read and
 write to the socket. If a connection is not accepted or if there
 is a problem with the socket i|o, monit will assume that
-something is wrong and restart the program. The full syntax for
-the port-statement used for connection testing is as follows
-(keywords are in capital and optional statements in [brackets])
-for networked ports,</P>
-<PRE>
- [HOST hostname] PORT number [TYPE {TCP|UDP}] [PROTO(COL) {name} 
-  [REQUEST {&quot;/path&quot;}]]</PRE>
-<P>or for unix sockets,</P>
-<PRE>
+something is wrong and restart the program.  Additionally, if
+monit is compiled with openssl support ssl forged network
+services can be tested, too.</p>
+<p>The full syntax for the port-statement used for connection
+testing is as follows (keywords are in capital and optional
+statements in [brackets]) for networked ports,</p>
+<pre>
+ [HOST hostname] PORT number 
+         [TYPE {TCP|UDP|TCPSSL [CERTMD5 md5sum]}] 
+         [PROTO(COL) {name} [REQUEST {&quot;/path&quot;}]]</pre>
+<p>or for unix sockets,</p>
+<pre>
  UNIX(SOCKET) path [TYPE {TCP|UDP}] [PROTO(COL) {name} 
-  [REQUEST {&quot;/path&quot;}]]</PRE>
-<P>To have monit check a port connection use the following statement:</P>
-<PRE>
-  port 80</PRE>
-<P>In this case the machine in question is assumed to be
-<EM>localhost</EM> and monit will issue a tcp connection to localhost
+  [REQUEST {&quot;/path&quot;}]]</pre>
+<p>To have monit check a port connection use the following statement:</p>
+<pre>
+  port 80</pre>
+<p>In this case the machine in question is assumed to be
+<em>localhost</em> and monit will issue a tcp connection to localhost
 at port 80. Monit will use tcp by default, if you want to connect
-with udp, you can specify this after the port-statement;</P>
-<PRE>
- port 53 use type udp ('use' is a noise keyword)</PRE>
-<P>In case a server is listening to a unix socket called 
-/var/run/mysocket, the following statement can be used:</P>
-<PRE>
- unix /var/run/mysocket</PRE>
-<P>If your machine answers for several virtual hosts you can prefix
-the port statement with a host-statement like so:</P>
-<PRE>
+with udp, you can specify this after the port-statement;</p>
+<pre>
+ port 53 use type udp ('use' is a noise keyword)</pre>
+<p>The <em>TCPSSL</em> statement accepts optionally the md5 sum of the 
+server's certificate.  The md5 sum is matched against the one
+delivered by the server.  In case they do not match the 
+connection test fails.</p>
+<p>In case a server is listening to a unix socket called 
+/var/run/mysocket, the following statement can be used:</p>
+<pre>
+ unix /var/run/mysocket</pre>
+<p>If your machine answers for several virtual hosts you can prefix
+the port statement with a host-statement like so:</p>
+<pre>
  host www.sol.no     port 80
  host shop.sol.no    port 443
  host kvasir.sol.no  port 80
- host 10.2.3.4       port 80</PRE>
-<P>And as mentioned above, if you do not specify a host-statement,
-<EM>localhost</EM> is assumed.</P>
-<P>Finally, monit also knows how to speak some of the more popular
+ host 10.2.3.4       port 80</pre>
+<p>And as mentioned above, if you do not specify a host-statement,
+<em>localhost</em> is assumed.</p>
+<p>Finally, monit also knows how to speak some of the more popular
 Internet protocols. So, besides testing for connections, monit
 can also speak with the server in question to verify that the
 server works. For example, the following is used to test a http
 server:
-</P>
-<PRE>
+</p>
+<pre>
 
- host www.tildeslash.com port 80 protocol http</PRE>
-<P>At the moment monit knows how to speak <EM>HTTP</EM>, <EM>SMPT</EM>, 
<EM>FTP</EM>,
-<EM>POP</EM>, <EM>IMAP</EM> and <EM>NNTP</EM>.</P>
-<P>Some protocols also support a request statement. This statement
-can be used to ask the server for a special document entity.</P>
-<P>Currently <STRONG>only</STRONG> the <EM>HTTP</EM> protocol module supports 
the
-request statement, such as:</P>
-<PRE>
+ host www.tildeslash.com port 80 protocol http</pre>
+<p>At the moment monit knows how to speak <em>HTTP</em>, <em>SMTP</em>, 
<em>FTP</em>,
+<em>POP</em>, <em>IMAP</em> and <em>NNTP</em>. If you have compiled monit with 
ssl
+support, monit can also speak <em>HTTPS</em>, <em>FTPS</em>, <em>POPS</em> and
+<em>IMAPS</em>.</p>
+<p>Some protocols also support a request statement. This statement
+can be used to ask the server for a special document entity.</p>
+<p>Currently <strong>only</strong> the <em>HTTP</em> protocol module supports 
the
+request statement, such as:</p>
+<pre>
  host www.myhost.com port 80 protocol http 
-   request &quot;/data/show.php?a=b&amp;c=d&quot;</PRE>
-<P>The request should contain an URI string specifying a document
+   request &quot;/data/show.php?a=b&amp;c=d&quot;</pre>
+<p>The request should contain an URI string specifying a document
 from the http server. The string will be url encoded by monit
 before it sends the request to the http server, so it's okay to
-use url unsafe characters in the request.</P>
-<P>If the request statement isn't specified, the default web server
-page will be requested.</P>
-<P>It is of course possible to mix networked ports and unix sockets
-checks for a service.</P>
-<P>See also the example section below.</P>
-<P>
-<HR>
-<H1><A NAME="monit httpd">MONIT HTTPD</A></H1>
-<P>If specified in the control file, monit will start a monit daemon
+use url unsafe characters in the request.</p>
+<p>If the request statement isn't specified, the default web server
+page will be requested.</p>
+<p>It is of course possible to mix networked ports and unix sockets
+checks for a service.</p>
+<p>See also the example section below.</p>
+<p>
+</p>
+<hr />
+<h1><a name="dependency_checking">DEPENDENCY CHECKING</a></h1>
+<p>If specified in the control file, monit can do dependency
+checking before starting or stopping processes. The syntax for
+the depend statement is simply:</p>
+<pre>
+ DEPEND [process]+</pre>
+<p>Where <strong>process</strong> is a process entry name, for instance 
<strong>apache</strong>.
+You may add more than one process name in a depend statement.
+See also the example section below.</p>
+<p>Processes specified in a <em>depend</em> statement will be checked
+during stop/start operations. When a process is stopped it will
+first stop the dependant processes. Likewise, if a process is
+started, it will first stop the dependant processes, start the
+process, and then start the dependant processes.</p>
+<p>
+</p>
+<hr />
+<h1><a name="monit_httpd">MONIT HTTPD</a></h1>
+<p>If specified in the control file, monit will start a monit daemon
 with http support. From a Browser you can then start and stop
 programs as well as view the status of each program. Also, if
 monit logs to its own file, you can view the content of this
-logfile from a Browser.</P>
-<P>The control file statement for starting a monit daemon with http
-support is a global set-statement:</P>
-<PRE>
-  set httpd port 2812</PRE>
-<P>And you can use this URL, <EM><A 
HREF="http://localhost:2812/";>http://localhost:2812/</A></EM>, to access
-the daemon from a browser.</P>
-<P>The port number, in this case 2812, can be any number that you
-are allowed to bind to.</P>
-<P>If you only want the http server to accept connect requests to
+logfile in a Browser.</p>
+<p>The control file statement for starting a monit daemon with http
+support is a global set-statement:</p>
+<pre>
+  set httpd port 2812</pre>
+<p>And you can use this URL, <em><a 
href="http://localhost:2812/";>http://localhost:2812/</a></em>, to access
+the daemon from a browser.</p>
+<p>The port number, in this case 2812, can be any number that you
+are allowed to bind to.</p>
+<p>If you have compiled monit with openssl support, you can also
+start the httpd server with ssl support, using the following
+expression:</p>
+<pre>
+  set httpd port 2812 
+        ssl enable
+        pemfile /etc/certs/monit.pem</pre>
+<p>And you can use this URL, <em><a 
href="https://localhost:2812/";>https://localhost:2812/</a></em>, to access
+the monit web server over an ssl encrypted connection.</p>
+<p>The pemfile, in the example above, holds the private key and the
+certificate. This file should be stored on a safe place on the
+filesystem and should have strict permissions, that is, no more
+than 0700. For more information on how to generate this file,
+please consult README.ssl</p>
+<p>In addition, if you want to check for client certificates you can
+use the CLIENTPEMFILE statement.  In that case a connecting
+client has to have a sufficient key and certificate in order to
+connect.  This file also needs to have a necessary CA
+certificates. A configuration could look like:
+</p>
+<pre>
+
+  set httpd port 2812 
+        ssl enable
+        pemfile /etc/certs/monit.pem
+        clientpemfile /etc/certs/monit-client.pem</pre>
+<p>If you only want the http server to accept connect requests to
 one host addresses you can specify the bind address either as an
-IP number string or as a hostname. In this example we bind the
-http server to the loopback device. This means that the http
-server will only be reachable from localhost:</P>
-<PRE>
-  set httpd port 2812 and use the address 127.0.0.1</PRE>
-<P>or</P>
-<PRE>
-  set httpd port 2812 and use the address localhost</PRE>
-<P>If you do not use the ADDRESS statement the http server will
-accept connections on any/all local addresses.</P>
-<P>If you remove the httpd statement from the config file, monit will
+IP number string or as a hostname. In the following example we
+bind the http server to the loopback device. In other words the
+http server will only be reachable from localhost:</p>
+<pre>
+  set httpd port 2812 and use the address 127.0.0.1</pre>
+<p>or</p>
+<pre>
+  set httpd port 2812 and use the address localhost</pre>
+<p>or with ssl</p>
+<pre>
+  set httpd port 2812 
+      ssl enable
+      address localhost 
+      pemfile /var/certs/monit.pem</pre>
+<p>If you do not use the ADDRESS statement the http server will
+accept connections on any/all local addresses.</p>
+<p>If you remove the httpd statement from the config file, monit will
 stop the httpd server on its next cycle. Likewise if you change
 the port number, monit will restart the http server using the new
-specified port number.</P>
-<P>The status page displayed by monit is automatically refreshed
-with the same poll time set for the monit daemon.</P>
-<P><STRONG>Note:</STRONG></P>
-<P>You <EM>must</EM> start a monit daemon with http support if you want to
-be able to use the following console commands.</P>
-<PRE>
+specified port number.</p>
+<p>The status page displayed by the monit web server is
+automatically refreshed with the same poll time set for the monit
+daemon.</p>
+<p><strong>Note:</strong></p>
+<p>You <em>must</em> start a monit daemon with http support if you want to
+be able to use the following console commands.</p>
+<pre>
  'monit stop'
  'monit start program' 
  'monit stop program' 
  'monit restart program' 
  'monit -g groupname start' 
  'monit -g groupname stop' 
- 'monit -g groupname restart'</PRE>
-<P>If a monit daemon is running in the background we will ask the
+ 'monit -g groupname restart'</pre>
+<p>If a monit daemon is running in the background we will ask the
 deamon (via the HTTP protocol) to execute the above commands.
 That is, the daemon is requested to start and stop the programs.
 This ensures that a daemon will not restart a program that you
 requested to stop and that (any) timeout lock will be removed
-from a program when you start it.</P>
-<P>
-<H2><A NAME="monit httpd authentication">Monit HTTPD Authentication</A></H2>
-<P>monit supports two types of autenthication schemas for connecting
+from a program when you start it.</p>
+<p>
+</p>
+<h2><a name="monit_httpd_authentication">Monit HTTPD Authentication</a></h2>
+<p>monit supports two types of autenthication schemas for connecting
 to the httpd server. Both schemas can be used together or by
-itself.  You <STRONG>must</STRONG> choose at least one.</P>
-<P><STRONG>Host allow list</STRONG></P>
-<P>The http server maintains an access-control list of hosts allowed
+itself.  You <strong>must</strong> choose at least one.</p>
+<p><strong>Host allow list</strong></p>
+<p>The http server maintains an access-control list of hosts allowed
 to connect to the server. You can add as many hosts as you want
 to, but only hosts with a valid domain name or its IP address are
 allowed. If you specify a host that does not resolve, monit will
-write an error message in the console and not start.</P>
-<P>The http server will query a nameserver to check any hosts
+write an error message in the console and not start.</p>
+<p>The http server will query a nameserver to check any hosts
 connecting to the server. If a host (client) is trying to connect
 to the server, but cannot be found in the access list or cannot
 be resolved, the server will shutdown the connection to the
-client promptly.</P>
-<P>Control file example:</P>
-<PRE>
+client promptly.</p>
+<p>Control file example:</p>
+<pre>
   set httpd port 2812
       allow localhost
       allow my.other.work.machine.com
-      allow 10.1.1.1</PRE>
-<P><STRONG>Basic Authentication</STRONG></P>
-<P>This authentication schema is HTTP specific and described in more
-detail in RFC 2617.</P>
-<P>In short; a server challenge a client (e.g. a Browser) to send
+      allow 10.1.1.1</pre>
+<p><strong>Basic Authentication</strong></p>
+<p>This authentication schema is HTTP specific and described in more
+detail in RFC 2617.</p>
+<p>In short; a server challenge a client (e.g. a Browser) to send
 authentication information (username and password) and if
 accepted, the server will allow the client access to the
-requested document.</P>
-<P>The biggest weakness with Basic Authentication is that the
+requested document.</p>
+<p>The biggest weakness with Basic Authentication is that the
 username and password is sent in clear-text (i.e. base64 encoded)
 over the network. It is therefor recommended that you do not use
-this authentication method unless you are behind a firewall.</P>
-<P>monit will use Basic Authentication if an allow statement contains
+this authentication method unless you run the monit http server
+with <em>ssl</em> support. <strong>If</strong> you are using monit with ssl 
support
+then it is completely safe to use Basic Authentication since
+<strong>all</strong> http data, including Basic Authentication headers will be
+encrypted.</p>
+<p>monit will use Basic Authentication if an allow statement contains
 a username and password separated with a single ':' character,
-like so; <EM>allow username:password</EM>. The username and password
+like so; <em>allow username:password</em>. The username and password
 must be written in clear-text. Only one username and password
-pair is supported.</P>
-<P>If you use this method together with a host list, then only
+pair is supported.</p>
+<p>If you use this method together with a host list, then only
 clients from the listed hosts will be allowed to connect to the
 monit http server and each client will be asked to provide a
-username and password.</P>
-<P>Example:</P>
-<PRE>
+username and password.</p>
+<p>Example:</p>
+<pre>
   set httpd port 2812
       allow localhost
       allow my.other.work.machine.com
       allow 10.1.1.1
-      allow hauk:monit</PRE>
-<P>If you only want to use Basic Authentication, then just provide
-the one line with username and password, like:</P>
-<PRE>
+      allow hauk:monit</pre>
+<p>If you only want to use Basic Authentication, then just provide
+the one line with username and password, like:</p>
+<pre>
   set httpd port 2812
-      allow hauk:monit</PRE>
-<P>If you use Basic Authentication it is a good idea to set the
+      allow hauk:monit</pre>
+<p>If you use Basic Authentication it is a good idea to set the
 access permission for the control file (~/.monitrc) to only
 readable and writeable for the user running monit, because the
 password is written in clear-text. (Use this command, /bin/chmod
-600 ~/.monitrc). This is actually a good idea anyway.</P>
-<P>
-<HR>
-<H1><A NAME="md5 checksum">MD5 CHECKSUM</A></H1>
-<P>If specified in the control file, monit will compute a md5
+600 ~/.monitrc). In fact, since monit <strong>version 3.0</strong>, monit will
+complain and exit if the control file is readable by others.</p>
+<p>
+</p>
+<hr />
+<h1><a name="md5_checksum">MD5 CHECKSUM</a></h1>
+<p>If specified in the control file, monit will compute a md5
 checksum for programs. The checksum is used to verify that a
 program does not change. If a program was changed, monit will
 send an (optional) alert notification, log an alert message and
 not check the process anymore. The web interface will also show a
-checksum warning.</P>
-<P>The rationale for this feature is security and that monit does
-not start a possible cracked program or script.</P>
-<P>The full syntax for the checksum-statement is as follows:
-(keywords are in capital)</P>
-<PRE>
- CHECKSUM [file [EXPECT checksum] ]+</PRE>
-<P>A legal (but verbose) way to write a checksum statement for a
-process entry in the control file is:</P>
-<PRE>
- checksum the /usr/bin/httpd program</PRE>
-<P>The shorthand version is just:</P>
-<PRE>
- checksum /usr/bin/httpd</PRE>
-<P>Several files can be used in a checksum statement:</P>
-<PRE>
- checksum /usr/apache/bin/httpd /usr/apache-ssl/bin/httpsd</PRE>
-<P>or on a line by itself:</P>
-<PRE>
+checksum warning.</p>
+<p>The rationale for this feature is security and that monit does
+not start a possible cracked program or script.</p>
+<p>The full syntax for the checksum-statement is as follows:
+(keywords are in capital)</p>
+<pre>
+ CHECKSUM [file [EXPECT checksum] ]+</pre>
+<p>A legal (but verbose) way to write a checksum statement for a
+process entry in the control file is:</p>
+<pre>
+ checksum the /usr/bin/httpd program</pre>
+<p>The shorthand version is just:</p>
+<pre>
+ checksum /usr/bin/httpd</pre>
+<p>Several files can be used in a checksum statement:</p>
+<pre>
+ checksum /usr/apache/bin/httpd /usr/apache-ssl/bin/httpsd</pre>
+<p>or on a line by itself:</p>
+<pre>
  checksum /usr/apache/bin/httpd
- checksum /usr/apache-ssl/bin/httpsd</PRE>
-<P>You can add as many 'checksum file' statements as you want. Like
+ checksum /usr/apache-ssl/bin/httpsd</pre>
+<p>You can add as many 'checksum file' statements as you want. Like
 described above, if the checksum for a file changes, monit will
 log a warning, issue an alert message and not check the
-associated process anymore.</P>
-<P>The <EM>expect</EM> statement is optional and used to specify a md5
+associated process anymore.</p>
+<p>The <em>expect</em> statement is optional and used to specify a md5
 string monit should expect when testing a file's checksum. If
 this statement is used monit will not compute an initial checksum
 for the file, as in the examples above, but instead use the
-string you submit. For example:</P>
-<PRE>
- checksum /usr/bin/httpd expect 8f7f419955cefa0b33a2ba316cba3659</PRE>
-<P>or verbose style;</P>
-<PRE>
+string you submit. For example:</p>
+<pre>
+ checksum /usr/bin/httpd expect 8f7f419955cefa0b33a2ba316cba3659</pre>
+<p>or verbose style;</p>
+<pre>
  checksum /usr/bin/httpd and 
-   expect the sum 4e5309d1956f003bcdff168748bea647</PRE>
-<P>You can, for example, use the GNU utility <EM>md5sum</EM> to create a
+   expect the sum 4e5309d1956f003bcdff168748bea647</pre>
+<p>You can, for example, use the GNU utility <em>md5sum</em> to create a
 checksum string for a file and then use this string in the
-expect-statement.</P>
-<P>
-<HR>
-<H1><A NAME="the run control file">THE RUN CONTROL FILE</A></H1>
-<P>The preferred way to set up monit is to write a <EM>.monitrc</EM> file
+expect-statement.</p>
+<p>
+</p>
+<hr />
+<h1><a name="the_run_control_file">THE RUN CONTROL FILE</a></h1>
+<p>The preferred way to set up monit is to write a <em>.monitrc</em> file
 in your home directory.  When there is a conflict between the
 command-line arguments and the arguments in this file, the
 command-line arguments take precedence. To protect the security
 of your control file and passwords the control file must have
-permissions <EM>no more than 0700</EM> (u=xrw,g=,o=); monit will
-complain and exit otherwise.</P>
-<P>
-<H2><A NAME="run control syntax">Run Control Syntax</A></H2>
-<P>Comments begin with a '#' and extend through the end of the line.
+permissions <em>no more than 0700</em> (u=xrw,g=,o=); monit will
+complain and exit otherwise.</p>
+<p>
+</p>
+<h2><a name="run_control_syntax">Run Control Syntax</a></h2>
+<p>Comments begin with a '#' and extend through the end of the line.
 Otherwise the file consists of a series of program entries or
-global option statements in a free-format, token-oriented syntax.</P>
-<P>There are three kinds of tokens: grammar keywords, numbers (i.e.
+global option statements in a free-format, token-oriented syntax.</p>
+<p>There are three kinds of tokens: grammar keywords, numbers (i.e.
 decimal digit sequences) and strings. Strings can be either
 quoted or unquoted. A quoted string is bounded by double quotes
 and may contain whitespace (and quoted digits are treated as a
 string).  An unquoted string is any whitespace-delimited token,
-containing characters and/or numbers.</P>
-<P>Each program entry consists of the keywords `check', followed by
+containing characters and/or numbers.</p>
+<p>Each program entry consists of the keywords `check', followed by
 a unique descriptive name for the program, which is again
 followed by a path to the program's pidfile. A check entry can
 have a number of optional statements. These statements are
-described below and in the example section.</P>
-<P>You can use noise keywords like 'if', `and', `with(in)', `has',
+described below and in the example section.</p>
+<p>You can use noise keywords like 'if', `and', `with(in)', `has',
 `using', 'use', 'on(ly)' and `program' anywhere in an entry to
 make it resemble English. They're ignored, but can make entries
 much easier to read at a glance. The punctuation characters ';'
-',' and '=' are also ignored. Keywords are case insensitive.</P>
-<PRE>
- Here are the legal global keywords:</PRE>
-<PRE>
+',' and '=' are also ignored. Keywords are case insensitive.</p>
+<pre>
+ Here are the legal global keywords:</pre>
+<pre>
  Keyword         Function
  -----------------------------------------------------------
  set daemon      Set a background poll interval in seconds
@@ -732,6 +860,13 @@
                  messages emitted by monit.
  set httpd port  Activates monit http server at the given 
                  portnumber.
+ ssl enable      Enables ssl support for the httpd server.
+                 It requires the use of the pemfile statement.
+ ssl disable     Disables ssl support for the httpd server.
+                 It is equal to omitting any ssl statement.
+ pemfile         Set the pemfile to be used with ssl.
+ clientpemfile   Set the pemfile to be used when client's
+                 certificates should be checked too.
  address         If specified, the http server will only 
                  accept connect requests to this addresses
                  This statement is an optional part of the
@@ -741,10 +876,10 @@
                  a username and password allowed to connect
                  to the server. More than one allow statement
                  are allowed. This statement is also an 
-                 optional part of the set httpd statement.</PRE>
-<PRE>
- Here are the legal program entry keywords:</PRE>
-<PRE>
+                 optional part of the set httpd statement.</pre>
+<pre>
+ Here are the legal program entry keywords:</pre>
+<pre>
  Keyword         Function
  ------------------------------------------------------------
  check           Starts an entry and must be followed by a 
@@ -774,8 +909,13 @@
                  either tcp or udp.
  tcp             Specifies that monit should use a TCP 
                  socket type (stream) when testing the port.
+ tcpssl          Specifies that monit should use a TCP 
+                 socket type (stream) which is embeds a ssl
+                 connection when testing the port.
  udp             Specifies that monit should use a UDP socket
                  type (datagram) when testing the port.
+ certmd5         The md5 sum of a certificate a ssl forged 
+                 server has to deliver.
  proto(col)      This keyword specifies the type of service 
                  found at the port. monit knows at the moment 
                  how to speak HTTP, SMPT, FTP, POP and IMAP. 
@@ -817,9 +957,17 @@
                  cycle. Usefull in daemon mode when the
                  poll-cycle is short and the program takes
                  some time to start. 
- autostart       Must be followed by the keywords yes or no. 
-                 If yes, monit will restart the program if 
-                 it is not running (the default behaviour).
+ mode            Must be followed either by the keyword active,
+                 passive or manual. If active, monit will restart
+                 the program if it is not running (this is the
+                 default behaviour). If passive, monit will not
+                 (re)start the program if it is not running - it
+                 will only monitor and send alerts (resource
+                 related restart and stop options are ignored
+                 in this mode also). If manual, monit will enter
+                 active mode only if service was started under
+                 monit's control otherwise the service isn't
+                 monitored.
  cpuusage        Must be followed by a compare operator, a 
                  floating point number, optionally a maximum
                  number of cycles and an action. This statement
@@ -838,135 +986,141 @@
                  action.  This statement is used to check the
                  system load average over a number of cylces. If
                  the compare expression matches then the action 
-                 start, alert or stop is avtivated.</PRE>
-<P>Here's the complete list of reserved <STRONG>keywords</STRONG> used by 
monit:</P>
-<P><EM>set</EM>, <EM>daemon</EM>, <EM>logfile</EM>, <EM>syslog</EM>, 
<EM>address</EM>, <EM>httpd</EM>,
-<EM>allow</EM>, <EM>check</EM>, <EM>init</EM>, <EM>pidfile</EM>, 
<EM>group</EM>, <EM>start</EM>,
-<EM>stop</EM>, <EM>port(number)</EM>, <EM>unix(socket)</EM>, <EM>type</EM>,
-<EM>proto(col)</EM>, <EM>tcp</EM>, <EM>udp</EM>, <EM>alert</EM>, 
<EM>mail-format</EM>,
-<EM>restart</EM>, <EM>timeout</EM>, <EM>checksum</EM>, <EM>resource</EM>, 
<EM>expect</EM>,
-<EM>mailserver</EM>, <EM>every</EM>, <EM>autostart</EM>, <EM>yes</EM>, 
<EM>no</EM>, <EM>host</EM>,
-<EM>default</EM>, <EM>http</EM>, <EM>ftp</EM>, <EM>smtp</EM>, <EM>pop</EM>, 
<EM>nntp</EM>, <EM>imap</EM>,
-<EM>request</EM>, <EM>cpuusage</EM>, <EM>memusage</EM>, <EM>memkbyte</EM> and 
<EM>loadavg</EM>.</P>
-<P>And here is a complete list of <STRONG>noise keywords</STRONG> ignored by
-monit:</P>
-<P><EM>if</EM>, <EM>is</EM>, <EM>are</EM>, <EM>on(ly)</EM>, <EM>with(in)</EM>, 
<EM>and</EM>, <EM>has</EM>,
-<EM>using</EM>, <EM>use</EM>, <EM>the</EM>, <EM>sum</EM>, <EM>restarts</EM>, 
<EM>program(s)</EM>,
-<EM>cycle(s)</EM>, <EM>than</EM>, <EM>then</EM>, <EM>for</EM>.</P>
-<P><STRONG>Note:</STRONG> If the <EM>start</EM> or <EM>stop</EM> programs are 
shell scripts,
-then the script must begin with <CODE>#!</CODE> and the remainder of the
+                 start, alert or stop is avtivated.
+ depend          Must be followed by the name of a process that depends
+                 on the process given in the check field. This process
+                 will be stopped/started before/after the current
+                 process.</pre>
+<p>Here's the complete list of reserved <strong>keywords</strong> used by 
monit:</p>
+<p><em>set</em>, <em>daemon</em>, <em>logfile</em>, <em>syslog</em>, 
<em>address</em>, <em>httpd</em>,
+<em>ssl</em>, <em>enable</em>, <em>disable</em>, <em>pemfile</em>, 
<em>allow</em>, <em>check</em>,
+<em>init</em>, <em>pidfile</em>, <em>group</em>, <em>start</em>, <em>stop</em>,
+<em>port(number)</em>, <em>unix(socket)</em>, <em>type</em>, 
<em>proto(col)</em>, <em>tcp</em>,
+<em>tcpssl</em>, <em>udp</em>, <em>alert</em>, <em>mail-format</em>, 
<em>restart</em>,
+<em>timeout</em>, <em>checksum</em>, <em>resource</em>, <em>expect</em>, 
<em>mailserver</em>,
+<em>every</em>, <em>mode</em>, <em>active</em>, <em>passive</em>, 
<em>manual</em>, <em>host</em>,
+<em>default</em>, <em>http</em>, <em>ftp</em>, <em>smtp</em>, <em>pop</em>, 
<em>nntp</em>, <em>imap</em>,
+<em>request</em>, <em>cpuusage</em>, <em>memusage</em>, <em>memkbyte</em> and 
<em>loadavg</em>.</p>
+<p>And here is a complete list of <strong>noise keywords</strong> ignored by
+monit:</p>
+<p><em>if</em>, <em>is</em>, <em>are</em>, <em>on(ly)</em>, <em>with(in)</em>, 
<em>and</em>, <em>has</em>,
+<em>using</em>, <em>use</em>, <em>the</em>, <em>sum</em>, <em>restarts</em>, 
<em>program(s)</em>,
+<em>cycle(s)</em>, <em>than</em>, <em>then</em>, <em>for</em>.</p>
+<p><strong>Note:</strong> If the <em>start</em> or <em>stop</em> programs are 
shell scripts,
+then the script must begin with <code>#!</code> and the remainder of the
 first line must specify an interpreter for the
-program. E.g. <CODE>#!/bin/sh</CODE></P>
-<P>It's possible to write scripts directly into the <EM>start</EM> and
-<EM>stop</EM> entries by using a string of shell-commands. Like:</P>
-<PRE>
+program. E.g. <code>#!/bin/sh</code></p>
+<p>It's possible to write scripts directly into the <em>start</em> and
+<em>stop</em> entries by using a string of shell-commands. Like:</p>
+<pre>
  start: &quot;/bin/sh -c { echo $$ &gt; pidfile; exec program }&quot;
- stop:  &quot;/bin/sh -c { kill -s SIGTERM `cat pidfile` }&quot;</PRE>
-<P>
-<H2><A NAME="configuration examples">CONFIGURATION EXAMPLES</A></H2>
-<P>The simplest form is just the check statement. In this example we
-check to see if the server is running and log a message if not:</P>
-<PRE>
- check resin with pidfile /usr/local/resin/srun.pid</PRE>
-<P>To have monit start the server if it's not running, add a start
-statement:</P>
-<PRE>
+ stop:  &quot;/bin/sh -c { kill -s SIGTERM `cat pidfile` }&quot;</pre>
+<p>
+</p>
+<h2><a name="configuration_examples">CONFIGURATION EXAMPLES</a></h2>
+<p>The simplest form is just the check statement. In this example we
+check to see if the server is running and log a message if not:</p>
+<pre>
+ check resin with pidfile /usr/local/resin/srun.pid</pre>
+<p>To have monit start the server if it's not running, add a start
+statement:</p>
+<pre>
  check resin with pidfile /usr/local/resin/srun.pid
-   start program = &quot;/usr/local/resin/bin/srun.sh start&quot;</PRE>
-<P>Here's a more advanced example for monitoring an apache
+   start program = &quot;/usr/local/resin/bin/srun.sh start&quot;</pre>
+<p>Here's a more advanced example for monitoring an apache
 web-server listening on the default portnumber for HTTP and
 HTTPS. In this example monit will restart apache if it's not
 accepting connections at the portnumbers. The method monit use
 for a process restart is to first execute the stop-program, wait
 for 10 seconds (to give the program time to terminate) and then
-execute the start-program.</P>
-<PRE>
+execute the start-program.</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    start program = &quot;/etc/init.d/httpd start&quot;
    stop program  = &quot;/etc/init.d/httpd stop&quot;
    port 80   
-   port 443</PRE>
-<P>In this example we use udp for connection testing to check if the
-'named' service is running and also use timeout and alert:</P>
-<PRE>
+   port 443</pre>
+<p>In this example we use udp for connection testing to check if the
+'named' service is running and also use timeout and alert:</p>
+<pre>
  check named with pidfile /var/run/named.pid
    start program = &quot;/etc/init.d/named start&quot;
    stop program  = &quot;/etc/init.d/named stop&quot;
    port 53 use type udp
    timeout (3,5) 
-   alert address@hidden</PRE>
-<P>The following example illustrate how to check if the service
-'sophie' is answering connections on its unix domain socket:</P>
-<PRE>
+   alert address@hidden</pre>
+<p>The following example illustrate how to check if the service
+'sophie' is answering connections on its unix domain socket:</p>
+<pre>
  check sophie with pidfile /var/run/sophie.pid
    start program = &quot;/etc/init.d/sophie start&quot;
    stop  program = &quot;/etc/init.d/sophie stop&quot;
-   unix /var/run/sophie</PRE>
-<P>In this example we check an apache web-server running on
+   unix /var/run/sophie</pre>
+<p>In this example we check an apache web-server running on
 localhost that answers for several IP-based virtual hosts or
-vhosts, hence the host statement before port:</P>
-<PRE>
+vhosts, hence the host statement before port:</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    start program = &quot;/etc/init.d/httpd start&quot;
    stop program  = &quot;/etc/init.d/httpd stop&quot;
    host www.sol.no          port 80
    host shop.sol.no         port 443
    host chat.sol.no         port 80
-   host www.tildeslash.com  port 80</PRE>
-<P>In the following example we ask monit to compute and verify the
+   host www.tildeslash.com  port 80</pre>
+<p>In the following example we ask monit to compute and verify the
 checksum for the underlying apache binary used by the start and
-stop programs.</P>
-<PRE>
+stop programs.</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    start program = &quot;/etc/init.d/httpd start&quot;
    stop program  = &quot;/etc/init.d/httpd stop&quot;
    host www.tildeslash.com  port 80
-   checksum /usr/local/apache/bin/httpd</PRE>
-<P>Some servers are slow starters, like for example Java based
+   checksum /usr/local/apache/bin/httpd</pre>
+<p>Some servers are slow starters, like for example Java based
 Application Servers. So if we want to keep the poll-cycle low
 (i.e. &lt; 60 seconds) but allow some programs to take its time to
-start, the <STRONG>every</STRONG> statement is handy:</P>
-<PRE>
+start, the <strong>every</strong> statement is handy:</p>
+<pre>
  check dynamo with pidfile /etc/dynamo.pid
    start program = &quot;/etc/init.d/dynamo start&quot;
    stop program  = &quot;/etc/init.d/dynamo stop&quot;
    port 8840
-   every 2 cycle</PRE>
-<P>Here is an example where we group together two database entries.
-The autostart statement is also illustrated in the first entry and
+   every 2 cycle</pre>
+<p>Here is an example where we group together two database entries.
+The mode statement is also illustrated in the first entry and
 have the effect that monit will not try to (re)start this program
-if it is not running:</P>
-<PRE>
+if it is not running:</p>
+<pre>
  check sybase with pidfile /var/run/sybase.pid
    start program = &quot;/etc/init.d/sybase start&quot;
    stop program  = &quot;/etc/init.d/sybase stop&quot;
-   autostart no
-   group database</PRE>
-<PRE>
+   mode passive
+   group database</pre>
+<pre>
  check oracle with pidfile /var/run/oracle.pid
    start program = &quot;/etc/init.d/oracle start&quot;
    stop program  = &quot;/etc/init.d/oracle stop&quot;
-   autostart yes # Not necessary really, since this is the default
+   mode active # Not necessary really, since this is the default
    port 9001
    alert address@hidden
-   group database</PRE>
-<P>Here is an example to show the usage of the resource checks. It
+   group database</pre>
+<p>Here is an example to show the usage of the resource checks. It
 will send an alert when the CPU usage of the http daemon and it's
 child processes raises beyond 60% for over two cycles.  It is
 restarted when the CPU usage it over 80% for five cycles, the
-memory usage over 100MiBfor five cycles or the load average is
-beyond 10 for 8 cycles:</P>
-<PRE>
+memory usage over 100Mb for five cycles or the load average is
+beyond 10 for 8 cycles:</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    start program = &quot;/etc/init.d/httpd start&quot;
    stop program  = &quot;/etc/init.d/httpd stop&quot;
    if cpuusage &gt; 60.0 for 2 cycles then alert
    if cpuusage &gt; 80.0 for 5 cycles then restart
    if memkbyte &gt; 100000 for 5 cycles then stop
-   if loadavg(5min) greater than 10.0 for 8 cycles then stop</PRE>
-<P>In this example we demonstrate usage of the extended alert
-statement:</P>
-<PRE>
+   if loadavg(5min) greater than 10.0 for 8 cycles then stop</pre>
+<p>In this example we demonstrate usage of the extended alert
+statement:</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    start program = &quot;/etc/init.d/httpd start&quot;
    stop program  = &quot;/etc/init.d/httpd stop&quot;
@@ -977,15 +1131,66 @@
      with mail-format { 
               from:     address@hidden
               subject:  apache $EVENT
-              message:  This event occurred on $HOST at $DATE.</PRE>
-<PRE>
+              message:  This event occurred on $HOST at $DATE.</pre>
+<pre>
               Your faithful employee,
               monit
      }
    timeout (3, 5) 
-   group server</PRE>
-<P>Finally an example with all statements:</P>
-<PRE>
+   group server</pre>
+<p>In this example, we demonstrate usage of the depend
+statement. In this case, we want to start oracle and
+apache. However, we've set up apache to use oracle as
+a backend, and if oracle is restarted, apache must be
+restarted as well.</p>
+<pre>
+ check oracle with pidfile /var/run/oracle.pid
+   start program = &quot;/etc/init.d/oracle start&quot;
+   stop program  = &quot;/etc/init.d/oracle stop&quot;
+   port 9001
+   depend apache</pre>
+<pre>
+ check apache with pidfile /var/run/httpd.pid
+   start program = &quot;/etc/init.d/httpd start&quot;
+   stop  program = &quot;/etc/init.d/httpd stop&quot;</pre>
+<p>In the next example, we have a another program, webfoo, that
+has been added and requires that it be restarted should apache
+be restarted.</p>
+<pre>
+ check oracle with pidfile /var/run/oracle.pid
+   start program = &quot;/etc/init.d/oracle start&quot;
+   stop program  = &quot;/etc/init.d/oracle stop&quot;
+   port 9001
+   depend apache</pre>
+<pre>
+ check apache with pidfile /var/run/httpd.pid
+   start program = &quot;/etc/init.d/httpd start&quot;
+   stop  program = &quot;/etc/init.d/httpd stop&quot;
+   depend webfoo</pre>
+<pre>
+ check webfoo with pidfile /var/run/webfoo.pid
+   start program = &quot;/etc/init.d/webfoo start&quot;
+   stop  program = &quot;/etc/init.d/webfoo stop&quot;</pre>
+<p>Next, we have 2 programs oracle-import and oracle-export
+that need to be restarted if oracle is restarted, but are 
+independent of each other.</p>
+<pre>
+ check oracle with pidfile /var/run/oracle.pid
+   start program = &quot;/etc/init.d/oracle start&quot;
+   stop program  = &quot;/etc/init.d/oracle stop&quot;
+   port 9001
+   depend oracle-import
+   depend oracle-export</pre>
+<pre>
+ check oracle-import with pidfile /var/run/oracle-import.pid
+   start program = &quot;/etc/init.d/oracle-import start&quot;
+   stop  program = &quot;/etc/init.d/oracle-import stop&quot;</pre>
+<pre>
+ check oracle-export with pidfile /var/run/oracle-export.pid
+   start program = &quot;/etc/init.d/oracle-export start&quot;
+   stop  program = &quot;/etc/init.d/oracle-export stop&quot;</pre>
+<p>Finally an example with all statements:</p>
+<pre>
  check apache with pidfile /var/run/httpd.pid
    group server
    start program = &quot;/etc/init.d/httpd start&quot;
@@ -1004,69 +1209,87 @@
    alert address@hidden on { restart, timeout } with
      mail-format { from: address@hidden }
    every 2 cycles
-   autostart yes</PRE>
-<P>Note; only the <STRONG>check-</STRONG> and <STRONG>pidfile 
statement</STRONG> are mandatory,
+   mode active
+   depend webfoo</pre>
+<p>Note; only the <strong>check-</strong> and <strong>pidfile 
statement</strong> are mandatory,
 the other statements are optional and the order of the optional
-statements is not important.</P>
-<P>
-<HR>
-<H1><A NAME="files">FILES</A></H1>
-<P><EM>~/.monitrc</EM>  
-   Default run control file</P>
-<P><EM>./monitrc</EM>  
+statements is not important.</p>
+<p>
+</p>
+<hr />
+<h1><a name="files">FILES</a></h1>
+<p><em>~/.monitrc</em>  
+   Default run control file</p>
+<p><em>./monitrc</em>  
    If the control file is not found in the default 
    location, and the current working directory 
-   contains a <EM>monitrc</EM> file, this file is used 
-   instead.</P>
-<P><EM>~/.monitrc.pid</EM>
+   contains a <em>monitrc</em> file, this file is used 
+   instead.</p>
+<p><em>/etc/monitrc</em>
+   If the control file is not found in either of the
+   previous two locations, and /etc contains a
+   <em>monitrc</em> file, this file will be used instead.</p>
+<p><em>~/.monitrc.pid</em>
    Lock file to help prevent concurrent runs (non-root
-   mode).</P>
-<P><EM>/var/run/monit.pid</EM>
+   mode).</p>
+<p><em>/var/run/monit.pid</em>
    Lock file to help prevent concurrent runs (root mode,
-   Linux systems).</P>
-<P><EM>/etc/monit.pid</EM>
+   Linux systems).</p>
+<p><em>/etc/monit.pid</em>
    Lock file to help prevent concurrent runs (root mode,
-   systems without /var/run).</P>
-<P>
-<HR>
-<H1><A NAME="signals">SIGNALS</A></H1>
-<P>If a monit daemon is running, SIGUSR1 wakes it up from its sleep
+   systems without /var/run).</p>
+<p>
+</p>
+<hr />
+<h1><a name="signals">SIGNALS</a></h1>
+<p>If a monit daemon is running, SIGUSR1 wakes it up from its sleep
 phase and forces a poll of all processes. SIGTERM will gracefully
 terminate a monit daemon. This signal is sent to a monit daemon
-if monit is started with the <EM>quit</EM> action argument.</P>
-<P>Running monit in foreground while a background monit daemon is
-running will wake up the daemon.</P>
-<P>
-<HR>
-<H1><A NAME="notes">NOTES</A></H1>
-<P>This is a very silent program. Use the -v switch if you want to
-see what monit is doing, and tail -f the logfile.</P>
-<P>The syntax (and parser) of the control file is inspired by Eric
+if monit is started with the <em>quit</em> action argument.</p>
+<p>Running monit in foreground while a background monit daemon is
+running will wake up the daemon.</p>
+<p>
+</p>
+<hr />
+<h1><a name="notes">NOTES</a></h1>
+<p>This is a very silent program. Use the -v switch if you want to
+see what monit is doing, and tail -f the logfile.</p>
+<p>The syntax (and parser) of the control file is inspired by Eric
 S. Raymond et al. excellent fetchmail program. Some portions of
 this man page does also receive inspiration from the same
-authors.</P>
-<P>
-<HR>
-<H1><A NAME="authors">AUTHORS</A></H1>
-<P>Jan-Henrik Haukeland &lt;<A 
HREF="mailto:address@hidden";>address@hidden</A>&gt;, 
-Martin Pala &lt;<A HREF="mailto:address@hidden";>address@hidden</A>&gt;, 
-Christian Hopp &lt;<A HREF="mailto:address@hidden";>address@hidden</A>&gt;, 
-Rory Toma &lt;<A HREF="mailto:address@hidden";>address@hidden</A>&gt;, 
-Thomas Oppel &lt;<A HREF="mailto:address@hidden";>address@hidden</A>&gt;</P>
-<P>See also <A 
HREF="http://www.tildeslash.com/monit/who.html";>http://www.tildeslash.com/monit/who.html</A></P>
-<P>
-<HR>
-<H1><A NAME="copyright">COPYRIGHT</A></H1>
-<P>Copyright (C) 2000-2002 by Contributors to the monit codebase. All
+authors.</p>
+<p>
+</p>
+<hr />
+<h1><a name="authors">AUTHORS</a></h1>
+<p>Jan-Henrik Haukeland &lt;<a 
href="mailto:address@hidden";>address@hidden</a>&gt;, 
+Martin Pala &lt;<a href="mailto:address@hidden";>address@hidden</a>&gt;, 
+Christian Hopp &lt;<a href="mailto:address@hidden";>address@hidden</a>&gt;, 
+Rory Toma &lt;<a href="mailto:address@hidden";>address@hidden</a>&gt;, 
+Thomas Oppel &lt;<a href="mailto:address@hidden";>address@hidden</a>&gt;</p>
+<p>See also <a 
href="http://www.tildeslash.com/monit/who.html";>http://www.tildeslash.com/monit/who.html</a>
+
+</p>
+<p>
+</p>
+<hr />
+<h1><a name="copyright">COPYRIGHT</a></h1>
+<p>Copyright (C) 2000-2002 by Contributors to the monit codebase. All
 Rights Reserved. This product is distributed in the hope that it
 will be useful, but WITHOUT any warranty; without even the
 implied warranty of MERCHANTABILITY or FITNESS for a particular
-purpose.</P>
-<P>
-<HR>
-<H1><A NAME="see also">SEE ALSO</A></H1>
-<P>GNU text utilities;  <CODE>md5sum(1)</CODE></P>
+purpose.
+
+</p>
+<p>
+</p>
+<hr />
+<h1><a name="see_also">SEE ALSO</a></h1>
+<p>GNU text utilities;  <code>md5sum(1)</code>
+ 
+
+</p>
 
-</BODY>
+</body>
 
-</HTML>
+</html>

reply via email to

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