Hi Russell,
requested behavior can be satisfied by configuring these processes in
'manual' monitoring mode. If you request monit to start 'manual' mode
services and they are already running, monit will just start monitoring
them (enter active mode) without any initial intervention.
Correct order which will satisfy your needs:
1.) configure your services and set their monitoring mode to 'manual'
2.) configure monit to run from init (thereafter you can run 'telinit q'
to start monit without whole system restart)
3.) start your services outside monit (monit won't monitor the service
in that point - it will just wait to to be instructed to do so)
4.) start monit daemon
5.) as soon as you desided to start monitoring the sevices, you can run
'monit start [service]' which will enable services monitoring (in active
mode). If the services are not running, monit will start them. If the
services are already running, monit will just start monitoring them. I
think the best way to do it is probably let monit start as last service
(for example S99monit - optionaly with initial sleep) OR as you noted
add monit's deamon startup at the end of your startup script.
NOTE: there's one problem regarded to monitoring which is stateless
between monit restart in all monit's version (version 3.2 which is
scheduled for monday included). This behavior has now workaround in 3.2
- if there are some 'manual' services running at the monit's daemon
startup, monit will start monitoring them imediately the same way as if
you called 'monit start [service]'. This workaround will work fine for
you and won't affect your requested monit's behavior - only the step 5.)
can be ommited in Monit 3.2 if the services are already running at
monit's daemon startup. This will be fixed soon - i think we will solve
it in upcoming 3.3 (discussed in more detail yeasterday on the
developers list).
Cheers,
Martin
---
Jan-Henrik Haukeland wrote:
The trick is simply to start monit after all startup scripts has
started, as mentioned here by Mark:
http://mail.nongnu.org/archive/html/monit-general/2002-12/msg00001.html
Russell Adams <address@hidden> writes:
I'm configuring MONIT to run on my Gentoo servers, and had a
question. I'm trying to use MONIT to keep certain critical processes
running at all times.
I'd like MONIT to start with init, but not autostart the various
processes it should monitor. I'd like Gentoo's startup scripts to
finish loading everything, then MONIT start monitoring everything.
There are a few reasons for doing this, but the biggest is how picky
Gentoo's startup/shutdown procs are for individual programs. It caches
everything.
Is there a method to delay MONIT from starting active monitoring for 5
minutes after launch? Perhaps can i start MONIT in passive mode, and
then move to active? It would be bad for MONIT to start a service
before its been called in the startup.
Or finally, should I just set all my services to monitor as manual,
and as the last thing in the Gentoo start scripts call MONIT to start
them? Would MONIT choke if they were already started when its called
with the start parameter?
Thanks!
Russell
--
To unsubscribe:
http://mail.nongnu.org/mailman/listinfo/monit-general
------------------------------------------------------------------------
# Global Settings
set logfile syslog
set daemon 300
set init
set mailserver kscaxp.ksnet.com
# HTTPD Settings
set httpd port 2812
address localhost
allow localhost
# Cron service
check cron with pidfile /var/run/cron.pid
group soja_default
mode manual
start program = "/etc/init.d/dcron zap start"
stop program = "/etc/init.d/dcron stop"
checksum /etc/init.d/dcron /usr/sbin/crond /usr/bin/crontab
timeout (3,3)
alert address@hidden
alert address@hidden on { timeout, checksum }
------------------------------------------------------------------------
--
To unsubscribe:
http://mail.nongnu.org/mailman/listinfo/monit-general