Created
March 31, 2011 00:01
-
-
Save adamjt/895555 to your computer and use it in GitHub Desktop.
monitrc for nginx
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
# polling interval (in seconds) | |
set daemon 60 | |
set logfile <%= your_path %>/log/monit.log | |
set pidfile <%= your_path %>/tmp/pids/monit.pid | |
set statefile <%= your_path %>/tmp/monit/monit.state | |
set mailserver localhost | |
set mail-format { from: [email protected] } | |
set alert [email protected] | |
set httpd port 7474 and use address 0.0.0.0 | |
allow localhost | |
allow your.ip.address | |
allow user:password | |
#### nginx #### | |
check process nginx | |
with pidfile <%= your_nginx_path %>/conf/nginx.pid | |
start program = "<%= your_nginx_path %>/sbin/nginx" | |
stop program = "/bin/bash -c 'kill -s SIGTERM `cat <%= your_nginx_path %>/conf/nginx.pid` && rm <%= your_nginx_path %>/conf/nginx.pid'" | |
if failed host <%= host %> port <%= nginx_port %> then restart | |
group webserver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment