monit monitoring solution

Added by Mark Petryk about 2 years ago

Hi Koen, et al.

Do you happen to have a 'sample' monit file that I can reference for how you've used it to monitor wt servers?

Also, you mentioned in one of the threads here on this forum, that you've been 'marginally satisfied' (paraphrasing) with monit, and that you needed a monit for monit. Where do you stand on this?

Replies (3)

RE: monit monitoring solution - Added by Koen Deforche about 2 years ago

Hey Mark,

Yes, see below:

Monit lines (for process charts.wt listening on port 1417):

check process charts.wt
  with pidfile /home/wt/project/wt-deployed/run/
  start program = "/home/wt/project/ start /home/wt/project/wt-deployed/charts/charts.wt /charts.wt 1417" 
  stop program  = "/home/wt/project/ stop  /home/wt/project/wt-deployed/charts/charts.wt" 
  if failed port 1417 protocol http request /monittoken then restart script:


if [ $# '<' "2" ]; then
    echo $"Usage: {start|stop} /path/to/app.wt ..." 
    exit 1

if [ ! -f $2 ]; then
   echo $"Could not locate application: $2"; 
   exit 1

exe=`basename $2`
dir=`dirname $2`
exname=`basename $dir`

export APPROOT=/home/wt/project/approot
export LD_LIBRARY_PATH=/usr/local/lib
export PATH=/usr/local/bin:$PATH
#export MALLOC_CHECK_=2

case "$1" in
    if [ $# != "4" ]; then
      echo $"Usage: start /path/to/app.wt path port" 
      exit 1

    cd $dir;
    touch docroot/monittoken;
    ulimit -c unlimited;
    ulimit -s 1024;
    ./$exe -p ../run/$ --deploy-path $3 --http-port $4 \
    --docroot 'docroot;/css,/resources,/icons,/favicon.ico' \
    --approot $APPROOT/$exname `cat argv` >> ../run/$exe.log 2>&1 &
    sleep 1;
    if [ $# != "2" ]; then
      echo $"Usage: stop /path/to/app.wt" 
      exit 1

    cd $dir;
    pid=`cat ../run/$`;
    kill $pid;
    sleep 3;
    kill -9 $pid;
    sleep 1;
    echo $"Usage: {start|stop} /path/to/app.wt ..." 
    exit 1

Indeed we are not satisfied with monit and have started using systemd directly in new deployments.


RE: monit monitoring solution - Added by Mark Petryk about 2 years ago

Thank you, Koen.