monit newbie problem

Frioffol Friofool wrote:

Hi,

I tried to make monit up on my server to manage ruby on rails
application.
I have some problem when i try to start monit :

Hi,
What do you get when you run:
# /usr/local/bin/monit -t -c /usr/local/src/monitrc

Daniel

Daniel Bush wrote:

Frioffol Friofool wrote:

Hi,

I tried to make monit up on my server to manage ruby on rails
application.
I have some problem when i try to start monit :

Hi,
What do you get when you run:
# /usr/local/bin/monit -t -c /usr/local/src/monitrc

Daniel

[root@seb cpericard]# /usr/local/bin/monit -t -c /usr/local/etc/monitrc
Control file syntax OK

Monit does NOT get the normal path information that a regular user on
the server would get so you have to be VERY specific in you
configuration files. Some times the best solution is to create a
startup script that you call from monit...

script:
#!/bin/bash
# Get the port number
PORT=$2
# Set the initial path
export PATH=${PATH}:/usr/bin:/usr/local/bin
start () { mongrel_rails cluster::start --config $CONFIG_FILE --clean
--only $PORT }
stop () { mongrel_rails cluster::stop --config $CONFIG_FILE --clean --
only $PORT --force }
case $1 in
  start)
    start
  ;;
  stop)
    stop
  ;;
  *)
  echo $"Usage: $0 {start|stop} port"
  exit 1
  ;;
esac
exit 0

Now you can call it from monit like this:

  start program = "/usr/local/bin/script.sh start 8000"
  stop program = "/usr/local/bin/script.sh stop 8000"