From patchwork Thu Nov 19 23:07:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 10790 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4jVvKf18Qmz3wgx for ; Thu, 19 Nov 2026 23:08:54 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE2" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jVvKX39Dyz6bN for ; Thu, 19 Nov 2026 23:08:48 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jVvKX2Kkkz2xV5 for ; Thu, 19 Nov 2026 23:08:48 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jVvKT516Lz2xMg for ; Thu, 19 Nov 2026 23:08:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4jVvKS44Ftz6bM; Thu, 19 Nov 2026 23:08:44 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1795129724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QuK8ks00K8PXaBOgY3VeluXZN9ygIomwrxbncHKr5Yo=; b=ESLXz4nnfhXx/QbaSUpcUr2/40R8K+2VZbndY9ROl/mgoryz4pBbxREGyEhlu917vQnaFB V9OoxICj6sdbFyCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1795129724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=QuK8ks00K8PXaBOgY3VeluXZN9ygIomwrxbncHKr5Yo=; b=be5eQDxKmXRCpPTThwkF9drgsW+TsuxZM7wlJtS2orVR9fe4xz1lwsaLqbFX1xeotdjcDw kGXLWU/bwJ0W4euTA787dipmelslnLP/TaU6AAC1nvagkaaDVsSa5VBVV3urwATR7Qr1vk nNus0gTqsDp8VQQOI1X0voaj6hBoTHkxIDdcKTyXZdvXyYV+uLe5ZJX+GsgkEhwGpYB57G ec1m0fbBpchGMjRX4ugHN9I3oT1EoE5KgDjVIJBScVw3D/LdkSxtQk3jGkx0sKtWk/Ziwo GrnwKGfY2LJiiCx31q0D6uTgasENwgcVGTVwrJhjrH2kFWDa5aCWJ0FdAvFZpw== From: Matthias Fischer To: development@lists.ipfire.org Cc: Matthias Fischer Subject: [PATCH] monit: Update to 6.1.0 Date: Fri, 20 Nov 2026 00:07:37 +0100 Message-ID: <20261119230835.3167517-1-matthias.fischer@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Changelog is too long to be published here, for details see: https://mmonit.com/monit/changes/ Please note: Updated rootfile, 'monitrc' needed to be updated too due to incompatible changes: "All outgoing SSL connections now verify the remote hosts's SSL certificate. ... You can configure Monit to allow self-signed certificates or ro disable certificate verification." Furthermore... "The control file (monitrc) and every file it includes must be saved as UTF-8." And "The poll time must be between 1 and 3600 seconds. Before, it could be up to a year." And last but not least, v6.1.0 contains a large number of fixes. Too many to list them all. Signed-off-by: Matthias Fischer --- config/monit/monitrc | 162 ++++++++++++++++++++++---------- config/rootfiles/packages/monit | 9 +- lfs/monit | 6 +- 3 files changed, 122 insertions(+), 55 deletions(-) diff --git a/config/monit/monitrc b/config/monit/monitrc index e67507ba0..51ab07dba 100644 --- a/config/monit/monitrc +++ b/config/monit/monitrc @@ -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 ## 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 ############################################################################### diff --git a/config/rootfiles/packages/monit b/config/rootfiles/packages/monit index a375f848f..26d827ba4 100644 --- a/config/rootfiles/packages/monit +++ b/config/rootfiles/packages/monit @@ -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 diff --git a/lfs/monit b/lfs/monit index b0b6740a2..019f6b087 100644 --- a/lfs/monit +++ b/lfs/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)