43 lines
1.7 KiB
Smarty
43 lines
1.7 KiB
Smarty
# Copyright 1999-2024. WebPros International GmbH. All rights reserved.
|
|
set daemon <poll_interval>
|
|
|
|
set logfile /var/log/plesk/modules/monit.log
|
|
set statefile /run/monit.state
|
|
|
|
set httpd port <monit_tcp_port> and use address 127.0.0.1
|
|
allow 127.0.0.1
|
|
allow <monit_login>:<monit_password>
|
|
|
|
set mmonit https://<monit_login>:<monit_password>@127.0.0.1:<wdcollect_port>/
|
|
|
|
# Plesk apache
|
|
check process plesk_apache
|
|
with pidfile "/run/sw-cp-server.pid"
|
|
start = "<plesk_apache_start>"
|
|
stop = "<plesk_apache_stop>"
|
|
if failed host localhost port 8443 type tcpssl send "GET /favicon.ico HTTP/1.1\r\n\r\n" expect "HTTP/1\.[01x] [1-4][0-9]{2} .*\r\n" with timeout <plesk_apache_connection_timeout> seconds then restart
|
|
if <plesk_apache_timeout_restarts> restarts within <plesk_apache_timeout_cycles> cycles then timeout
|
|
every <plesk_apache_cycles> cycles
|
|
mode <plesk_apache_mode>
|
|
|
|
# sw-engine
|
|
check process sw_engine
|
|
with pidfile "/run/sw-engine.pid"
|
|
start = "<sw_engine_start>"
|
|
stop = "<sw_engine_stop>"
|
|
if failed unixsocket /run/sw-engine.sock with timeout <sw_engine_connection_timeout> seconds then restart
|
|
if <sw_engine_timeout_restarts> restarts within <sw_engine_timeout_cycles> cycles then timeout
|
|
every <sw_engine_cycles> cycles
|
|
mode <sw_engine_mode>
|
|
|
|
# Apache
|
|
check process apache
|
|
with pidfile "/run/apache2/apache2.pid"
|
|
start = "<apache_start>"
|
|
stop = "<apache_stop>"
|
|
if failed host <apache_monitoring_ip> port <apache_port> send "GET / HTTP/1.1\r\nHost: <apache_monitoring_host>\r\n\r\n" expect "HTTP/1\.[01x] [1-4][0-9]{2} .*\r\n" with timeout <apache_connection_timeout> seconds then restart
|
|
if <apache_timeout_restarts> restarts within <apache_timeout_cycles> cycles then timeout
|
|
every <apache_cycles> cycles
|
|
mode <apache_mode>
|
|
|