On 15 Sep 2014, at 23:52, chinaboy <[email protected]> wrote:
> check process SimpleHelp with path /opt/SimpleHelp > start program = "/etc/init.d/simplehelp start" > stop program = "/etc/init.d/simplehelp stop” Monit needs to read the Process ID of SimpleHelp (assuming it is a server-program) from a file. A so called pid-file which contains one entry only which is the process-id. This file must then be specified in the check process statement which could look something like check process SimpleHelp with path /opt/SimpleHelp/simplehelp.pid start program = "/etc/init.d/simplehelp start" stop program = "/etc/init.d/simplehelp stop” If your script needs to create the pid file, do something like this in bash: echo $$ > /opt/SimpleHelp/simplehelp.pid; $$ is the process-id of the script. Don’t background anything with ‘&’ in which case the process-id will be wrong. More info can be found here: http://mmonit.com/wiki/Monit/FAQ#pidfile -- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
