branch develop updated (140053a -> e920a7c)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from 140053a toaster if a module have been deactivated by the service new 4a26442 bool values for dict strcut on hostpage + hadling update after updating the notifications new a781ddd buttons for scan choices new e155b07 removed GET_ALL_SUBSCRIPTIONS websocket request + added get_groups functions on db + changed notifications summary page new 5b05348 group view: link to hostpage + colors displayed new ddbc857 display_name added new e920a7c failures itterations added for notifications. reset on hostpage The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit e920a7c52d608ca92f2917696c88c65e22dc9975 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 10 14:53:59 2015 +0200 failures itterations added for notifications. reset on hostpage commit ddbc857041aef49fa3d10c0bdcdb1c5822ae81fe Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 10 11:33:45 2015 +0200 display_name added commit 5b0534858af5f181ec887d1b68f89771de42236a Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Jun 9 14:04:49 2015 +0200 group view: link to hostpage + colors displayed commit e155b07b3c0504523ffbdaa96a52e7d8f47500a0 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 8 12:43:21 2015 +0200 removed GET_ALL_SUBSCRIPTIONS websocket request + added get_groups functions on db + changed notifications summary page commit a781ddd746fdf4d02a35efcea2748470704fdfb2 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 8 11:34:49 2015 +0200 buttons for scan choices commit 4a26442dddd8ddb8c5f4004a39875b3f4394c821 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 5 14:06:55 2015 +0200 bool values for dict strcut on hostpage + hadling update after updating the notifications Summary of changes: app/module_loader.py | 17 +---- app/modules/storage_modules/shelve_db.py | 89 ++++++++++++++++++++-- app/websocket_func.py | 5 -- mum.conf | 6 +- static/js/controllers/dashboardCtrl.js | 29 ++++++-- static/js/controllers/headCtrl.js | 3 - static/js/controllers/hostPageCtrl.js | 33 ++++++--- static/js/controllers/notificationsCtrl.js | 43 ++++------- views/dashboard.html | 114 ++++++++++++++++------------- views/hostpage.html | 72 ++++++++++++------ views/index.html | 19 ++--- views/notifications.html | 57 +++++++++++---- views/scan.html | 16 +++- views/settings.html | 10 +-- 14 files changed, 331 insertions(+), 182 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 4a26442dddd8ddb8c5f4004a39875b3f4394c821 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 5 14:06:55 2015 +0200 bool values for dict strcut on hostpage + hadling update after updating the notifications --- static/js/controllers/dashboardCtrl.js | 7 +++++-- static/js/controllers/hostPageCtrl.js | 13 +++++++++---- views/dashboard.html | 1 - views/hostpage.html | 5 +++++ views/index.html | 19 +++++-------------- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index c3b5ce5..d2fec1b 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -210,11 +210,15 @@ mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modal }, 0); $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_NOTIF_MOD": ""})); } - if (args.func == 'get_users') { + else if (args.func == 'get_users') { $timeout(function () { $scope.users = args.res; }, 0); } + else if (args.func == 'update_subscription_to_group' || 'update_subscription_to_host'){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_HOSTS": ""})); + $modalInstance.close(); + } }); $scope.$on("resGetLoadedNotifMod", function (event, args) { @@ -256,7 +260,6 @@ mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modal args['addr_host'] = $scope.addr_host; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'update_subscription_to_host', 'args': args}})); } - $modalInstance.close(); }; $scope.cancel = function () { diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 319a75a..5889a49 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -41,6 +41,7 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa 'compatible_os': [val1, val2, ...], => a list containing the compatibles os 'unit': val, => the unit type of return ('%', 'bool' or other) 'block': val, => the monitoring block of the module + 'compatible_conn': [val1, ...] => a list of connection modules } } } @@ -110,6 +111,10 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa for (var key in $scope.items.monitoring[modname].value){ res = Math.max(res, $scope.items.monitoring[modname].value[key]); } + if ($scope.items.loaded_moni_mod[modname].unit == 'bool'){ + // if success for bool value, want to show 'true' and not '1' + res = (res == 1); + } return res; }; @@ -742,10 +747,10 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance // if this archive have subparts // will get the archives for the selected subpart $scope.data.series = [$scope.selected_mod + ' on ' + $scope.selected_subpart]; - for (var i = 0; i<archive_list.length; i++) { + for (var i = 0, l=archive_list.length ; i<l ; i++) { var current_arch = archive_list[i]; if (current_arch.value.hasOwnProperty($scope.selected_subpart)) { - $scope.data.data.push({'x': i, + $scope.data.data.push({'x': l - (i+l), 'y': [current_arch.value[$scope.selected_subpart]], 'tooltip': current_arch.value[$scope.selected_subpart] + " @ " + current_arch.date.split('.')[0] @@ -758,9 +763,9 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance // there is no subpart $scope.data.series = [$scope.selected_mod]; var archive_list = $scope.archive[$scope.selected_mod][$scope.selected_period] - for (var i = 0; i < archive_list.length; i++) { + for (var i = 0, l=archive_list.length ; i<l ; i++) { var current_arch = archive_list[i]; - $scope.data.data.push({'x': i, + $scope.data.data.push({'x': l - (i+l), 'y': [current_arch.value], 'tooltip': current_arch.value + " @ " + current_arch.date.split('.')[0] diff --git a/views/dashboard.html b/views/dashboard.html index 9b65af6..4646b22 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -177,7 +177,6 @@ <h3 class="modal-title">Notifications for {{addr_host}}{{grp_name}}</h3> </div> <div class="modal-body"> - {{subscribers}} <div ng-repeat="(username, subscriber) in subscribers"> {{username}} will be notified: <ul> diff --git a/views/hostpage.html b/views/hostpage.html index 9abfbd8..d095168 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -109,6 +109,11 @@ </optgroup> </select> + <!--<div ng-show="selected_mod_part!=''"> + {{selected_mod_part}}: compatible os: {{items.loaded_moni_mod[selected_mod_part].compatible_os}} <br/> + compatible connections: {{items.loaded_moni_mod[selected_mod_part].compatible_conn}} + </div>--> + <accordion close-others="false"> <accordion-group heading="Essential configuration (nmap detection)"> diff --git a/views/index.html b/views/index.html index 4760e36..9e03a25 100644 --- a/views/index.html +++ b/views/index.html @@ -31,6 +31,7 @@ <script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script> + <!-- Controllers --> <script src="static/js/mumApp.js"></script> <script src="static/js/controllers/dashboardCtrl.js"></script> <script src="static/js/controllers/hostPageCtrl.js"></script> @@ -42,12 +43,6 @@ <script src="static/js/controllers/statsCtrl.js"></script> <script src="static/js/controllers/usersCtrl.js"></script> - - <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> - <!--[if lt IE 9]><!-- - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> </head> <body> @@ -100,21 +95,17 @@ <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar sidebar-fixed-left"> <li><a href="#dashboard">Dashboard</a></li> - <li><a href="#scan">Scan for new machines</a></li> - <li><a href="#settings">Check the default settings</a></li> + <li><a href="#stats">Statistics</a></li> + <li><hr/></li> <li><a href="#users">Users</a></li> + <li><a href="#settings">Global settings</a></li> <li><a href="#notifications">Notifications summary</a></li> - <li><a href="#stats">See the statistics</a></li> + </ul> </div> <div id="main"> <div ng-view></div> </div> - <!-- Bootstrap core JavaScript - ================================================== --> - <!-- Placed at the end of the document so the pages load faster - <script src="bower_components/jquery/dist/jquery.min.js"></script> - <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>--> </div> </div> </body> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 a781ddd746fdf4d02a35efcea2748470704fdfb2 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 8 11:34:49 2015 +0200 buttons for scan choices --- app/module_loader.py | 1 - views/scan.html | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 3f934c4..2d9aa91 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -339,7 +339,6 @@ class ModuleLoader: print "The connection could not have been established with " + conf_conn[i]['conn_mod_name']\ + " on " + addr_host + ". Traceback:" print traceback.format_exc() - # set failed conn priority to 0 ? print "Now trying on next avaliable connection..." i += 1 if not check_done: diff --git a/views/scan.html b/views/scan.html index 5df58b7..80c3650 100644 --- a/views/scan.html +++ b/views/scan.html @@ -11,18 +11,26 @@ <p>Select or type the nmap options to use for the scan (see the <a href="http://nmap.org/book/man-briefoptions.html">nmap documentation</a> for details about these command options):</p> - <div class="row"> - <div class="col-xs-2" + + <div ng-repeat="opt_obj in nmap_options | orderBy:'scan_priority'"> + <button type="button" + class="btn btn-info" + ng-click="$parent.nmap_options_input = opt_obj.scan_options" + popover-placement="right" + popover="{{opt_obj.scan_description}}" + popover-trigger="mouseenter">{{opt_obj.scan_name}} + </button> + <!-- <input type="radio" name="selected_option" value="{{opt_obj.scan_name}}" ng-model="$parent.selected_option" ng-change="$parent.nmap_options_input = opt_obj.scan_options"> {{opt_obj.scan_name}}<a popover-placement="bottom" popover="{{opt_obj.scan_description}}" - popover-trigger="mouseenter"><sup>?</sup></a> + popover-trigger="mouseenter"><sup>?</sup></a>--> </div> - </div> + <div class="row"> <div class="col-md-6"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 e155b07b3c0504523ffbdaa96a52e7d8f47500a0 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 8 12:43:21 2015 +0200 removed GET_ALL_SUBSCRIPTIONS websocket request + added get_groups functions on db + changed notifications summary page --- app/module_loader.py | 14 +------- app/modules/storage_modules/shelve_db.py | 20 +++++++++++ app/websocket_func.py | 5 --- static/js/controllers/headCtrl.js | 3 -- static/js/controllers/notificationsCtrl.js | 43 ++++++++-------------- views/notifications.html | 57 +++++++++++++++++++++++------- 6 files changed, 80 insertions(+), 62 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 2d9aa91..5a05c7a 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -623,16 +623,4 @@ class ModuleLoader: """ host_info = self.db.get_host_informations(addr_host) host_info['compatible_os_list'] = self.compatible_os_list - return host_info - - def get_all_subscriptions(self): - """ - Get, for every registered user, the subscriptions of these users. - :return: a dictionary containing: - {user1: {'hosts': {addr_host: {'major': {}, 'minor': {}}}, 'groups': {...}}, ... } - """ - res = {} - users = self.db.get_users(None) - for user in users: - res[user] = (self.db.get_user_subscriptions(user)) - return res \ No newline at end of file + return host_info \ No newline at end of file diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 7db31ef..9bdb31a 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -420,6 +420,7 @@ class shelve_db: elif self.db["hosts"][host]["monitoring"][mod]["state"] == "danger": info_host["danger"].append(mod) info_host['nb_subscribers'] = len(self.db['hosts'][host]['conf']['subscribers'].keys()) + info_host['subscribers'] = self.db['hosts'][host]['conf']['subscribers'] res.append(info_host) except Exception: print traceback.format_exc() @@ -1205,6 +1206,25 @@ class shelve_db: finally: self.close_db() + def get_groups(self, args): + """ + Get all the groups informations + :param args: None (necessary for dynamic call via websocket) + :return: a dicionnary containing : + { grp_name: { 'hosts': [host1, ...], 'subscribers': + { usr: { 'minor': int, 'major': int }, ... + } } + """ + res = {} + self.open_db() + try: + res = self.db['groups'] + except Exception: + print traceback.format_exc() + finally: + self.close_db() + return res + def get_group_subscribers(self, args): """ Called from the notification page. diff --git a/app/websocket_func.py b/app/websocket_func.py index f97537b..f8a1d12 100644 --- a/app/websocket_func.py +++ b/app/websocket_func.py @@ -103,11 +103,6 @@ def GET_LOADED_NOTIF_MOD(msg, ws, ml): ws.send(json.dumps({"RES_GET_LOADED_NOTIF_MOD": ml.get_info_mod_notification()})) -# asekd from dashboard -def GET_ALL_SUBSCRIPTIONS(msg, ws, ml): - ws.send(json.dumps({"RES_GET_ALL_SUBSCRIPTIONS": ml.get_all_subscriptions()})) - - # asked from hostpage def SET_IDLE_STATE(msg, ws, ml): ml.set_idling_state(msg["SET_IDLE_STATE"]) diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index fb1701b..fe29e22 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -72,9 +72,6 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ case "RES_GET_LOADED_NOTIF_MOD": $rootScope.$broadcast("resGetLoadedNotifMod", obj[key]); break; - case "RES_GET_ALL_SUBSCRIPTIONS": - $rootScope.$broadcast("resGetAllSubscriptions", obj[key]); - break; case "RES_GET_SCAN_OPTIONS": $rootScope.$broadcast("resGetScanOptions", obj[key]); break; diff --git a/static/js/controllers/notificationsCtrl.js b/static/js/controllers/notificationsCtrl.js index 5ccefa1..bcf5ccc 100644 --- a/static/js/controllers/notificationsCtrl.js +++ b/static/js/controllers/notificationsCtrl.js @@ -1,5 +1,5 @@ mumApp.controller('notificationsCtrl', function ($scope, $rootScope, $modal, $route, $timeout, DataHosts) { - $scope.items = DataHosts.Items; /* [ + $scope.hosts = DataHosts.Items; /* [ { "addr":"192.168.74.1", "name":"www.example.com", @@ -17,35 +17,22 @@ mumApp.controller('notificationsCtrl', function ($scope, $rootScope, $modal, $ro ] */ - $scope.all_subscriptions = {}; // {user1: {'hosts': {addr_host: {'major': {}, 'minor': {}}}, 'groups': {...}}, ... } + $scope.groups = {}; /* { grp_name: { 'hosts': [host1, ...], 'subscribers': + { usr: { 'minor': int, 'major': int }, ... + } } + */ - $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_ALL_SUBSCRIPTIONS": ""})); + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_groups','args': null}})); - $scope.$on("resGetAllSubscriptions", function (event, args) { - $timeout(function () { - $scope.all_subscriptions = args; - }, 0); - }); - - $scope.is_activated = function(struct) { // {modname:{"priority":int,"activated":bool}, ...} - res = false; - if (struct != {}) { - for (mod in struct) { - if (struct[mod].activated) { - res = true; - } - } + $scope.$on("resCall", function (event, args) { + if (args.func == 'get_groups') { + $timeout(function () { + $scope.groups = args.res; + }, 0); } - return res; - }; + }); - $scope.get_activated = function (struct) { // {modname:{"priority":int,"activated":bool}, ...} - res = []; - for (mod in struct) { - if (struct[mod].activated) { - res[res.length] = mod + " at " + struct[mod].priority; - } - } - return res; - }; + $scope.nb_sub = function(sub_obj){ + return Object.keys(sub_obj).length; + } }); \ No newline at end of file diff --git a/views/notifications.html b/views/notifications.html index 267006f..4f68d2f 100644 --- a/views/notifications.html +++ b/views/notifications.html @@ -1,16 +1,47 @@ <div class="col-md-offset-2 main"> <h1 class="page-header">Subscriptions summary</h1> - <h3 ng-repeat-start="(username, user) in all_subscriptions">{{username}}</h3> - <dl ng-repeat-end - ng-repeat-start="(addr_host, host) in user.hosts"> - <dt>{{addr_host}}</dt> - <dd ng-show="is_activated(host.major)">Major: {{get_activated(host.major)}}</dd> - <dd ng-show="is_activated(host.minor)">Minor: {{get_activated(host.minor)}}</dd> - </dl> - <dl ng-repeat-end - ng-repeat="(grp_name, grp) in user.groups"> - <dt>{{grp_name}}</dt> - <dd ng-show="is_activated(grp.major)">Major: {{get_activated(grp.major)}}</dd> - <dd ng-show="is_activated(grp.minor)">Minor: {{get_activated(grp.minor)}}</dd> - </dl> + + <div ng-repeat="host_obj in hosts"> + <h3>Host {{host_obj.addr}} <small>{{host_obj.name}}</small></h3> + <div ng-repeat="(username, subscriber) in host_obj.subscribers" + ng-show="nb_sub(host_obj.subscribers) > 0"> + {{username}} will be notified: + <ul> + <li ng-repeat="(minor_notif_name, minor_notif_obj) in subscriber.minor" + ng-show="minor_notif_obj.activated"> + with {{minor_notif_name}} after {{minor_notif_obj.priority}} minor notification(s). + </li> + <li ng-repeat="(major_notif_name, major_notif_obj) in subscriber.major" + ng-show="major_notif_obj.activated"> + with {{major_notif_name}} after {{major_notif_obj.priority}} major notification(s). + </li> + </ul> + </div> + <div ng-show="nb_sub(host_obj.subscribers) == 0"> + No subscriptions. + </div> + <hr/> + </div> + + <div ng-repeat="(group_name, group_obj) in groups"> + <h3>Group {{group_name}} <small>{{group_obj.hosts}}</small></h3> + <div ng-repeat="(username, subscriber) in group_obj.subscribers" + ng-show="nb_sub(group_obj.subscribers) > 0"> + {{username}} will be notified: + <ul> + <li ng-repeat="(minor_notif_name, minor_notif_obj) in subscriber.minor" + ng-show="minor_notif_obj.activated"> + with {{minor_notif_name}} after {{minor_notif_obj.priority}} minor notification(s). + </li> + <li ng-repeat="(major_notif_name, major_notif_obj) in subscriber.major" + ng-show="major_notif_obj.activated"> + with {{major_notif_name}} after {{major_notif_obj.priority}} major notification(s). + </li> + </ul> + </div> + <div ng-show="nb_sub(group_obj.subscribers) == 0"> + No subscriptions. + </div> + <hr/> + </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 5b0534858af5f181ec887d1b68f89771de42236a Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Jun 9 14:04:49 2015 +0200 group view: link to hostpage + colors displayed --- mum.conf | 6 +- static/js/controllers/dashboardCtrl.js | 21 ++++++- static/js/controllers/hostPageCtrl.js | 3 +- views/dashboard.html | 100 +++++++++++++++++---------------- views/hostpage.html | 8 ++- views/index.html | 2 +- 6 files changed, 82 insertions(+), 58 deletions(-) diff --git a/mum.conf b/mum.conf index 8dcfdc1..ca53a58 100644 --- a/mum.conf +++ b/mum.conf @@ -1,8 +1,8 @@ server_port=1337 server_addr=0.0.0.0 -db_location=mum.db -external_modules_location= -keys_location= +db_location=/var/lib/mum/data/mum.db +external_modules_location=/etc/mum/modules/ +keys_location=/var/lib/mum/keys/ smtp_server= smtp_port= smtp_address= diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index d2fec1b..46d26e1 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -137,14 +137,14 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r for (var i=0, l=allGroups.length ; i<l ; i++){ var current_group_name = allGroups[i]; $scope.group_obj[current_group_name] = {}; - $scope.group_obj[current_group_name].hosts = []; + $scope.group_obj[current_group_name].hosts = {}; //{addr: color} $scope.group_obj[current_group_name].status = 'success'; } for (var pos_host=0, l=$scope.items.length ; pos_host < l ; pos_host++){ var current_host_name = $scope.items[pos_host].addr; for (var pos_grp=0, l_grp=$scope.items[pos_host].group.length ; pos_grp<l_grp ; pos_grp++){ var current_group_name = $scope.items[pos_host].group[pos_grp]; - $scope.group_obj[current_group_name].hosts.push(current_host_name); + $scope.group_obj[current_group_name].hosts[current_host_name] = get_color($scope.items[pos_host].status); if ($scope.items[pos_host].status == 'danger'){ $scope.group_obj[current_group_name].status = 'danger'; } @@ -153,8 +153,23 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } } - delete $scope.group_obj['all']; }; + + var get_color = function(status){ + var color = ""; + switch (status){ + case "success": + color = 'green'; + break; + case "warning": + color = 'orange'; + break; + case "danger": + color = 'red'; + break; + } + return color; + } }); mumApp.controller('ModalNotifInstanceCtrl', function ($scope, $rootScope, $modalInstance, $route, $timeout, notif_args) { diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 5889a49..15326b2 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -826,7 +826,8 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance //could be 'left, right' position: 'right' }, - waitForHeightAndWidth: true + waitForHeightAndWidth: true, + isAnimate: false }; $scope.data = { diff --git a/views/dashboard.html b/views/dashboard.html index 4646b22..3fb3fd6 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -45,60 +45,61 @@ <table class="table table-condensed table-hover"> <thead> - <tr> - <th><a ng-click="order_val='addr'">Address</a></th> - <th><a ng-click="order_val='name'">Name</a></th> - <th><a ng-click="order_val='status'">Status</a></th> - <th><a ng-click="order_val='group'">Group</a></th> - <th><a ng-click="order_val='last_check'">Last check</a></th> - </tr> + <tr> + <th><a ng-click="order_val='addr'">Address</a></th> + <th><a ng-click="order_val='name'">Name</a></th> + <th><a ng-click="order_val='status'">Status</a></th> + <th><a ng-click="order_val='group'">Group</a></th> + <th><a ng-click="order_val='last_check'">Last check</a></th> + </tr> </thead> <tbody> - <tr ng-repeat="host in items | + <tr ng-repeat="host in items | orderBy:order_val | filter:{addr:addr_filter, name:name_filter, group:group_filter} | filter:filtering_status" - class={{host.status}}> <!-- group.name:group_filter --> - <td><a href="#/hostpage/{{host.addr}}">{{host.addr}}</a></td> - <td>{{host.name}}</td> - <td> - <a popover-placement="bottom" - popover="warning: {{host.warning}} ; danger: {{host.danger}}" - popover-trigger="mouseenter">{{host.status}} - </a> - </td> - <td> - <ui-select multiple - tagging="tag_transform" - tagging-label="" - ng-model="host.group" - theme="bootstrap" - sortable="true" - ng-disabled="disabled" - style="width: 300px;" - title="Add or remove to a group" - on-remove="rem_host_to_group(host.addr, $item)" - on-select="add_host_to_group(host.addr, $item)"> - <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> - <ui-select-choices repeat="group in allGroups() | filter:$select.search"> - {{group}} - </ui-select-choices> - </ui-select> - </td> - <!--<td>{{host.group}}</td>--> - <td>{{host.last_check.split('.')[0]}}</td> - <td> - <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" - popover-placement="left" - popover="{{host.nb_subscribers}} subscribers" - popover-trigger="mouseenter" - ng-click="open_modal_notif(host.addr, null)"> + class={{host.status}}> <!-- group.name:group_filter --> + <td><a href="#/hostpage/{{host.addr}}">{{host.addr}}</a></td> + <td>{{host.name}}</td> + <td> + <a popover-placement="bottom" + popover="warning: {{host.warning}} ; danger: {{host.danger}}" + popover-trigger="mouseenter">{{host.status}} + </a> + </td> + <td> + <ui-select multiple + tagging="tag_transform" + tagging-label="" + ng-model="host.group" + theme="bootstrap" + sortable="true" + ng-disabled="disabled" + style="width: 300px;" + title="Add or remove to a group" + on-remove="rem_host_to_group(host.addr, $item)" + on-select="add_host_to_group(host.addr, $item)"> + <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> + <ui-select-choices repeat="group in allGroups() | unique | filter:$select.search" + refresh-delay="0"> + {{group}} + </ui-select-choices> + </ui-select> + </td> + <!--<td>{{host.group}}</td>--> + <td>{{host.last_check.split('.')[0]}}</td> + <td> + <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" + popover-placement="left" + popover="{{host.nb_subscribers}} subscribers" + popover-trigger="mouseenter" + ng-click="open_modal_notif(host.addr, null)"> <span class="glyphicon glyphicon-user" aria-hidden="true"> </span> - </button> - </td> - </tr> + </button> + </td> + </tr> </tbody> </table> <a href="#scan"> @@ -139,7 +140,12 @@ orderBy:order_val" class="{{group.status}}"> <!-- group:{name:grp} --> <td>{{groupname}}</td> - <td>{{group.hosts}}</td> + <td> + <div ng-repeat="(host, color) in group.hosts"> + <a href="#/hostpage/{{host}}" + style="color: {{color}}">{{host}}</a> + </div> + </td> <td>{{group.status}}</td> <td> <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" diff --git a/views/hostpage.html b/views/hostpage.html index d095168..bbdabbd 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -1,6 +1,6 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Current state of {{addr_host}} <small>{{items.hostname}} + <h1 class="page-header">Current state of {{items.hostname}}<small> {{addr_host}} <button type="button" class="btn btn-{{get_idle_state()}}" aria-label="Button activation" @@ -63,7 +63,9 @@ </button> </td> <td> - <button type="button" class="btn btn-primary btn-xs" + <button type="button" + class="btn btn-primary btn-xs" + ng-show="get_type_of(mod.value) != 'object'" ng-click="open_modal_stats(addr_host, modname, '')">Archives </button> </td> @@ -348,7 +350,7 @@ <div class="form-group"> <label for="username">User</label> - <input type="text" class="form-control" id="username" ng-model="user"> {{user}} + <input type="text" class="form-control" id="username" ng-model="user"> <label for="date">Date (YYYY-MM-DD HH:MM)</label> <input type="datetime" class="form-control" id="date" ng-model="date"> diff --git a/views/index.html b/views/index.html index 9e03a25..778506f 100644 --- a/views/index.html +++ b/views/index.html @@ -95,7 +95,7 @@ <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar sidebar-fixed-left"> <li><a href="#dashboard">Dashboard</a></li> - <li><a href="#stats">Statistics</a></li> + <!--<li><a href="#stats">Statistics</a></li>--> <li><hr/></li> <li><a href="#users">Users</a></li> <li><a href="#settings">Global settings</a></li> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 ddbc857041aef49fa3d10c0bdcdb1c5822ae81fe Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 10 11:33:45 2015 +0200 display_name added --- app/modules/storage_modules/shelve_db.py | 34 +++++++++++++++--- static/js/controllers/dashboardCtrl.js | 1 + static/js/controllers/hostPageCtrl.js | 17 ++++++--- views/dashboard.html | 31 +++++++++++------ views/hostpage.html | 59 ++++++++++++++++++++++---------- views/settings.html | 10 +++--- 6 files changed, 109 insertions(+), 43 deletions(-) diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 9bdb31a..185a0b2 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -91,11 +91,11 @@ class shelve_db: # once the check, if it exists a connection that can lauch the module mod_conf['activated'] = True mod_conf['check_frequency'] = 600 - mod_conf['nb_min'] = 30 - mod_conf['nb_hour'] = 12 - mod_conf['nb_day'] = 15 - mod_conf['nb_week'] = 2 - mod_conf['nb_month'] = 6 + mod_conf['nb_min'] = 59 + mod_conf['nb_hour'] = 23 + mod_conf['nb_day'] = 7 + mod_conf['nb_week'] = 4 + mod_conf['nb_month'] = 12 mod_conf['nb_year'] = None mod_conf['subparts'] = [] # a list that can contain for example the names of the disk partitions unit = loaded_mod_moni[mod]['unit'] @@ -235,6 +235,10 @@ class shelve_db: self.db["hosts"][addr_host]['detected']['nmap'] = nmap_res self.db["hosts"][addr_host]["conf"]["connections"] = self.init_conn(nmap_res_data, conn_infos) os_host = nmap_res_data['os'] + if nmap_res_data['hostname'] != "": + self.db["hosts"][addr_host]["conf"]["display_name"] = nmap_res_data['hostname'] + else: + self.db["hosts"][addr_host]["conf"]["display_name"] = str(addr_host) self.db["hosts"][addr_host]["conf"]["monitoring"] = {} for mod in dict_mod_info: if os_host in dict_mod_info[mod]['compatible_os'] or 'all' in dict_mod_info[mod]['compatible_os']: @@ -421,6 +425,7 @@ class shelve_db: info_host["danger"].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'] res.append(info_host) except Exception: print traceback.format_exc() @@ -481,6 +486,7 @@ class shelve_db: res['custom_infos'] = self.db['hosts'][addr_host]['conf']['custom_info'] res['interventions'] = self.db['hosts'][addr_host]['conf']['interventions'] res['status'] = self.db['hosts'][addr_host]['status']['state'] + res['display_name'] = self.db['hosts'][addr_host]['conf']['display_name'] except Exception: print traceback.format_exc() finally: @@ -547,6 +553,24 @@ class shelve_db: finally: self.close_db() + def change_display_name(self, args): + """ + Called from the hostpage. + Updatdes the name to display of a given host. + :param args: a dictionary containing : + { + 'addr_host': string, + 'display_name': string, + } + """ + self.open_db() + try: + self.db['hosts'][args['addr_host']]['conf']['display_name'] = args['display_name'] + except Exception: + print traceback.format_exc() + finally: + self.close_db() + def update_custom_informations(self, args): """ Called from the hostpage. diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 46d26e1..d9d3695 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -38,6 +38,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } }); + $scope.host_filter = ''; // input field $scope.addr_filter = ''; // input field $scope.name_filter = ''; // input field diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 15326b2..a335d10 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -19,6 +19,7 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa } } "hostname":val, + "display_name": str, "status": string, "monitoring": { @@ -51,6 +52,8 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa $scope.subparts_checked = {}; + $scope.show_display_name_input = false; + $scope.selectedAll = false; $scope.blocks = {}; /* @@ -78,6 +81,13 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'update_nmap_attribute', 'args': args}})); }; + $scope.change_display_name = function (){ + var args = {}; + args['addr_host'] = $scope.addr_host; + args['display_name'] = $scope.items.display_name; + $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'change_display_name', 'args': args}})); + } + $scope.save_subpart = function (modname) { var args = {}; args['addr_host'] = $scope.addr_host; @@ -145,12 +155,11 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa }; $scope.$on("resCall", function (event, args) { - if (args.func == 'update_nmap_attribute') { + if (args.func == 'update_nmap_attribute' || + args.func == 'update_custom_informations' || + args.func == 'change_display_name') { $route.reload(); } - if (args.func == 'update_custom_informations') { - $route.reload(); - } }); $scope.model = {custom_infos : '', diff --git a/views/dashboard.html b/views/dashboard.html index 3fb3fd6..81afb6e 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -12,6 +12,11 @@ ng-show="items.length > 0"> <div class="col-xs-3"> + <label for="host_f">Host filter</label> + <input class="form-control" type="text" id="host_f" ng-model="host_filter"> + </div> + + <div class="col-xs-3"> <label for="addr_f">Address filter</label> <input class="form-control" type="text" id="addr_f" ng-model="addr_filter"> </div> @@ -46,8 +51,11 @@ <table class="table table-condensed table-hover"> <thead> <tr> - <th><a ng-click="order_val='addr'">Address</a></th> - <th><a ng-click="order_val='name'">Name</a></th> + <th><a ng-click="order_val='display_name'">Host</a></th> + <th> + <a ng-click="order_val='addr'">Address</a> <br/> + <a ng-click="order_val='name'">Name</a> + </th> <th><a ng-click="order_val='status'">Status</a></th> <th><a ng-click="order_val='group'">Group</a></th> <th><a ng-click="order_val='last_check'">Last check</a></th> @@ -57,16 +65,20 @@ <tbody> <tr ng-repeat="host in items | orderBy:order_val | - filter:{addr:addr_filter, name:name_filter, group:group_filter} | + filter:{addr:addr_filter, name:name_filter, display_name:host_filter, group:group_filter} | filter:filtering_status" class={{host.status}}> <!-- group.name:group_filter --> - <td><a href="#/hostpage/{{host.addr}}">{{host.addr}}</a></td> - <td>{{host.name}}</td> + <td><a href="#/hostpage/{{host.addr}}">{{host.display_name}}</a></td> + <td> + {{host.addr}}<br/> + {{host.name}} + </td> <td> - <a popover-placement="bottom" - popover="warning: {{host.warning}} ; danger: {{host.danger}}" - popover-trigger="mouseenter">{{host.status}} - </a> + <span popover-placement="bottom" + popover="warning: {{host.warning}} ; danger: {{host.danger}}" + popover-trigger="mouseenter" + style="text-decoration:underline">{{host.status}} + </span> </td> <td> <ui-select multiple @@ -87,7 +99,6 @@ </ui-select-choices> </ui-select> </td> - <!--<td>{{host.group}}</td>--> <td>{{host.last_check.split('.')[0]}}</td> <td> <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" diff --git a/views/hostpage.html b/views/hostpage.html index bbdabbd..c81d91f 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -1,16 +1,27 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Current state of {{items.hostname}}<small> {{addr_host}} - <button type="button" - class="btn btn-{{get_idle_state()}}" - aria-label="Button activation" - style="" - popover-placement="bottom" - popover="{{popover_message()}}" - popover-trigger="mouseenter" - ng-click="set_idle_state()"> - <span class="glyphicon glyphicon-off" aria-hidden="true"></span> - </button></small></h1> + <h1 class="page-header">Current state of + <span ng-click="show_display_name_input = true" + ng-show="show_display_name_input == false" + style="text-decoration:underline"> + {{items.display_name}} + </span> + <div class="row" + ng-show="show_display_name_input == true"> + <div class="col-lg-6"> + <div class="input-group"> + <input type="text" class="form-control" ng-model="items.display_name"> + <span class="input-group-btn"> + <button class="btn btn-default" type="button" ng-click="change_display_name()">Change display name</button> + </span> + </div> + </div> + </div> + + <small> + {{items.hostname}} ({{addr_host}}) + </small> + </h1> <button type="button" class="btn btn-primary btn-xs" @@ -18,14 +29,24 @@ <button type="button" class="btn btn-info btn-xs" - ng-click="launch_detection()" - popover="Needs SSH to be configured" - popover-trigger="mouseenter">Launch a full detection</button> + ng-click="launch_detection()">Launch a full detection</button> <button type="button" class="btn btn-danger btn-xs" ng-click="open_modal_confirm_delete()">Remove this host</button> + <button type="button" + class="btn btn-{{get_idle_state()}} btn-xs" + aria-label="Button activation" + style="" + popover-placement="bottom" + popover="{{popover_message()}}" + popover-trigger="mouseenter" + ng-click="set_idle_state()"> + <span class="glyphicon glyphicon-off" aria-hidden="true"> + </span> + </button> + <table class="table table-condensed table-hover" ng-show="items.status != 'idling'"> @@ -232,27 +253,27 @@ <div class="row" id="arch"> <div class="col-xs-2"> - <input type="number" min="0" max="59" class="form-control" + <input type="number" min="59" class="form-control" ng-model="arch_min"> minute </div> <div class="col-xs-2"> - <input type="number" min="0" max="59" class="form-control" + <input type="number" min="23" class="form-control" ng-model="arch_hour"> hour </div> <div class="col-xs-2"> - <input type="number" min="0" max="23" class="form-control" + <input type="number" min="7" class="form-control" ng-model="arch_day"> day </div> <div class="col-xs-2"> - <input type="number" min="0" max="7" class="form-control" + <input type="number" min="4" class="form-control" ng-model="arch_week"> week </div> <div class="col-xs-2"> - <input type="number" min="0" max="31" class="form-control" + <input type="number" min="12" class="form-control" ng-model="arch_month"> month </div> diff --git a/views/settings.html b/views/settings.html index f77c156..b406797 100644 --- a/views/settings.html +++ b/views/settings.html @@ -21,23 +21,23 @@ <label for="arch">Archives to keep (in check numbers). Keep empty for no limit.</label> <div class="row" id="arch"> <div class="col-xs-2"> - <input type="number" min="0" max="59" class="form-control" + <input type="number" min="59" class="form-control" ng-model="arch_min"> minute </div> <div class="col-xs-2"> - <input type="number" min="0" max="59" class="form-control" + <input type="number" min="23" class="form-control" ng-model="arch_hour"> hour </div> <div class="col-xs-2"> - <input type="number" min="0" max="23" class="form-control" + <input type="number" min="7" class="form-control" ng-model="arch_day"> day </div> <div class="col-xs-2"> - <input type="number" min="0" max="7" class="form-control" + <input type="number" min="4" class="form-control" ng-model="arch_week"> week </div> <div class="col-xs-2"> - <input type="number" min="0" max="31" class="form-control" + <input type="number" min="12" class="form-control" ng-model="arch_month"> month </div> <div class="col-xs-2"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 e920a7c52d608ca92f2917696c88c65e22dc9975 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Jun 10 14:53:59 2015 +0200 failures itterations added for notifications. reset on hostpage --- app/module_loader.py | 2 +- app/modules/storage_modules/shelve_db.py | 35 +++++++++++++++++++++++++++++--- views/hostpage.html | 6 ++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 5a05c7a..3399d87 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -294,7 +294,7 @@ class ModuleLoader: if part_name in self.loaded_mod_moni[part_name]['modules'] and \ getattr(self.loaded_mod_moni[part_name]['modules'][part_name]['imported'], 'connection') == "": # the module which check this part doesn't need a connection - port_list = self.db.get_host_informations(addr_host)['detected']['nmap']['openports'] + port_list = self.db.get_nmap_result(addr_host)['openports'] try: res_check = getattr(self.loaded_mod_moni[part_name]['modules'][part_name]['imported'], 'check')(addr_host, diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 185a0b2..91cd226 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -258,6 +258,9 @@ class shelve_db: # Create structure for archiving data self.db["hosts"][addr_host]["archive"] = {} self.db["hosts"][addr_host]["stats"] = {} + # set the initial number of failures to 0 + self.db['hosts'][addr_host]['status']['nb_warning'] = 0 + self.db['hosts'][addr_host]['status']['nb_danger'] = 0 except Exception: print traceback.format_exc() finally: @@ -487,6 +490,27 @@ class shelve_db: res['interventions'] = self.db['hosts'][addr_host]['conf']['interventions'] res['status'] = self.db['hosts'][addr_host]['status']['state'] res['display_name'] = self.db['hosts'][addr_host]['conf']['display_name'] + res['nb_warning'] = self.db['hosts'][addr_host]['status']['nb_warning'] + res['nb_danger'] = self.db['hosts'][addr_host]['status']['nb_danger'] + # we reset here the number of failures sent + self.db['hosts'][addr_host]['status']['nb_warning'] = 0 + self.db['hosts'][addr_host]['status']['nb_danger'] = 0 + except Exception: + print traceback.format_exc() + finally: + self.close_db() + return res + + def get_nmap_result(self, addr_host): + """ + Returns the stored nmap result of a host. + :param addr_host: The IP address of the host + :return: a dictionary containing the nmap result + """ + self.open_db() + res = {} + try: + res = json.loads(self.db['hosts'][addr_host]['detected']['nmap']) except Exception: print traceback.format_exc() finally: @@ -894,7 +918,6 @@ class shelve_db: dict_new_val, self.db['hosts'][addr_host]['conf']['monitoring'][mod_name]['minor_limit'], self.db['hosts'][addr_host]['conf']['monitoring'][mod_name]['major_limit']) - previous_val = self.db['hosts'][addr_host]["monitoring"][mod_name] self.db['hosts'][addr_host]['monitoring'][mod_name] = dict_new_val # updating the global state of the host self.db['hosts'][addr_host]['status']['date'] = dict_new_val['date'] @@ -912,6 +935,10 @@ class shelve_db: self.db['hosts'][addr_host]['status']['state'] = state # create a notification structure if the state is not a success if not dict_new_val['state'] == 'success': + # incrementation of the number of corresponding failures + self.db['hosts'][addr_host]['status']['nb_' + dict_new_val['state']] += 1 + #print mod_name + #print self.db['hosts'][addr_host]['status']['nb_' + dict_new_val['state']] dict_notif = self.create_notif_structure(addr_host, mod_name, dict_new_val['state']) # updating and saving statistics self.db['hosts'][addr_host]['stats'][mod_name] = \ @@ -1063,7 +1090,8 @@ class shelve_db: for notif_mod in self.db['hosts'][addr_host]['conf']['subscribers'][username][notif_type]: #{'priority': int, 'activated': bool} param_notif = self.db['hosts'][addr_host]['conf']['subscribers'][username][notif_type][notif_mod] - if param_notif['activated']: + if param_notif['activated'] and \ + param_notif['priority'] == self.db['hosts'][addr_host]['status']['nb_' + status]: if notif_mod not in dict_notif: dict_notif[notif_mod] = [] dict_notif[notif_mod].append({'user': self.db['users'][username]['settings'], @@ -1077,7 +1105,8 @@ class shelve_db: for username in self.db['groups'][group]['subscribers']: for notif_mod in self.db['groups'][group]['subscribers'][username][notif_type]: param_notif = self.db['groups'][group]['subscribers'][username][notif_type][notif_mod] - if param_notif['activated']: + if param_notif['activated'] and \ + param_notif['priority'] == self.db['hosts'][addr_host]['status']['nb_' + status]: title = "[Mum] " + status + " for " + addr_host + " on group " + group msg = "Mum reported a " + status + " from the " + moni_mod + " module on host " + \ addr_host + " member of group " + group + "." diff --git a/views/hostpage.html b/views/hostpage.html index c81d91f..f204aa5 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -1,6 +1,6 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Current state of + <h1 class="page-header">Current state of <span ng-click="show_display_name_input = true" ng-show="show_display_name_input == false" style="text-decoration:underline"> @@ -21,7 +21,9 @@ <small> {{items.hostname}} ({{addr_host}}) </small> - </h1> + </h1> + + <p>There has been {{items.nb_warning}} warning(s) and {{items.nb_danger}} danger(s) since the last visit on this page.</p> <button type="button" class="btn btn-primary btn-xs" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm