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: Wed, 19 Feb 2003 13:52:41 -0600
User-agent: Mutt/1.4i

3.2 works great! It smoothly takes over services already running,
  after being told to do so.

So here's a new and unusual question. 

I start monit in passive mode, start cron, then tell monit to watch
cron.

Great right?

Then I kill monit... And cron disappears? Its not a direct child
process accoring to 'ps axf', so why wouldn't cron be left running?

This bothers me because I want to run monit under init so monit will
always be running. But I'd hate for the monitored services that have
been restarted to die *if* (yes, big if) monit dies and gets restarted
by init.

Ideas?

Russell

On Fri, Feb 14, 2003 at 01:34:04PM -0600, Russell Adams wrote:
> Ah! Great. ;]
> 
> I'd be happy to try it out.
> 
> I was writing a Gentoo ebuild for Monit 3.1, I'll update it to 3.2
> when the release is out on Monday.
> 
> Thanks!
> 
> Russell
> 
> On Fri, Feb 14, 2003 at 08:27:27PM +0100, Martin Pala wrote:
> > The setup is correct - the described behavior is regarded to version 3.2 
> > (and later), which will be released on monday. Please try it with it 
> > again - it should work.
> > 
> > Cheers,
> > Martin
> > 
> > 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
> > >>   
> > >>
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe:
> > http://mail.nongnu.org/mailman/listinfo/monit-general
> 
> 
> --
> To unsubscribe:
> http://mail.nongnu.org/mailman/listinfo/monit-general




reply via email to

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