Hi Everyone,
I am very new to monit. I have a perl program (
test.pl) which should be running 24/7 and should re-spawn if it goes dead. Of course monit is the right tool for it but I have no clue how to use it.
Here is what I do to start the program each time:
nohup perl /usr/src/
test.pl >> /dev/null
The program actually creates a file with PID in it in /var/log/test.pid
I have the following so far in my /etc/monit.conf ( I am running CentOS) and it doesn't seem to work.
check process holdreport with pidfile /var/log/test.pid
start program = "/usr/src/holdReport/startTest.sh"
if 5 restarts within 5 cycles then timeout
And startTest.sh includes:
nohup perl /usr/src/
test.pl >> /dev/null
I would love to receive alerts to my gmail if program shuts down. Please enlighten me on that too.
Thanks,
Bruce