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 using montit for other processes I need to run, but I have a process which doesn't run as a daemon, and I can't figure out how to monitor it with monit

share|improve this question

3 Answers 3

Current versions of monit allow you to match process strings using the matching "string" directive instead of the PID...

check process n2n-edge
        matching "/usr/sbin/edge"
        start program = "/root/tools/edge.87.server"
        stop program = "/usr/bin/killall edge"
        if 10 restarts within 11 cycles then timeout
        if cpu usage > 95% for 11 cycles then restart
share|improve this answer

You can check the byproducts of the process.

You could, for example, monitor the existence of a lock file, the modification time of a directory, or something that is modified or created by your process.

share|improve this answer

You can use start-stop-daemon and use the --make-pidfile option to create a pidfile. If this is not possible you may directly check the service, for example:

check host localhost with address 127.0.0.1
start program = "/etc/init.d/postfix start" 
stop program = "/etc/init.d/postfix stop" 
if failed port 25 protocol smtp then restart
share|improve this answer

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.