Notifications on System Startup

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Notifications on System Startup

Don Parker-2
I have done the integration with init so Monit is responsible for
starting up a number of services. Upon reboot of my server host the
first thing I get is a flood of emails about all the services that are
down, followed by notifications as it successfully brings them "back"
up. I find the "up" messages useful in this context, but the "down"
messages are noise. Suggestions:
-Monit should not send a message about a failure after a reboot until it
has tried to start a service at least once

I also find some services take a finite amount of time before checks on
their ports will pass.  I thought I could cover this by putting "sleeps"
in the start scripts Monit runs for these services, but this does not
seem to work ... Monit is checking, failing, and restarting so fast that
all alerts have the same time stamp.  Any suggestions (aside from
turning off port monitoring)?


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Notifications on System Startup

martinp@tildeslash.com
Don Parker wrote:
> I have done the integration with init so Monit is responsible for
> starting up a number of services. Upon reboot of my server host the
> first thing I get is a flood of emails about all the services that are
> down, followed by notifications as it successfully brings them "back"
> up. I find the "up" messages useful in this context, but the "down"
> messages are noise. Suggestions:
> -Monit should not send a message about a failure after a reboot until it
> has tried to start a service at least once

I think it could be possible to use 'mode manual' in the monit control
file for all services which are controlled by monit. In such case monit
will start, but the 'manual' services won't be monitored until the
monitoring is enabled. When you then instruct monit to start the service
('monit start ...'), monit will start the service and enable its
monitoring without the 'failed' alert for stopped service.

To start all services, special option 'monit start all' can be used =>
for example when you start monit via SysV init script, you can add it as
the next line after the monit start command:

--8<--
   monit
   sleep(1)
   monit start all
--8<--

>
> I also find some services take a finite amount of time before checks on
> their ports will pass.  I thought I could cover this by putting "sleeps"
> in the start scripts Monit runs for these services, but this does not
> seem to work ... Monit is checking, failing, and restarting so fast that
> all alerts have the same time stamp.  Any suggestions (aside from
> turning off port monitoring)?

This can be acompished using the new event ratio dependant actions which
are implemented in monit-4.6. For example:

   if failed port 80 for 3 cycles then alert

or

   if failed port 25 for 3 times within 5 cycles then alert


Martin



--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general