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 1c0d81779263f6a6cf7e6c5dd36e5dc1e908683b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Apr 17 11:50:56 2015 +0200 monitoring module instruction also removed from database if exception occures (as well if no connection have been found) --- app/module_loader.py | 25 +++++++++++++++++++++++++ static/js/controllers/hostPageCtrl.js | 1 + 2 files changed, 26 insertions(+) diff --git a/app/module_loader.py b/app/module_loader.py index 1ab1618..0d43201 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -260,10 +260,15 @@ class ModuleLoader: # getting all availiable connections for this part to check compatible_conn = self.loaded_mod_moni[part_name]['compatible_conn'] conf_conn = self.db.get_conf_conn(addr_host) + conn_found = False for i in range(len(conf_conn)): + # for each connection that have been configurated for this host (by priority) for mod in self.loaded_mod_moni[part_name]['modules']: + # for each monitoring module, being from this part, activated for this host loaded_mod = self.loaded_mod_moni[part_name]['modules'][mod]['imported'] if getattr(loaded_mod, 'connection') == conf_conn[i]['conn_mod_name']: + # if this monitoring module is compatible for the current connection + conn_found = True try: conn_inst = self.create_connection(addr_host, conf_conn[i]) dict_notif = getattr(self.loaded_mod_moni[part_name]['modules'][mod]['imported'], @@ -274,13 +279,33 @@ class ModuleLoader: except modules.ModuleNotCompatibleException.ModuleNotCompatibleException as mnce: print mnce.__str__() process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) except modules.CommandNotFoundException.CommandNotFoundException as cnfe: print cnfe.__str__() process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) except Exception: print "Monitoring module " + part_name + " have been disabled on " + addr_host + \ " because of an unexpected error." process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) + if not conn_found: + print "No necessary connection have been configured for " + part_name + " on " + addr_host +\ + ". Therefore it has been deactivated." + process_monitoring.remove_to_waiting_list(addr_host, part_name) + dict_deactivation_request = {} + dict_deactivation_request['addr_host'] = addr_host + dict_deactivation_request['activated'] = {part_name: False} + self.db.config_mod_activation(dict_deactivation_request) def get_monitoring_modules_list(self): """ diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 858b796..348f781 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -195,6 +195,7 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar var modalInstance = $modal.open({ templateUrl: 'modal_block_label.html', controller: 'ModalBlockInstanceCtrl', + size: 'lg', resolve: { block_args: function(){ return {'addr_host' : $scope.addr_host, -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.