This page summaries changes made in Monit since version 5.34.0. Please see the commit log for a detailed list of changes and commits leading up to the various releases below. Use the issue tracker to report new issues or feature requests
cp monitrc monitrc.old iconv -f ISO-8859-1 -t UTF-8 monitrc.old > monitrc
check filesystem data with path /data
every "0 3 * * *"
set alert foo@bar but not on { cpu, loadavg1m, atime }
An old keyword still covers its whole group. For example, resource also covers
space and inode usage. The manual lists the event types under Setting an event filter.
check network eth0 with interface eth0
if link down then restart
if link errors for 3 cycles then alert
set limits { shutdownTimeout: 30 s }
Give the container the same stop timeout, so the runtime does not kill Monit first. In Docker
that is docker stop -t 30. Docker Compose has stop_grace_period, and
Kubernetes has terminationGracePeriodSeconds.
check program weekly_report with path /var/monit/weekly_report.sh
every "15 8 * * 1"
if status != 0 then alert
This will run the above weekly_report.sh one time every Monday at 08:15 (or as soon as possible after
that time if the validation loop is delayed). Cron matching is asynchronous to the validation loop,
ensuring checks run once even if validate takes longer than a minute to complete. This fixes the issue
where checks with an every statement could be skipped entirely due to misalignment with poll
cycle settings or validation loop delays.
check file myfile with path /path/to/file
if failed sha256 checksum then alert
check host example.com with address example.com
if failed port 443 protocol https
certificate checksum = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
then alert
0 pages/sec: Healthy 1-10 pages/sec: Minor paging, usually acceptable >100 pages/sec sustained: Memory pressure, investigate >1000 pages/sec: Severe thrashing, immediate action neededExample:
if pageout > 50 per second for 20 cycles then alert if pageout > 100 per second for 10 cycles then alertThanks to Lutz Mader for patch.
IF SECURITY ATTRIBUTE <"="|"!="|"=~"|"!=~"> <regex> THEN <action>
filedescriptors 4896 [0.0% of 9223372036854775807 limit]
X-Auto-Response-Suppress: All Precedence: Bulk
failed to get service dataThe service status displayed the process as OK but showed no process statistics.
'myservice' error -- unknown resource ID: [5]
AssertException: n >= 0 raised in Str_ndup at src/util/Str.c:315 Aborted
AssertException: n < 5 && n >= 0 raised in Time_incron at src/system/Time.c:1566 Aborted
AssertException: timeout > 0 raised in Socket_create at src/net/socket.c:319 Aborted
check directory upload with path /data/upload
if hardlink > 32000 then alert
set mmonit
https://monit:mypassword@mmonit.foo.bar:8443/collector
with hostgroups [ Oslo, "Mail servers" ]
check program myscript with path /usr/local/bin/myscript.sh
if content changed then alert
if content not changed then alert else ignore