# Monit control file
#
# Comments begin with a '#' and extend through the end of the line.
# Blank lines between program entries are ignored. Keywords are case 
# insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'
#
# Legal keywords are
#   check          -- Must be followed by a descriptive name for the 
#                     program.
#                    
#   pidfile        -- Must be followed by a path to the programs pidfile.
#                     Such a file should contain only one entry, a number
#                     representing the process's pid. (See the apache pid 
#                     file for an example)
#
#   group          -- Must be followed by a descriptive name for a process
#                     group. This statement can be used to group together
#                     several processes. Monit can start/stop/restart a
#                     group of processes.
#                    
#   start          -- Must be followed by a full path to a program for
#                     starting the process. If you need to specify arguments
#                     to the program, enclose the program and arguments in
#                     quotes - like: "/local/bin/program -i start".
#                     This entry is optional.
#
#   stop           -- Must be followed by a full path to a program for
#                     stopping the process. If you need to specify arguments
#                     to the program, enclose the program and arguments in
#                     quotes - like: "/local/bin/program -i stop".
#                     This entry is optional.
#
#   host           -- Specify a hostname or ip-address to test port 
#                     connection at. This statement must be followed by a
#                     port statement.
#
#   port(number)   -- Must be followed by an integer representing a portnumber.
#                     The monit program will try to connect to this port to
#                     to verify that there is a server listening behind the 
#                     portnumber. If the connection fails the default action
#                     is to write a notification into the logfile and to 
#                     restart the process. This entry is optional.
#
#   unix(socket)   -- Must be followed by a string representing a pathname.
#                     The monit program will try to connect to this socket to
#                     to verify that there is a server listening behind the 
#                     unix socket. If the connection fails the default action
#                     is to write a notification into the logfile and to 
#                     restart the process. This entry is optional.
#
#   type           -- Must be followed by the keyword udp or tcp. This keyword
#                     specifies the type of socket the monit program should 
#                     use when testing connection to the portnumber. If the
#                     type keyword is omitted, tcp is used.
#
#   tcp            -- Specifies that monit should use a TCP socket type
#                     (Stream socket) when testing the port 
#
#   tcpssl         -- Specifies that monit should use a TCP 
#                     socket type (Stream socket) which is embeds a ssl
#                     connection when testing the port.
#
#   certmd5        -- The md5 sum of a certificate a ssl forged 
#                     server has to deliver.
#
#   udp            -- Specifies that monit should use a UDP socket type
#                     (datagram socket) when testing the port 
#
#   protocol       -- Must be followed by a protocol keyword. This keyword
#                     specifies the type of service found at the port.
#                     monit knows at the moment how to speak HTTP, SMTP, 
#                     FTP, POP, IMAP, NNTP, SSH, DWP, LDAP2 and LDAP3.
#		      You're welcome to write new protocol test modules. If
#		      no protocol is specified monit will use a default test
#		      which in most cases is good enough. This statement is
#		      optional.
#
#   request        -- Must be followed by URI string specifying a document
#                     from the http server. Currently only the HTTP protocol
#                     module supports the request statement, such as:
#                     "/data/show.php?a=b&c=d"
#                       
#   timeout        -- Must be followed by two integers where the first
#                     number is max restart and the second the number of 
#                     poll-cycles. This statement is optional.
#
#   alert          -- Specifies an email address for notification if a 
#                     process timed out or restarted. This statement is 
#                     optional. More than one alert statement is allowed.
#
#   checksum       -- Must be followed by a list of files with an absolute 
#                     path. This statement is optional. More than one 
#                     checksum statement is allowed.
#   
#   expect         -- Specify a md5 string digest monit should expect when
#                     testing a particular file's checksum. This statement is
#                     an optional part of the checksum statement.
#
#   timestamp      -- Must be followed by a file or directory with an
#		      absolute path, compare operator, number, optional time
#		      unit and action. This statement is optional. More than
#                     one timestamp statement is allowed.
#   
#   every          -- Only check the program at every n cycles. Optional.
#
#   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
#                     and an action.  This statement is used to check the
#                     cpu usage in percent of a process with it's children 
#                     over a number of cylces.  If the compare expression 
#                     matches the action (restart, alert or stop) is used.
#
#   memusage       -- The equivalent to cpuusage for memory of a process 
#                     (w/o children!).  The syntax is the same
#   
#   memkbyte       -- The equivalent to memusage but with amounts instead
#                     of percentages.
#   
#   loadavg        -- Must be followed by [1min,5min,15min] in (), a compare 
#                     operator, a floating point number, optionally a 
#                     maximum number of cycles and an action.  This statement
#                     is used to check the system load average over a number
#                     of cylces.  If the compare expression matches the action
#                     (restart, alert or stop) is used.
#
#   depends	   -- Must be followed by the name of a process or a list of 
#                     processes *this* process depends on to run
#                     before it starts. The list of depend processes
#                     will be stopped before the current process is started 
#                     and started again after.
#   
# Legal global option statements are
#
#   set daemon     -- Must be followed by a number (in seconds)
#
#   set init       -- If specified, do not background monit. This allows 
#		      init to control and restart monit. To work properly,
#		      modification of /etc/inittab is required.
#                     (see FAQ.txt for details)
#
#   set logfile    -- Must be followed by either a filename (full path is
#                     required) or the string 'syslog'. 
#
#   set pidfile    -- Must be followed by either a filename (full path is
#                     required).
#
#   set mailserver -- Must be followed by a mailserver hostname. If the 
#                     mailserver is not defined, monit will try to use 
#                     'localhost' as the smtp-server for sending mail 
#                     notification.
# 
#   set mail-format - Must be followed by a mail format list containing at 
#                     least one of the keywords; from: subject: or message:
#
#   set httpd port -- Must be followed by a portnumber for the monit http
#                     server.
#
#   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.
#
#   address        -- If specified, the http server will only accept connect
#                     requests to this addresses This statement is an optional
#                     part of the set httpd statement.
#   
#   pemfile        -- Specifies the file with the private key and the 
#                     certificate for ssl support
#
#   allow          -- Specify a hostnames or IP addresses allowed to connect
#                     to the http server (one allow statement per host)
#         and/or
#   allow          -- Specify a username:password in clear text for 
#                     connecting to monit httpd
#
#
# The noise keywords `if', `and', `the', `with', `has', `using', `use', 
# `on(ly)', `for',  `than`, `then` and `program(s)' are ignored anywhere 
# in an entry; they can be used to make  it resemble English.  The 
# punctuation characters `,' `;' and '=' are also ignored. 
#
#
# Here's an example for monitoring an apache web-server on port
# HTTP and HTTPS and a Sybase Database Server:
#
# [NB! Check and edit for your system and uncomment below]
#
# set daemon  120           # Poll at 2-minute intervals
# set logfile syslog        # Set syslog as the logfile 
# set mailserver localhost  # Use localhost as the smtp server 
# set mail-format           # Set a default mail from address for
#  { from: monit@foo.bar }  # all alert messages emitted by monit
# set httpd port 2812 and   # Make monit start it's web-server
#     use address localhost # and only accept connection from localhost
#     allow localhost       # allow localhost to connect to the server and
#     allow hauk:monit      # user 'hauk' with password 'monit'
#
#  check apache with pidfile /usr/local/apache/logs/httpd.pid
#    start program = "/etc/init.d/httpd start"
#    stop program  = "/etc/init.d/httpd stop"
#    host www.tildeslash.com port 80 protocol http
#        and request "/monit/next.html"
#    # Testing a http ssl server requires that monit was compiled with openssl
#    port 443 type tcpssl proto http 
#    checksum /usr/local/apache/bin/httpd 
#      and expect the sum 8f7f419955cefa0b33a2ba316cba3659
#    alert security@foo.bar on { checksum } 
#        with the mail-format { subject: Alarm! }
#    alert sysadm@foo.bar
#    timeout(3, 5)
#    group server
#    if cpuusage is greater than 60.0 for 2 cycles then alert
#    if cpuusage > 80.0 5 restart
#    if memkbyte > 100000.0 for 5 cycles then stop
#    if loadavg(5min) greater than 10 for 8 cycles then stop
#    depends on sybase
#    
#
#  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 foo@bar
#    group database
