This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Apache2 | |
check process apache with pidfile /var/run/apache2/apache2.pid | |
group www | |
start program = "/usr/sbin/service apache2 start" | |
stop program = "/usr/sbin/service apache2 stop" | |
if cpu is greater than 60% for 2 cycles then alert | |
if cpu > 80% for 5 cycles then restart | |
if totalmem > 2 GB for 5 cycles then restart | |
if children > 250 then restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process mysqld with pidfile /var/run/mysqld/mysqld.pid | |
group database | |
group mysql | |
start program = "/etc/init.d/mysql start" | |
stop program = "/etc/init.d/mysql stop" | |
if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart | |
if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart | |
if 5 restarts with 5 cycles then timeout | |
depend mysql_bin | |
depend mysql_rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PHP-FPM | |
check process php7.3-fpm with pidfile /var/run/php/php7.3-fpm.pid | |
start program = "/usr/sbin/service php7.3-fpm start" with timeout 60 seconds | |
stop program = "/usr/sbin/service php7.3-fpm stop" | |
if failed unixsocket /var/run/php/php7.3-fpm.sock then restart | |
if 2 restarts within 2 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redis | |
check host redis.host with address 127.0.0.1 | |
if failed port 6379 protocol redis then alert | |
check process redis-server with pidfile "/var/run/redis/redis-server.pid" | |
start program = "/etc/init.d/redis-server start" | |
stop program = "/etc/init.d/redis-server stop" | |
if failed host 127.0.0.1 port 6379 then restart | |
if totalmem > 100 Mb then alert | |
if children > 255 for 5 cycles then stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fail2ban | |
check process fail2ban with pidfile /var/run/fail2ban/fail2ban.pid | |
group services | |
start program = "/etc/init.d/fail2ban force-start" | |
stop program = "/etc/init.d/fail2ban stop || :" | |
if failed unixsocket /var/run/fail2ban/fail2ban.sock then restart | |
if 5 restarts within 5 cycles then timeout | |
check file fail2ban_log with path /var/log/fail2ban.log | |
if match "ERROR|WARNING" then alert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Postfix | |
check process postfix with pidfile /var/spool/postfix/pid/master.pid | |
group mail | |
start program = "/etc/init.d/postfix start" | |
stop program = "/etc/init.d/postfix stop" | |
if failed host YOUR-RELAY-HOST port 587 | |
type tcp protocol smtp using tls | |
with timeout 15 seconds | |
then alert | |
if 3 restarts within 5 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process crond with pidfile /var/run/crond.pid | |
group system | |
group crond | |
start program = "/etc/init.d/cron start" | |
stop program = "/etc/init.d/cron stop" | |
if 5 restarts with 5 cycles then timeout | |
depend cron_bin | |
depend cron_rc | |
depend cron_spool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### eksis.one | |
check host eksis.one with address www.eksis.one | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTPS check | |
if failed port 443 type tcpSSL protocol http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hitch | |
check process hitch with pidfile /var/run/hitch.pid | |
start program = "/usr/bin/systemctl start hitch" with timeout 30 seconds | |
stop program = "/usr/bin/systemctl stop hitch" | |
if failed host 127.0.0.1 port 443 type tcpSSL protocol http | |
and request /index.html with timeout 5 seconds for 2 times within 2 cycles | |
then restart | |
if 2 restarts within 2 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; DigitalOcean 4 CPU, 8 GB RAM | |
; PHP7.3-FPM | |
; If all pools hit in with full power there isn't enough RAM, I reckon. | |
; | |
; static | |
; Wordpress, 2000 - 5000 users per day | |
[www] | |
user = www-data | |
group = www-data | |
listen = /run/php/php7.3-fpm.sock |