Created
June 25, 2012 03:09
-
-
Save zxcvbnm4709/2986254 to your computer and use it in GitHub Desktop.
Edit monit configuration file in /etc/monit/monitrc
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
set daemon 120 | |
set logfile syslog facility log_daemon | |
set mailserver smtp.gmail.com port 587 username "[email protected]" password "userpassword" using tlsv1, | |
with timeout 15 seconds | |
set eventqueue | |
basedir /var/monit | |
slots 1000 | |
set mail-format { from: [email protected] } | |
set alert [email protected] | |
set httpd port 2812 and | |
allow admin:monit | |
check system localhost | |
if loadavg (1min) > 3 then alert | |
if loadavg (5min) > 2 then alert | |
if memory usage > 60% then alert | |
if cpu usage (user) > 70% then alert | |
if cpu usage (system) > 30% then alert | |
if cpu usage (wait) > 20% then alert | |
## nginx ## | |
check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" | |
group server | |
## mysql ## | |
check process mysql with pidfile /var/run/mysqld/mysqld.pid | |
start program = "/etc/init.d/mysql start" | |
stop program = "/etc/init.d/mysql stop" | |
group database | |
## redis ## | |
check process redis-server with pidfile /var/run/redis.pid | |
start program = "/usr/bin/redis-server /etc/redis.conf" | |
stop program = "/usr/bin/killall -9 redis-server" | |
group redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment