monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monit from crontab?


From: Kevin Chadwick
Subject: Re: Monit from crontab?
Date: Sat, 26 Mar 2011 19:50:33 +0000

On Fri, 25 Mar 2011 15:08:47 -0400 (EDT)
Aubrey Jaffer wrote:

> I want to set up a monitor which sends an email if a website goes
> down.  I don't have root access on the machine I will run Monit on.
> The Monit documentation describes how to modify /etc/inittab to run
> Monit, but is silent as to how to run Monit from the crontab program.
> 

It's best to do this from another system or both. Of course you can do
it locally but isn't a complete test.


> Because Monit looks for a control-file in ~/.monitrc, it would seem
> that Monit should be usable for non-root users.
> 

Yes but it would need sudo start permissions to do anything other than
report and your user would need mailing permissions and if firewalled,
would need to allow mail out, all of this is likely.

> Can Monit be run from crontab?
> 

Of course, you could run it from crontab, crontab will run anything you
like, if your allowed. Normally it is run from init on Linux so it is
restarted if it fails. I presume you don't have permissions for this.
You can still run it as a normal user in the background/daemon mode.

> If so, should Monit be started as a daemon when run from crontab?

Monit is intended to run as a daemon. You could start wait and stop it
but why would you, you'd just use extra resources and invalidate half
of monits functionality. If your worried about monit stopping and not
reporting you could easily write a script to check your website via
crontab if this is all you want to do or check monit is running with
something as simple but with more thought like. 

/usr/bin/pgrep ^monit$ || /usr/local/bin/monit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]