monit-wrapper.sh

62 views
Skip to first unread message

Joël AZÉMAR

unread,
Aug 29, 2011, 4:04:33 PM8/29/11
to toulo...@googlegroups.com
Voilà le script magique !

monit-wrapper.sh

#!/bin/sh
{
  echo "MONIT-WRAPPER date"
  date
  echo "MONIT-WRAPPER env"
  env
  echo "MONIT-WRAPPER $@"
  $@
  R=$?
  echo "MONIT-WRAPPER exit code $R"
} >/tmp/monit.log 2>&1

a utiliser comme suit :

check process memcached_sa with pidfile /var/www/scooter_accessoires_production/shared/pids/sa_memcached.pid
start program = "/bin/sh /usr/local/bin/monit-wrapper.sh /usr/local/bin/memcached_sa-start" as uid root and gid root
stop program  = "/bin/sh /usr/local/bin/monit-wrapper.sh /usr/local/bin/memcached_sa-stop" as uid root and gid root
if failed host 127.0.0.1 port 11212 then restart 
        if cpu > 60% for 2 cycles then alert
        if cpu > 98% for 5 cycles then restart 
        if 2 restarts within 3 cycles then timeout
group memcached




Cordialement
Joël AZEMAR
Tel : 0661988090
----------------------------

Thomas Riboulet

unread,
Aug 29, 2011, 4:05:43 PM8/29/11
to toulo...@googlegroups.com, Thomas Riboulet
je me disais bien qu'il fallait que je vienne a cet apero

--
Thomas Riboulet
Arbousier.info
0698926057 - 0951251521

Reply all
Reply to author
Forward
0 new messages