-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathnginx
33 lines (30 loc) · 1.13 KB
/
nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- mode: conf; mode: flyspell-prog; mode: autopair; ispell-current-dictionary: american -*-
### Monitoring nginx.
check process nginx with pidfile /var/run/nginx.pid
group webserver # webserver group
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
## Test port 80 and request the server status page. Restart if the
## server is down.
if failed port 80 protocol http then restart
## If the restarts attempts fail then alert.
if 3 restarts within 5 cycles then timeout
depends on nginxd
depends on nginx_init
alert root@localhost only on {timeout}
## Test the nginx binary.
check file nginxd with path /usr/sbin/nginx
group webserver
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
alert root@localhost
## Test the init scripts.
check file nginx_init with path /etc/init.d/nginx
group webserver
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed uid root then unmonitor
if failed gid root then unmonitor
alert root@localhost