This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit 45e342bd51c010cbd98ade15b643a4312c2c2c84 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jul 8 17:26:45 2015 +0200 "default" attribute loaded from modules and can overwrite the values from the inital configuration --- app/module_loader.py | 8 ++++++++ app/modules/storage_modules/shelve_db.py | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/app/module_loader.py b/app/module_loader.py index 797f494..1ceeb73 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -339,6 +339,14 @@ class ModuleLoader: self.loaded_mod_moni[part]['compatible_conn'].append(getattr(loaded_mod, 'connection')) self.loaded_mod_moni[part]['compatible_conn'] = \ list(set(self.loaded_mod_moni[part]['compatible_conn'])) + try: + self.loaded_mod_moni[part]['param'] = getattr(loaded_mod, 'param') + except AttributeError: + self.loaded_mod_moni[part]['param'] = {} + try: + self.loaded_mod_moni[part]['default'] = getattr(loaded_mod, 'default') + except AttributeError: + self.loaded_mod_moni[part]['default'] = {} except AttributeError: self.logger.warning("Error : external monitoring module " + mod_name + " could not have been loaded.") self.logger.debug(traceback.format_exc()) diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 43cb394..ab78bf8 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -189,6 +189,8 @@ class shelve_db: mod_conf['major_limit'] = 10 if 'param' in loaded_mod_moni[mod]: mod_conf['param'] = loaded_mod_moni[mod]['param'] + for default_val in loaded_mod_moni[mod]['default']: + mod_conf[default_val] = loaded_mod_moni[mod]['default'][default_val] mod_conf['subscribers'] = {} self.db['global_conf'][mod] = mod_conf # removing entries of modules that are no loaded anymore @@ -501,11 +503,14 @@ class shelve_db: info_host["last_check"] = 0 info_host["warning"] = [] info_host["danger"] = [] + info_host["success"] = [] for mod in self.db["hosts"][host]["monitoring"]: if self.db["hosts"][host]["monitoring"][mod]["state"] == "warning": info_host["warning"].append(mod) elif self.db["hosts"][host]["monitoring"][mod]["state"] == "danger": info_host["danger"].append(mod) + else: + info_host["success"].append(mod) info_host['nb_subscribers'] = len(self.db['hosts'][host]['conf']['subscribers'].keys()) info_host['subscribers'] = self.db['hosts'][host]['conf']['subscribers'] info_host['display_name'] = self.db['hosts'][host]['conf']['display_name'] -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.