From ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 26 Nov 2011 10:09:51 +1000 Subject: First commit. --- opensim-monit.conf | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 opensim-monit.conf (limited to 'opensim-monit.conf') diff --git a/opensim-monit.conf b/opensim-monit.conf new file mode 100644 index 0000000..e300720 --- /dev/null +++ b/opensim-monit.conf @@ -0,0 +1,34 @@ +# 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. +# +# if process dies, will restart sim within 30 seconds. if process +# dies 5 times in as many tries, will stop trying and send email +# alert. +# +# if SimFPS drops to 0 for 2 minutes, restart. +# +# if process CPU usage stays above 300% for 2 minutes, restart. +# +# see ../README for configuration instructions. +# +check process sim01 with pidfile /var/run/opensim/sim01.pid + start program = "/bin/bash -c 'cd /opt/opensim/config/sim01 && /opt/opensim/sim01/start-sim-in-rest'" + as uid opensim and gid opensim + stop program = "/bin/kill -9 `cat /var/run/opensim/sim01.pid`" +# if cpu usage > 300% 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 + -- cgit v1.1