Skip to content

Instantly share code, notes, and snippets.

@changeme
Created March 15, 2016 00:57
Show Gist options
  • Save changeme/a4b3c422f6407d743ec0 to your computer and use it in GitHub Desktop.
Save changeme/a4b3c422f6407d743ec0 to your computer and use it in GitHub Desktop.
# PUEDEN ESTAR EN DISTINTOS ARCHIVOS
#############################################################
# SPAM ASSASSIN
check process spamd with pidfile /var/run/spamd.pid
group mail
start program = "/etc/init.d/spamassassin start"
stop program = "/etc/init.d/spamassassin stop"
if cpu usage > 99% for 5 cycles then alert
if mem usage > 99% for 5 cycles then alert
depends on spamd_bin
check file spamd_bin with path /usr/bin/spamd
group mail
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
#############################################################
# CENTOS WEB PANEL
check process cwp with pidfile /usr/local/cwpsrv/logs/httpd.pid
start program = "/etc/init.d/cwpsrv start" with timeout 60 seconds
stop program = "/etc/init.d/cwpsrv stop"
if failed host IP.OR.HOSTNAME port 2030 protocol http
and request "/"
then restart
group controlpanel
#############################################################
# MAILSERVER DOVECOT
check process dovecot with pidfile /var/run/dovecot/master.pid
start program = "/etc/init.d/dovecot start"
stop program = "/etc/init.d/dovecot stop"
if cpu > 60% for 2 cycles then alert
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 3 restarts with in 5 cycles then timeout
group mailserver
#############################################################
# POSTFIX
check process postfix with pidfile /var/spool/postfix/pid/master.pid
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if cpu > 60% for 2 cycles then alert
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 IP.OR.HOST port 25 type tcp protocol smtp
with timeout 15 seconds
then alert
#if 3 restarts within 5 cycles then timeout
check process ftp with pidfile /var/run/pure-ftpd.pid
start program = "/etc/init.d/pure-ftpd start" with timeout 60 seconds
stop program = "/etc/init.d/pure-ftpd stop"
if failed port 21 protocol ftp then restart
group mailserver
#############################################################
# WEB SERVER ON PORT 8181 (BACKEND OF NGINX)
check process apache with pidfile /usr/local/apache/logs/httpd.pid
start program = "/etc/init.d/httpd start" with timeout 60 seconds
stop program = "/etc/init.d/httpd stop"
if cpu > 60% for 2 cycles then alert
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 IP.OR.HOSTNAME port 8181 protocol http
and request "/"
then restart
if failed port 443 type tcpssl protocol http
with timeout 15 seconds
then restart
if 3 restarts within 5 cycles then timeout
group web-server
#############################################################
#NGINX AS FRONTEND(:80) OF APACHE(:8181)
check process nginx with pidfile /var/run/nginx.pid
start program = "/etc/init.d/nginx start" with timeout 60 seconds
stop program = "/etc/init.d/nginx stop"
if cpu > 60% for 2 cycles then alert
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 IP.OR.HOSTNAME port 80 protocol http
and request "/"
then restart
group web-server
#############################################################
# MARIADB/MYSQL SERVER
check process mysql with pidfile /var/lib/mysql/PID.FILE.pid
start program = "/etc/init.d/mysql start" with timeout 60 seconds
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 protocol mysql then restart
group serverdb
#############################################################
# NAMED
check process named with pidfile /var/run/named/named.pid
start program = "/etc/init.d/named start"
stop program = "/etc/init.d/named stop"
if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
if failed host 127.0.0.1 port 53 type udp protocol dns then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment