From: Carlo M. A. B. <ca...@sa...> - 2008-08-18 07:58:29
|
On Tue, Aug 12, 2008 at 02:14:15PM +0100, Dan...@ba... wrote: > > fair, and so for the sake of clarity let me explain again > > what are the specification constrains : > > > > * must allow for nodes to specify where the configuration server is > > * must allow for additional configurations to be included for modules > > * must allow for configuration updates > > * should allow for nodes to be notified when configuration changes > > require them to be reloaded > > * should allow caching the configuration locally > > * should fallback gracefully in case configuration server is > > not available > > * should provide other applications (like gmetric) > > configuration services > > Here is my proposal: > - insert a dynamic_configuration step immediately after parsing the text > files and before any of the cfg_t structures are examined how would this work for module configurations which could in theory also include their own "dynamic_configuration" sections? are all "dynamic_configuration" sections assumed to be global? how would you deal with multiple entries? how would you handle configuration caching? how do you handle other consumers of the configuration like gmetric? > - the dynamic_configuration() code loads a user specified module to avoid confusion it will be better if those modules are not together with the metric modules. using "moduledir/conf/" instead of "moduledir/" should be enough to do that. > - the mechanism is purely optional and can be bypassed if the module > fails > > Something like this is added to gmond.conf: > > dynamic_configuration { > module_path = "/tmp/mod_config_test.so" > param = "http://localhost/get_ganglia_opts.php?host=%s" > } > > The module can use methods like cfg_setstr() to override the values > loaded from the configuration files. still think that getting this into gmond is a stretch and even if the implementation is done in gmond there is really no reason why this can't go to a different configuration file. > =================================================================== > --- include/ganglia.h (revision 1635) > +++ include/ganglia.h (working copy) > @@ -2,11 +2,14 @@ > #define GANGLIA_H 1 > #include <rpc/rpc.h> > > +#include <gm_mmn.h> > #include <gm_msg.h> > #ifndef GM_PROTOCOL_GUARD > #include <gm_protocol.h> > #endif > > +#include <confuse.h> this changes our ABI and adds a external dependency to libConfuse which I am not sure is warranted/desirable. > Index: gmond/gmond.c > =================================================================== > --- gmond/gmond.c (revision 1635) > +++ gmond/gmond.c (working copy) > @@ -199,17 +199,34 @@ > mmodule *metric_modules = NULL; > extern int daemon_proc; /* defined in error.c */ > > +void dynamic_configuration(); > + can't be this forward declaration be avoided? Carlo |