###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For 
## information about the control file and a complete list of statements and 
## options, please have a look in the Monit manual.
##
##
###############################################################################
## Global section
###############################################################################
##
#
# run from init
set init
#if "set init" don't run as daemon. "set daemon" only specify interval
set daemon  10              # check services at 10 seconds intervals,
#   with start delay 240    # optional: delay the first check by 4-minutes (by 
#                           # default Monit check immediately after Monit start)
#
#
## Set syslog logging with the 'daemon' facility. If the FACILITY option is
## omitted, Monit will use 'user' facility by default. If you want to log to 
## a standalone log file instead, specify the full path to the log file
#
# set logfile syslog facility log_daemon                       
#
#
## Set the location of the Monit lock file which stores the process id of the
## running Monit instance. By default this file is stored in $HOME/.monit.pid
#
set pidfile /var/run/monit.pid
#
## Set the location of the Monit id file which stores the unique id for the
## Monit instance. The id is generated and stored on first Monit start. By 
## default the file is placed in $HOME/.monit.id.
#
set idfile /var/monit/monit.id
#
## Set the location of the Monit state file which saves monitoring states
## on each cycle. By default the file is placed in $HOME/.monit.state. If
## the state file is stored on a persistent filesystem, Monit will recover
## the monitoring state across reboots. If it is on temporary filesystem, the
## state will be lost on reboot which may be convenient in some situations.
#
# We don't want to propagate monit's state over restarts. Otherwise following
# scenario is possible:
# --exceeded number of application restarts/crashes within given time
# --system restart due to above
# --application restart/crash again
# --monit will include application restart/crash after system restart in
# previous countings, so will trigger another restart
# We don't want to save monit's state over reboots, keep state file it in tmp
set statefile /tmp/monit.state

###############################################################################
## Includes
###############################################################################
##
## It is possible to include additional configuration parts from other files or
## directories.
#
include /etc/monit.d/*.conf
#
# enable Monit CLI to start and stop services, disable or enable service
# monitoring as well as view the status of each service.
# use socket instead of TCP to prevent access from outside switch
set httpd unixsocket /var/run/monit.sock allow root:root
