blob: 9d66ce6d531118ad740b12dc833662df6567f833 (
plain)
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
|
# manage the OpenSim process for Your Sim
#
# usage:
# monit start your_sim
# monit stop your_sim
# monit restart your_sim
#
# see 'daemon' setting in /etc/monit/monitrc for the cycle length.
# on ubuntu/debian, this is overridden by the CHECK_INTERVALS var in
# /etc/default/monit . the below assumes you've set it to 30 seconds.
#
# see ../README for configuration instructions.
#
# Hmmmm, seems that monit changing to a user and running bash -l is different from sudo changing to a user and running bash -l.
#
check process sim01 with pidfile /var/run/opensim/sim01.pid
start program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/start-sim -q'"
as uid root and gid root
stop program = "/usr/bin/sudo -Hu opensim /bin/bash -lc 'cd /opt/opensim/config/sim01 && /opt/opensim/config/sim01/stop-sim'" with timeout 600 seconds
if cpu usage > 50% for 4 cycles then restart
if MEMORY usage > 25% for 4 cycles then restart
# if 5 restarts within 5 cycles then timeout
# if failed url http://127.0.0.1:9005/jsonSimStats/
# and content != '"SimFPS":0.0,' for 4 cycles
# then restart
# if failed url http://127.0.0.1:9008/jsonSimStats/
# and content == '"SimFPS":' for 4 cycles
# then restart
depends on ROBUST
|