@@ -2,6 +2,8 @@
## Monit control file
###############################################################################
##
+## This file, and every file it includes, must be saved as UTF-8.
+##
## 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 '/'.
##
@@ -21,9 +23,8 @@ set daemon 60 # check services at 1-minute intervals
# # 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 syslog logging. If you want to log to a standalone log file instead,
+## specify the full path to the log file
#
set log syslog facility log_daemon
#
@@ -47,10 +48,37 @@ set idfile /var/lib/monit/id
#
set statefile /var/lib/monit/state
#
+#
+
+## Set limits for various tests. The following example shows the default values:
+##
+# set limits {
+# programOutput: 512 B, # check program's output truncate limit
+# sendExpectBuffer: 256 B, # limit for send/expect protocol test
+# fileContentBuffer: 512 B, # limit for file content test
+# httpContentBuffer: 1 MB, # limit for HTTP content test
+# networkTimeout: 5 seconds # timeout for network I/O
+# programTimeout: 300 seconds # timeout for check program
+# stopTimeout: 30 seconds # timeout for service stop
+# startTimeout: 30 seconds # timeout for service start
+# restartTimeout: 30 seconds # timeout for service restart
+# # execTimeout: 20 seconds # timeout for test action exec (no limit by default)
+# shutdownTimeout: 10 seconds # shutdown timeout when Monit is PID 1
+# }
+
+## Set global SSL options (just most common options showed, see manual for
+## full list).
+#
+# set ssl {
+# verify : enable, # verify SSL certificates (disabled by default but STRONGLY RECOMMENDED)
+# selfsigned : allow # allow self signed SSL certificates (reject by default)
+# }
+#
+#
## Set the list of mail servers for alert delivery. Multiple servers may be
## specified using a comma separator. If the first mail server fails, Monit
-# will use the second mail server in the list and so on. By default Monit uses
-# port 25 - it is possible to override this with the PORT option.
+## will use the second mail server in the list and so on. By default Monit uses
+## port 25 - it is possible to override this with the PORT option.
#
# set mailserver mail.bar.baz, # primary mailserver
# backup.bar.baz port 10025, # backup mailserver on port 10025
@@ -69,23 +97,29 @@ set eventqueue
slots 100 # optionally limit the queue size
#
#
-## Send status and events to M/Monit (for more informations about M/Monit
-## see http://mmonit.com/). By default Monit registers credentials with
+## Send status and events to M/Monit (for more information about M/Monit
+## see https://mmonit.com/). By default Monit registers credentials with
## M/Monit so M/Monit can smoothly communicate back to Monit and you don't
## have to register Monit credentials manually in M/Monit. It is possible to
## disable credential registration using the commented out option below.
## Though, if safety is a concern we recommend instead using https when
-## communicating with M/Monit and send credentials encrypted.
+## communicating with M/Monit and send credentials encrypted. The password
+## should be URL encoded if it contains URL-significant characters like
+## ":", "?", "@". Default timeout is 5 seconds, you can customize it by
+## adding the timeout option.
#
-# set mmonit http://monit:monit@192.168.1.10:8080/collector
-# # and register without credentials # Don't register credentials
+# set mmonit
+# http://monit:monit@192.168.1.10:8080/collector
+# # with timeout 30 seconds # Default timeout is 5 seconds
+# # and register without credentials # Don't register credentials
+# # with hostgroups [ "Virtual machines", Web ] # Member of M/Monit hostgroup
#
#
-## Monit by default uses the following format for alerts if the the mail-format
+## Monit by default uses the following format for alerts if the mail-format
## statement is missing::
## --8<--
## set mail-format {
-## from: monit@$HOST
+## from: Monit <monit@$HOST>
## subject: monit alert -- $EVENT $SERVICE
## message: $EVENT Service $SERVICE
## Date: $DATE
@@ -102,7 +136,7 @@ set eventqueue
## or sender using the MAIL-FORMAT statement. Macros such as $DATE, etc.
## are expanded at runtime. For example, to override the sender, use:
#
-# set mail-format { from: monit@foo.bar }a
+# set mail-format { from: monit@foo.bar }
#
#
## You can set alert recipients whom will receive alerts if/when a
@@ -110,21 +144,34 @@ set eventqueue
## events by using a filter as in the second example below.
#
# set alert sysadm@foo.bar # receive all alerts
-## Do not alert when Monit start, stop or perform a user initiated action.
-## This filter is recommended to avoid getting alerts for trivial cases
+#
+## Do not alert when Monit starts, stops or performs a user initiated action.
+## This filter is recommended to avoid getting alerts for trivial cases.
+#
# set alert your-name@your.domain not on { instance, action }
#
#
-## Monit has an embedded web server which can be used to view status of
-## services monitored and manage services from a web interface. See the
-## Monit Wiki if you want to enable SSL for the web server.
+## Monit has an embedded HTTP interface which can be used to view status of
+## services monitored and manage services from a web interface. The HTTP
+## interface is also required if you want to issue Monit commands from the
+## command line, such as 'monit status' or 'monit restart service' The reason
+## for this is that the Monit client uses the HTTP interface to send these
+## commands to a running Monit daemon. See the Monit Wiki if you want to
+## enable SSL for the HTTP interface.
#
set httpd port 2812 and
- use address localhost # only accept connection from localhost
+ use address localhost # only accept connection from localhost (drop if you use M/Monit)
allow localhost # allow localhost to connect to the server and
-# allow admin:monit # require user 'admin' with password 'monit'
-# allow @monit # allow users of group 'monit' to connect (rw)
-# allow @users readonly # allow users of group 'users' to connect readonly
+ allow admin:monit # require user 'admin' with password 'monit'
+ #with ssl { # enable SSL/TLS and set path to server certificate
+ # pemfile: /etc/ssl/certs/monit.pem
+ #}
+#
+## Monit can perform act differently regarding services previous state when
+## going back in duty. By default, Monit will 'start' all services. Monit can
+## also takes no action to start services in 'nostart' mode. Monit can try to
+## restore the 'laststate' of the service when Monit was shutdown.
+# set onreboot start # start, nostart, laststart
###############################################################################
## Services
@@ -134,14 +181,13 @@ set httpd port 2812 and
## usage. Each test specifies a resource, conditions and the action to be
## performed should a test fail.
#
-# check system myhost.mydomain.tld
-# if loadavg (1min) > 4 then alert
-# if loadavg (5min) > 2 then alert
+# check system $HOST
+# if loadavg (1min) per core > 2 for 5 cycles then alert
+# if loadavg (5min) per core > 1.5 for 10 cycles then alert
+# if cpu usage > 95% for 10 cycles then alert
# if memory usage > 75% then alert
# if swap usage > 25% then alert
-# if cpu usage (user) > 70% then alert
-# if cpu usage (system) > 30% then alert
-# if cpu usage (wait) > 20% then alert
+# if pageout > 100 per second for 10 cycles then alert
#
#
## Check if a file exists, checksum, permissions, uid and gid. In addition
@@ -154,10 +200,10 @@ set httpd port 2812 and
# if failed checksum and
# expect the sum 8f7f419955cefa0b33a2ba316cba3659 then unmonitor
# if failed permission 755 then unmonitor
-# if failed uid root then unmonitor
-# if failed gid root then unmonitor
+# if failed uid "root" then unmonitor
+# if failed gid "root" then unmonitor
# alert security@foo.bar on {
-# checksum, permission, uid, gid, unmonitor
+# checksum, permission, uid, gid
# } with the mail-format { subject: Alarm! }
# group server
#
@@ -177,33 +223,35 @@ set httpd port 2812 and
# if cpu > 80% for 5 cycles then restart
# if totalmem > 200.0 MB for 5 cycles then restart
# if children > 250 then restart
-# if loadavg(5min) greater than 10 for 8 cycles then stop
-# if failed host www.tildeslash.com port 80 protocol http
-# and request "/somefile.html"
-# then restart
-# if failed port 443 type tcpssl protocol http
-# with timeout 15 seconds
-# then restart
-# if 3 restarts within 5 cycles then timeout
+# if disk read > 500 kb/s for 10 cycles then alert
+# if disk write > 500 kb/s for 10 cycles then alert
+# if failed host www.tildeslash.com port 80 protocol http and request "/somefile.html" then restart
+# if failed port 443 protocol https with timeout 15 seconds then restart
+# if 3 restarts within 5 cycles then unmonitor
# depends on apache_bin
# group server
#
#
-## Check filesystem permissions, uid, gid, space and inode usage. Other services,
-## such as databases, may depend on this resource and an automatically graceful
-## stop may be cascaded to them before the filesystem will become full and data
+## Check filesystem permissions, uid, gid, space usage, inode usage and disk I/O.
+## Other services, such as databases, may depend on this resource and an automatically
+## graceful stop may be cascaded to them before the filesystem will become full and data
## lost.
#
# check filesystem datafs with path /dev/sdb1
# start program = "/bin/mount /data"
# stop program = "/bin/umount /data"
# if failed permission 660 then unmonitor
-# if failed uid root then unmonitor
-# if failed gid disk then unmonitor
+# if failed uid "root" then unmonitor
+# if failed gid "disk" then unmonitor
# if space usage > 80% for 5 times within 15 cycles then alert
# if space usage > 99% then stop
# if inode usage > 30000 then alert
# if inode usage > 99% then stop
+# if read rate > 1 MB/s for 5 cycles then alert
+# if read rate > 500 operations/s for 5 cycles then alert
+# if write rate > 1 MB/s for 5 cycles then alert
+# if write rate > 500 operations/s for 5 cycles then alert
+# if service time > 10 milliseconds for 3 times within 5 cycles then alert
# group server
#
#
@@ -213,8 +261,8 @@ set httpd port 2812 and
#
# check file database with path /data/mydatabase.db
# if failed permission 700 then alert
-# if failed uid data then alert
-# if failed gid data then alert
+# if failed uid "data" then alert
+# if failed gid "data" then alert
# if timestamp > 15 minutes then alert
# if size > 100 MB then exec "/my/cleanup/script" as uid dba and gid dba
#
@@ -234,13 +282,31 @@ set httpd port 2812 and
## connection to a port and an application level network check is performed.
#
# check host myserver with address 192.168.1.1
-# if failed icmp type echo count 3 with timeout 3 seconds then alert
+# if failed ping then alert
# if failed port 3306 protocol mysql with timeout 15 seconds then alert
# if failed port 80 protocol http
-# and request /monit/ with content = "Monit [0-9.]+ Download"
+# and request /some/path with content = "a string"
# then alert
#
#
+## Check a network link status (up/down), link capacity changes, saturation
+## and bandwidth usage.
+#
+# check network public with interface eth0
+# if link down then alert
+# if changed link then alert
+# if saturation > 90% then alert
+# if download > 10 MB/s then alert
+# if total uploaded > 1 GB in last hour then alert
+#
+#
+## Check custom program status output.
+#
+# check program myscript with path /usr/local/bin/myscript.sh
+# if status != 0 then alert
+# if content changed then alert
+#
+#
###############################################################################
## Includes
###############################################################################
@@ -1,10 +1,11 @@
etc/monit.d
etc/monitrc
-usr/bin/monit
-#usr/share/man/man1/monit.1
-var/lib/monit
-var/ipfire/backup/addons/includes/monit
etc/rc.d/init.d/monit
etc/rc.d/rc0.d/K40monit
etc/rc.d/rc3.d/S60monit
etc/rc.d/rc6.d/K40monit
+usr/bin/monit
+#usr/share/bash-completion/completions/monit.bash
+#usr/share/man/man1/monit.1
+var/ipfire/backup/addons/includes/monit
+var/lib/monit
@@ -24,7 +24,7 @@
include Config
-VER = 6.0.0
+VER = 6.1.0
SUMMARY = Utility for monitoring services on a Unix system
THISAPP = monit-$(VER)
@@ -33,7 +33,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = monit
-PAK_VER = 31
+PAK_VER = 32
DEPS =
@@ -47,7 +47,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_BLAKE2 = 45202fa13503e485a72267fc22115427155095d5fbc3d289fa6b9a9861d37d2f05b5fef7906b9a6c2d7a286b75055a0d8462407761e7a3e1cc385205a398e2f9
+$(DL_FILE)_BLAKE2 = 452551d08ce2c929b0110091a62730e38a859e30b9e5808370caa7cda914e6f4aae09b1149b20e88dcf63396b11292c263eccf748a05c49dc04ad9aa656b62d0
install : $(TARGET)