Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure Monit to monitor my pidfile. I had no problem except for one. this is what I configured:

check process chat with pidfile /var/run/chat.pid
start program = "/etc/init.d/chat start"
start program = "/etc/init.d/chat stop"

this is the process I have when I start chat with /etc/init.d/chat:

ps -ef | grep chat
root     17659     1  0 19:23 pts/2    00:00:00 /usr/bin/php -q /usr/statistic/chatManager
root     17662 17659  0 19:23 pts/2    00:00:00 /usr/bin/php -q /usr/statistic/chatManager

this is what I see in the monit log file:

when I start the process:

[GMT Mar 21 19:23:51] info     : 'chat' process is running with pid 17659

when I stop the process:

**[GMT Mar 21 19:23:11] error    : monit: Start or stop method not defined -- process chat**

any suggestions? thanks!! E.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Try something like this:

check process chat with pidfile /var/run/chat.pid
start program = "/etc/init.d/chat start"
start program = "/etc/init.d/chat stop"
if failed host 192.0.2.10 port XX then restart
if 5 restarts within 5 cycles then timeout

The IP has to be changed of course, as well as the port.

share|improve this answer
add comment

You need

stop program = "/etc/init.d/chat stop"

instead of

start program = "/etc/init.d/chat stop"

You wrote start program for both, the start and the stop program.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.