Skip to content

Control file statements

The agent reads Monit's control file. Each statement and variant of Monit's manual is listed here with what the agent does with it: it reads it, or it refuses the control file with an error naming the statement -- it never ignores one silently. This page is generated from the list the agent's tests check with every release.

Monit here is the reference Monit, Monit 6.1.0: the version the agent's tests check it against.

Of 197 statements and variants, the agent reads 22. <credentials> stands for the collector's user and password, user:password.

Daemon and init

Statement The agent
set daemon 60 read
set daemon 30 with start delay 60 not yet -- the agent refuses it
set daemon 30 start delay 60 not yet -- the agent refuses it
set daemon 30
set init
not yet -- the agent refuses it
set terminal batch not yet -- the agent refuses it
set onreboot start not yet -- the agent refuses it
set onreboot nostart not yet -- the agent refuses it
set onreboot laststate not yet -- the agent refuses it

Logging and files

Statement The agent
set idfile /var/lib/flyingmonit-agent/.flyingmonit-agent.id read
set log syslog not yet -- the agent refuses it
set log /tmp/flyingmonit-agent.log read
set logfile syslog facility log_daemon not yet -- the agent refuses it
set statefile /var/lib/monit/state not yet -- the agent refuses it
set pidfile /var/lib/flyingmonit-agent/.flyingmonit-agent.pid read
set eventqueue basedir /var/lib/monit/events slots 100 not yet -- the agent refuses it
set eventqueue basedir /var/lib/monit/events not yet -- the agent refuses it
set expectbuffer 10 kb not yet -- the agent refuses it

Mmonit

Statement The agent
set mmonit http://<credentials>@collector.example/collector read
set mmonit https://<credentials>@collector.example/collector timeout 5 seconds read
set mmonit https://<credentials>@collector.example/collector timeout 1 second read
set mmonit http://<credentials>@collector.example/collector register without credentials not yet -- the agent refuses it
set mmonit https://<credentials>@collector.example/collector with ssl { verify: enable } not yet -- the agent refuses it
set mmonit http://<credentials>@a.example/collector
and register without credentials
not yet -- the agent refuses it

Alerts and mail

Statement The agent
set alert admin@example.org not yet -- the agent refuses it
set alert admin@example.org only on { timeout, nonexist } not yet -- the agent refuses it
set alert admin@example.org but not on { instance } not yet -- the agent refuses it
set alert admin@example.org with reminder on 10 cycles not yet -- the agent refuses it
set alert admin@example.org with mail-format { subject: alarm } not yet -- the agent refuses it
set mail-format { from: monit@example.org } not yet -- the agent refuses it
set mail-format { from: monit@example.org
subject: $SERVICE $EVENT at $DATE
message: $DESCRIPTION }
not yet -- the agent refuses it
set mailserver smtp.example.org not yet -- the agent refuses it
set mailserver smtp.example.org port 587 username "monit" password "secret" using tls not yet -- the agent refuses it
set mailserver smtp.example.org, localhost with timeout 15 seconds not yet -- the agent refuses it

Httpd

Statement The agent
set httpd port 2812
allow admin:monit
read
set httpd port 2812 address 127.0.0.1
allow localhost
read
set httpd port 2812 and use address localhost
allow localhost
allow admin:"pass word"
read
set httpd port 2812
allow 10.0.0.0/8
allow 192.168.0.0/255.255.0.0
allow ::1
allow admin:monit
read
set httpd
allow admin:monit
read
set httpd port 2812
with ssl { pemfile: {pem} }
allow admin:monit
read
set httpd port 2812 and use address localhost
ssl { pemchain: {chain}, pemkey: {key}, selfsigned: allow }
allow admin:monit
read
set httpd port 2812
with ssl { pemfile: {pem}, verify: disable, version: tlsv13 }
allow admin:monit
read
set httpd port 2812
with ssl { pemfile: {pem}, ciphers: "HIGH:!aNULL" }
allow admin:monit
not yet -- the agent refuses it
set httpd port 2812
with ssl { pemfile: {pem}, clientpemfile: {chain} }
allow admin:monit
not yet -- the agent refuses it
set httpd port 2812
with ssl { pemfile: {pem}, version: tlsv11 }
allow admin:monit
not yet -- the agent refuses it
set httpd port 2812
with ssl { pemfile: {pem}, cacertificatefile: {chain} }
allow admin:monit
not yet -- the agent refuses it
set httpd unixsocket /run/monit.sock
allow admin:monit
not yet -- the agent refuses it
set httpd port 2812
allow 10.0.0.0/8
allow admin:monit read-only
not yet -- the agent refuses it
set httpd port 2812
signature disable
allow admin:monit
not yet -- the agent refuses it
set httpd port 2812
read-only
allow admin:monit
not yet -- the agent refuses it

