|
From: | Bruce B |
Subject: | Re: Very simple monit of a perl file - how to do it? |
Date: | Wed, 29 Dec 2010 00:10:50 -0500 |
On Tue, Dec 28, 2010 at 3:22 PM, Bruce B <address@hidden> wrote:
--Anything to this guys?Thanks,On Mon, Dec 27, 2010 at 9:57 PM, Bruce B <address@hidden> wrote:
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/nullThe program actually creates a file with PID in it in /var/log/test.pidI 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.pidstart program = "/usr/src/holdReport/startTest.sh"if 5 restarts within 5 cycles then timeoutAnd startTest.sh includes:nohup perl /usr/src/test.pl >> /dev/nullI would love to receive alerts to my gmail if program shuts down. Please enlighten me on that too.Thanks,Bruce
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
Sorry Bruce,
Not enough info for me to be much help. When you say "it doesn't seem to work", what does that mean, exactly?
I can assume that if you run sh /usr/src/holdReport/startTest.sh from your shell, the script creates a pid file and
begins to do its job. So what happens when you request Monit to start monitoring? Does it do anything at all?
Can you post the relevant section of your Monit log? Best thing to do is (especially if this is the only process you
are attempting to monitor atm), rm -f your entire monit log. Manually start your perl script, then start monit. Check
the Monit webserver and note anything it says there regarding your script (also note if it does not even exist there).
Shut down Monit, and cat your monit log, copy/paste it to here.
As stated in an earlier thread, I used the 'wrapper' technique, outlined in the Monit FAQ, to successfully monitor
a PHP script that runs 24/7. It was surprisingly easy, and worked as advertised. Review that section, and see if
any of it can help you try a few things.
http://mmonit.com/wiki/Monit/FAQ
Best,
- Keith
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |