forked from jedrichards/node-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitrc
58 lines (44 loc) · 1.43 KB
/
monitrc
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Sets the rate at which monit polls services to once every 60s.
set daemon 60
# Expose the monit web based front-end on the port 0000. Allow any incoming
# connections from any IP as long as they supply the correct credentials.
set httpd port 0000
allow username:password
# Use Gmail as the outgoing mailserver for alert messages.
set mailserver smtp.gmail.com port 587
username "email@gmail.com" password "password"
using tlsv1
# Define who the alerts should be sent to. Add extra recipients with
# more set alert lines.
set alert email@gmail.com
set alert coworker@gmail.com
# Set a format for outgoing alert emails.
mail-format {
subject: [$HOST-monit] $SERVICE $ACTION
message:$DESCRIPTION
Date: $DATE
Action: $ACTION
Event: $EVENT
Service: $SERVICE
Host: $HOST
Find out more at http://0.0.0.0:0000
Love, $HOST X
}
# Check node-proxy. The pidfile and start/stop functionality is supplied
# by Upstart. If the proxy fails to respond with a 200 OK HTTP response code
# after a request to its special "/ping" route then Monit will
# alert and attempt to restart.
check process node-proxy
with pidfile /var/node/node-proxy/pid
start program = "/sbin/start node-proxy"
stop program = "/sbin/stop node-proxy"
if failed
host 127.0.0.1
port 80
protocol HTTP
request /ping
with timeout 5 seconds
then restart
if 3 restarts
within 3 cycles
then timeout