[Top][All Lists]

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

Re: about monit.conf

From: Martin Pala
Subject: Re: about monit.conf
Date: Fri, 02 Mar 2007 19:11:58 +0100
User-agent: Thunderbird (Windows/20061207)

If the http interface is the issue:

it is possible to run monit in daemon mode without the http interface support - just omit the 'set httpd ...' statement. Email notification (alert statements) work regardless of http interface.

Also note that when monit is started from cron, then if cron dies, monit won't run, which makes the solution more fragile then daemon mode (when monit is running in daemon mode, it can watch cron as well, and monit itself can be watched by init).


Clifford W. Hansen wrote:
The reason for running monit from cron is for email notification, this is if
you don't need/want the web interface.

Afaik. Tbh I always run it as a deamon... ;)

Hope this helps,


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of hans
Sent: Friday, 02 March 2007 19:29
To: This is the general mailing list for monit
Subject: Re: about monit.conf

I am still confused about running monit from crond.
If run monit every 5 minutes why no to change the poll time to 5
minutes and run it as demon.
Run monit from crond is not very cool because you loose a lot of
functions of monit that make monit great.
Please, someone tell me what its the goal of running monit from crond.
 Regards Hans.

On 3/2/07, Martin Pala <address@hidden> wrote:
Also note that in this mode the "if 5 restarts within 5 cycles then
timeout" has no effect for the same reason - it will work only in daemon


Martin Pala wrote:
When you call monit from cron, then it will check the current services
state, start the failed processes, send the alarm and gracefuly exit.
When monit isn't running as daemon, it doesn't keep the state for the
previous cycle.

When you want monit to send email for both events (failure in one cycle
and recovery in next cycle) then you should run monit in daemon mode
rather then from cron.


Atsushi Tamae wrote:

I install monit to redhat linux ES 4 with monit-4.9-1.el4.rf.i386.rpm.
%monit -V
This is monit version 4.9
Copyright (C) 2000-2007 by the monit project group. All Rights
And configured for monit as like follows:

#check snmptrapd
check process snmptrapd with pidfile /var/run/
   start program = "/etc/init.d/snmptrapd start"
   stop program = "/etc/init.d/snmptrapd stop"
   if failed port 162 type udp then restart
   if 5 restarts within 5 cycles then timeout
#check radiusd
check process radiusd with pidfile /var/run/radiusd/
   start program = "/etc/init.d/radiusd start"
   stop program = "/etc/init.d/radiusd stop"
   if 5 restarts within 5 cycles then timeout
#check tacacs server
check process tacacs with pidfile /var/run/
  start program = "/etc/init.d/tacacs start"
  stop  program = "/etc/init.d/tacacs stop"
  if 5 restarts within 5 cycles then timeout

And I confiured to run monit in crontab like follows:
*/5     *       *       *       *       root monit validate

And I shutdown some process like snmptrapd, to test monit.
But I found monit mail as follows:

'snmptrapd' process is not running
'snmptrapd' trying to restart
'snmptrapd' start: /etc/init.d/snmptrapd
'snmptrapd' failed to start

But snmpdtrapd process is already up when I saw this mail.
Please let me know what should I do if I want to recieve mail result
like 'snmptrapd' success to start.
I mean not 'snmptrapd' failed to start.

Atsushi Tamae

reply via email to

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