diff options
| author | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
|---|---|---|
| committer | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
| commit | ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f (patch) | |
| tree | b25d5ce40da4019db2b7f1552eda19d91677365c /opensim-monit.conf | |
| download | IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.zip IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.gz IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.bz2 IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.xz | |
First commit.
Diffstat (limited to 'opensim-monit.conf')
| -rw-r--r-- | opensim-monit.conf | 34 |
1 files changed, 34 insertions, 0 deletions
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 @@ | |||
| 1 | # manage the OpenSim process for Your Sim | ||
| 2 | # | ||
| 3 | # usage: | ||
| 4 | # monit start your_sim | ||
| 5 | # monit stop your_sim | ||
| 6 | # monit restart your_sim | ||
| 7 | # | ||
| 8 | # see 'daemon' setting in /etc/monit/monitrc for the cycle length. | ||
| 9 | # on ubuntu/debian, this is overridden by the CHECK_INTERVALS var in | ||
| 10 | # /etc/default/monit . the below assumes you've set it to 30 seconds. | ||
| 11 | # | ||
| 12 | # if process dies, will restart sim within 30 seconds. if process | ||
| 13 | # dies 5 times in as many tries, will stop trying and send email | ||
| 14 | # alert. | ||
| 15 | # | ||
| 16 | # if SimFPS drops to 0 for 2 minutes, restart. | ||
| 17 | # | ||
| 18 | # if process CPU usage stays above 300% for 2 minutes, restart. | ||
| 19 | # | ||
| 20 | # see ../README for configuration instructions. | ||
| 21 | # | ||
| 22 | check process sim01 with pidfile /var/run/opensim/sim01.pid | ||
| 23 | start program = "/bin/bash -c 'cd /opt/opensim/config/sim01 && /opt/opensim/sim01/start-sim-in-rest'" | ||
| 24 | as uid opensim and gid opensim | ||
| 25 | stop program = "/bin/kill -9 `cat /var/run/opensim/sim01.pid`" | ||
| 26 | # if cpu usage > 300% for 4 cycles then restart | ||
| 27 | # if 5 restarts within 5 cycles then timeout | ||
| 28 | # if failed url http://127.0.0.1:9005/jsonSimStats/ | ||
| 29 | # and content != '"SimFPS":0.0,' for 4 cycles | ||
| 30 | # then restart | ||
| 31 | # if failed url http://127.0.0.1:9008/jsonSimStats/ | ||
| 32 | # and content == '"SimFPS":' for 4 cycles | ||
| 33 | # then restart | ||
| 34 | |||
