monit-general
[Top][All Lists]
Advanced

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

Re: Feature request for config file checking?


From: Jan-Henrik Haukeland
Subject: Re: Feature request for config file checking?
Date: 05 Jun 2003 21:59:42 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Civil Service)

Mark Ferlatte <address@hidden> writes:

> Jan-Henrik Haukeland said on Thu, Jun 05, 2003 at 03:31:23AM +0200:
> [gibberish]
> 
> That's not quite what I had in mind...

Ahhum, right. I misunderstod that one.

> What I would like (and admittedly, this is a pretty niche feature, so it may
> not be worth integrating), is for monit to notice changes in the configuration
> files of software that monit is monitoring, and reload them if their config
> file has changed.  This could, of course, apply to monit itself.
> 
> So, for example:
> 
> monit is watching apache on a cluster of webservers.  I push an update to 
> those
> webservers using rsync (so, new configs).  I want monit to notice that the
> config file for the webserver has changed, and to take an action (ie, run
> /etc/init.d/apache reload).
> 
> Perhaps the webserver cluster is a bad example... I'm in an environment where 
> I
> have ~100 machines that are running an identical image, and while deploying 
> new
> software is easy, deploying config file changes still requires logging into
> each machine with a script and reloading/restarting services.  I want the
> machines to do it themselves.
> 
> It seemed like monit was a good choice for this; however, if this isn't
> something that "fits", I will just write a tool to do the same thing.

No, this seems like a cool idea at least in my book and you're right
about monit almost having this function already, that is, some minor
extensions to the TIMESTAMP statement [1] should do the trick as in:

check apache with pidfile /var/run/apache.pid
  start program = /etc/init.d/apache start
  stop program = /etc/init.d/apache stop
  if timestamp "/local/apache/conf/httpd.conf" was changed then restart

It's probably easier to implement this if we only check the last-
modified-timestamp of a config file, but of course a changed timestamp
does not necessarily imply that the content of a file was changed and
to check for actual changes a checksum of the file is needed, as you
mentioned previously. Still, would just checking the last modified
timestamp be sufficient do you think?



[1] The timestamp statement: 
    <URL:http://www.tildeslash.com/monit/monit.html#timestamp%20testing>


-- 
Jan-Henrik Haukeland




reply via email to

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