monit-general
[Top][All Lists]
Advanced

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

Re: MONIT Startup


From: Russell Adams
Subject: Re: MONIT Startup
Date: Fri, 14 Feb 2003 13:32:50 -0600
User-agent: Mutt/1.4i

Actually, to amend to this post...

1. Start cron normally
2. Start Monit (cron service set to manual mode)
3. Issue monit start (start all services)
4. Kill cron

... nothing happens ... Monit does not restart cron

5. Reissue monit start (while cron is down)
6. Monit starts cron
7. Kill cron
8. Monit restarts cron

So it seems that a manual service that is already running is
explicitly ignored. The start command fails to move the cron service
to active mode if cron is already running.

So I had to kill cron and have monit start it before monit would
properly monitor and restart cron...

Anyone have further insight?

Again, I want monit to start with init, with all services in manual
mode. All the normal services will load during the normal system
startup with the init.d scripts, and the last init.d script should
send "monit start" to have monit start actively watching the
services. Monit would then restart services as needed from that point
forward, and init would restart monit in case of a critical error.

Russell

On Fri, Feb 14, 2003 at 11:24:53AM -0600, Russell Adams wrote:
> I've setup a sample config to watch cron. Its configured for manual
> mode.
> 
> 1. Cron is already running.
> 2. Start monit in a local window with verbose, web page says cron is
> running.
> 3. Issue monit start cron to make it start active mode on cron.
> 4. Kill cron abnormally.
> 5. Wait for monit to restart cron.
> 
> Nothing happens. Its quite odd.
> 
> Here's a log:
> 
> soja root # /etc/init.d/dcron zap start
>  * Manually resetting dcron to stopped state.
>  * Starting dcron...                  [ ok ]
> 
> soja root # ps ax | grep cron
>   669 ?        S      0:00 /usr/sbin/crond
>  8895 pts/6    R      0:00 grep cron
> 
> soja root # monit -c /etc/monit.conf start cron
> 
> soja root # monit -c /etc/monit.conf status    
> monit daemon uptime: 0m 
> Process 'cron' is running with pid [669] 
>         Uptime: 0m  CPU: 0.0% Memory: 0.0% [0kB]
> 
> soja root # kill 669
> 
> soja root # ps ax | grep cron
> 30056 pts/6    R      0:00 grep cron
> 
> Monit never responds to cron not being available. The web page says
> its not running, but it doesn't seem to restart it or mail me about
> it. I've tried just "start" and "start cron". The web page for the
> cron service still says manual mode...
> 
> What am I missing?
> 
> I've attached the sample config file.
> 
> Russell
> 
> > 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





reply via email to

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