check system debian7test
if loadavg (5min) > 15 then restart
if memory usage > 80% then alert
if swap usage > 25% then alert
if cpu usage (user) > 60% for 3 cycles then alert
if cpu usage (system) > 60% for 3 cycles then alert
if cpu usage (wait) > 20% then alert
#
##Apache2
check process apache with pidfile /var/run/apache2.pid
group www
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed port 80 protocol http then restart
if cpu is greater than 30% for 1 cycles then alert
if cpu > 30% for 2 cycles then restart
if totalmem > 250 MB for 3 cycles then restart
if children > 200 then restart
if loadavg(5min) greater than 10 for 4 cycles then restart
if 3 restarts within 5 cycles then timeout
#
##Disk Space
check filesystem with path /dev/sda1
if space usage > 80% then alert
if inode usage > 80% then alert
#
##SSHD
check process sshd with pidfile /var/run/sshd.pid
group ssh
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
#if failed port 22 protocol ssh then restart
#if 5 restarts within 5 cycles then timeout
#
##MySQL
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed port 3306 protocol mysql then restart
if 5 restarts within 5 cycles then timeout
#
##Exim4
check process exim4 with pidfile /var/run/exim4/exim.pid