Ssl, fips and limits

Statement The agent
set ssl { verify: enable, selfsigned: reject } not yet -- the agent refuses it
set ssl options { version: tlsv13 } not yet -- the agent refuses it
set fips not yet -- the agent refuses it
set limits { programoutput: 1 kB, sendexpectbuffer: 512 B, filecontentbuffer: 512 B, httpcontentbuffer: 1 MB, networktimeout: 5 s } not yet -- the agent refuses it

Include

Statement The agent
include /etc/monit.d/*.cfg read
include "/etc/monit conf.d/*" read

Check types

Statement The agent
check system $HOST read
check process app with pidfile /run/app.pid not yet -- the agent refuses it
check process app matching "^app$" not yet -- the agent refuses it
check file app path /etc/app.conf not yet -- the agent refuses it
check fifo app path /run/app.fifo not yet -- the agent refuses it
check filesystem rootfs path / read
check filesystem data with path /dev/sda1 read
check directory app path /var/lib/app not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed ping then alert
not yet -- the agent refuses it
check program app path /bin/true
if status != 0 then alert
not yet -- the agent refuses it
check program app path /bin/true with timeout 60 seconds
if status != 0 then alert
not yet -- the agent refuses it
check network eth0 with interface eth0 not yet -- the agent refuses it
check network lan with address 192.0.2.1 not yet -- the agent refuses it

Service methods

Statement The agent
check process app with pidfile /run/app.pid
start program = "/usr/sbin/app start"
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
stop program = "/usr/sbin/app stop"
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
restart program = "/usr/sbin/app restart"
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
start program = "/bin/true" with timeout 60 seconds
not yet -- the agent refuses it
check system $HOST
start program = "/bin/true"
not yet -- the agent refuses it

Poll time, groups and mode

Statement The agent
check system $HOST
every 2 cycles
not yet -- the agent refuses it
check system $HOST
every "* 8-19 * * 1-5"
not yet -- the agent refuses it
check system $HOST
not every "0-15 3 * * *"
not yet -- the agent refuses it
check system $HOST
group servers
not yet -- the agent refuses it
check system $HOST
mode passive
not yet -- the agent refuses it
check system $HOST
mode manual
not yet -- the agent refuses it
check system $HOST
mode active
not yet -- the agent refuses it
check system $HOST
onreboot nostart
not yet -- the agent refuses it

Dependencies and restarts

Statement The agent
check process db with pidfile /run/db.pid
check process app with pidfile /run/app.pid
depends on db
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if 3 restarts within 5 cycles then unmonitor
not yet -- the agent refuses it

Service alerts

Statement The agent
check system $HOST
alert admin@example.org
not yet -- the agent refuses it
check system $HOST
alert admin@example.org only on { resource }
not yet -- the agent refuses it
check system $HOST
noalert admin@example.org
not yet -- the agent refuses it
check system $HOST
alert admin@example.org with reminder on 5 cycles
not yet -- the agent refuses it

Existence and resources

Statement The agent
check system $HOST
if loadavg (1min) > 4 then alert
not yet -- the agent refuses it
check system $HOST
if loadavg (5min) per core > 2 for 3 cycles then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage > 95% then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage (user) > 70% then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage (system) > 30% then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage (wait) > 20% then alert
not yet -- the agent refuses it
check system $HOST
if memory usage > 75% then alert
not yet -- the agent refuses it
check system $HOST
if memory usage > 4 GB then alert
not yet -- the agent refuses it
check system $HOST
if swap usage > 25% then alert
not yet -- the agent refuses it
check system $HOST
if uptime < 1 hour then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if does not exist then restart
not yet -- the agent refuses it
check file app path /etc/app.conf
if exist then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 60% for 2 cycles then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if total cpu > 80% then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if memory > 200 MB then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if total memory > 80% then restart
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if children > 250 then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if threads > 100 then alert
not yet -- the agent refuses it

Process tests

Statement The agent
check process app with pidfile /run/app.pid
if changed pid then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if changed ppid then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if uptime > 3 days then restart
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if read rate > 1 MB/s for 5 cycles then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if disk read > 500 kB/s then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if disk write activity > 500 operations/s then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if filedescriptors > 800 then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if total filedescriptors > 2000 then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if filedescriptors > 90% then alert
not yet -- the agent refuses it
check process app matching "^app$"
if changed pid then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if failed unixsocket /run/app.sock then restart
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if disk read activity > 500 operations/s then alert
not yet -- the agent refuses it

File and directory tests

Statement The agent
check file app path /etc/app.conf
if failed checksum then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if changed checksum then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if failed sha256 checksum expect e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if changed timestamp then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if timestamp > 15 minutes then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if modification time > 1 hour then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if size > 100 MB then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if changed size then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if content = "ERROR" then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if content != "OK" then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
ignore content = "debug"
not yet -- the agent refuses it
check file app path /etc/app.conf
if failed permission 640 then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if failed uid root then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if failed gid root then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if changed hardlink then alert
not yet -- the agent refuses it
check file app path /etc/app.conf
if hardlink > 1 then alert
not yet -- the agent refuses it
check directory app path /var/lib/app
if changed timestamp then alert
not yet -- the agent refuses it
check directory app path /var/lib/app
if failed permission 755 then alert
not yet -- the agent refuses it
check fifo app path /run/app.fifo
if failed permission 660 then alert
not yet -- the agent refuses it

Filesystem tests

Statement The agent
check filesystem rootfs path /
if changed fsflags then alert
not yet -- the agent refuses it
check filesystem var path /var
if space usage > 80% then alert
read
check filesystem home path /home
if space usage > 90.5 % then alert
read
check filesystem rootfs path /
if space free < 1 GB then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if inode usage > 90% then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if inode free < 1000 then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if read rate > 50 MB/s then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if write rate > 1000 operations/s then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if service time > 10 milliseconds for 3 times within 5 cycles then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if failed permission 755 then alert
not yet -- the agent refuses it
check filesystem rootfs path /
if read rate > 500 operations/s then alert
not yet -- the agent refuses it

Program tests

Statement The agent
check program app path /bin/true
if status != 0 then alert
not yet -- the agent refuses it
check program app path /bin/true
if status > 1 for 2 cycles then alert
not yet -- the agent refuses it
check program app path /bin/true
if changed status then alert
not yet -- the agent refuses it
check program app path /bin/true
if content = "failed" then alert
not yet -- the agent refuses it

Network tests

Statement The agent
check network eth0 with interface eth0
if failed link then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if changed link then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if link down then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if saturation > 90% then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if upload > 10 MB/s then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if total downloaded > 10 GB in last day then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if upload > 1000 packets/s then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if total uploaded > 900000 packets in last hour then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if changed link capacity then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed ping then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed ping4 count 5 size 128 with timeout 10 seconds then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed ping6 then alert
not yet -- the agent refuses it
check network eth0 with interface eth0
if download > 500 kB/s then alert
not yet -- the agent refuses it

Connection tests

Statement The agent
check host web with address 192.0.2.10
if failed port 80 then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 80 protocol http then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 443 protocol https request "/health" status = 200 then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 80 protocol http request "/" content = "OK" with timeout 10 seconds for 3 cycles then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 25 protocol smtp then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 3306 protocol mysql then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 5432 protocol pgsql then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 1883 protocol mqtt then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 1812 type udp protocol radius secret "s" then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 5060 type udp protocol sip then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 80 protocol websocket request "/ws" then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 80 protocol apache-status loglimit > 80% then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 2000 send "PING\r\
" expect "PONG" then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 22 protocol ssh then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 53 type udp protocol dns then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 443 type tcpssl then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 443 certificate valid > 30 days then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 443 with ssl options { verify: enable } then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 6379 protocol redis then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 11211 protocol memcache then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 389 protocol ldap3 then alert
not yet -- the agent refuses it
check host web with address 192.0.2.10
if failed port 123 type udp protocol ntp3 then alert
not yet -- the agent refuses it

Actions and fault tolerance

Statement The agent
check system $HOST
if cpu usage > 95% then alert
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then restart
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then stop
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then start
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then unmonitor
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then exec "/usr/local/bin/notify"
not yet -- the agent refuses it
check process app with pidfile /run/app.pid
if cpu > 90% then exec "/bin/true" repeat every 3 cycles
not yet -- the agent refuses it
check system $HOST
if cpu usage > 95% then alert else if succeeded then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage > 95% for 3 cycles then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage > 95% 3 times within 5 cycles then alert
not yet -- the agent refuses it
check system $HOST
if cpu usage > 95% for 3 times within 5 cycles then alert
not yet -- the agent refuses it