-
Notifications
You must be signed in to change notification settings - Fork 100
/
monit
44 lines (40 loc) · 2.89 KB
/
monit
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
check process cloud_controller_ng
with pidfile /var/vcap/sys/run/bpm/cloud_controller_ng/cloud_controller_ng.pid
start program "/var/vcap/jobs/bpm/bin/bpm start cloud_controller_ng"
stop program "/var/vcap/jobs/bpm/bin/bpm stop cloud_controller_ng"
group vcap
if totalmem > <%= p("cc.thresholds.api.alert_if_above_mb") %> Mb for 3 cycles then alert
if totalmem > <%= p("cc.thresholds.api.restart_if_consistently_above_mb") %> Mb for <%= p("cc.thresholds.api.restart_if_consistently_above_mb_cycles") %> cycles then exec "/var/vcap/jobs/cloud_controller_ng/bin/restart_drain"
if totalmem > <%= p("cc.thresholds.api.restart_if_above_mb") %> Mb for 3 cycles then exec "/var/vcap/jobs/cloud_controller_ng/bin/restart_drain"
check process ccng_monit_http_healthcheck
with pidfile /var/vcap/sys/run/bpm/cloud_controller_ng/ccng_monit_http_healthcheck.pid
start program "/var/vcap/jobs/bpm/bin/bpm start cloud_controller_ng -p ccng_monit_http_healthcheck"
stop program "/var/vcap/jobs/bpm/bin/bpm stop cloud_controller_ng -p ccng_monit_http_healthcheck"
if 1 restart within 2 cycles then exec "/var/vcap/jobs/cloud_controller_ng/bin/restart_drain"
depends on nginx_cc
group vcap
<% (1..(p("cc.jobs.local.number_of_workers"))).each do |index| %>
check process cloud_controller_worker_local_<%= index %>
with pidfile /var/vcap/sys/run/bpm/cloud_controller_ng/local_worker_<%= index %>.pid
start program "/var/vcap/jobs/bpm/bin/bpm start cloud_controller_ng -p local_worker_<%= index %>"
stop program "/var/vcap/jobs/bpm/bin/bpm stop cloud_controller_ng -p local_worker_<%= index %>"
group vcap
if totalmem > <%= p("cc.thresholds.api.alert_if_above_mb") %> Mb for 3 cycles then alert
if totalmem > <%= p("cc.thresholds.api.restart_if_consistently_above_mb") %> Mb for 15 cycles then restart
if totalmem > <%= p("cc.thresholds.api.restart_if_above_mb") %> Mb for 3 cycles then restart
<% end %>
check process nginx_cc
with pidfile /var/vcap/sys/run/bpm/cloud_controller_ng/nginx.pid
start program "/var/vcap/jobs/bpm/bin/bpm start cloud_controller_ng -p nginx"
stop program "/var/vcap/jobs/bpm/bin/bpm stop cloud_controller_ng -p nginx"
if failed unixsocket /var/vcap/data/cloud_controller_ng/cloud_controller.sock then restart
if <%= p("cc.thresholds.api.restart_if_monit_connection_test_consistently_fails_cycles") %> restarts within <%= p("cc.thresholds.api.restart_if_monit_connection_test_consistently_fails_cycles") %> cycles then exec "/var/vcap/jobs/cloud_controller_ng/bin/restart_drain"
depends on cloud_controller_ng
group vcap
<% if_p("cc.newrelic.license_key") do %>
check process nginx_newrelic_plugin
with pidfile /var/vcap/sys/run/bpm/cloud_controller_ng/nginx_newrelic_plugin.pid
start program "/var/vcap/jobs/bpm/bin/bpm start cloud_controller_ng -p nginx_newrelic_plugin"
stop program "/var/vcap/jobs/bpm/bin/bpm stop cloud_controller_ng -p nginx_newrelic_plugin"
group vcap
<% end %>