branch develop updated (b1f4907 -> 6871af3)
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 b1f4907 hostpage: detected configuration separated from nmap detection. subparts can be checked from the detected config, and the monitoring will check the selected subparts new 1f8df6f hostpage: checkboxes of subparts selected by the saved conf + http module returns a dict new 15b94ca hostpage: checkbox to selected all subparts added new 6871af3 full detection launched after scan + orderby directive fixed for tables The 3 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 6871af3b328a92205460fc3a5616b2b15146f4cf Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 13:49:51 2015 +0200 full detection launched after scan + orderby directive fixed for tables commit 15b94ca6def622b6df994c876924b1b88f418e7c Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 12:00:43 2015 +0200 hostpage: checkbox to selected all subparts added commit 1f8df6fc24d1b8899a3ec1965ddf583ba2ca691d Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 11:52:16 2015 +0200 hostpage: checkboxes of subparts selected by the saved conf + http module returns a dict Summary of changes: app/modules/monitoring_modules/http.py | 20 ++++++++++---------- app/modules/monitoring_modules/smtp.py | 23 ++++++++++++----------- app/modules/storage_modules/shelve_db.py | 5 ++++- app/mum.py | 1 + static/js/controllers/dashboardCtrl.js | 9 ++++++--- static/js/controllers/groupCtrl.js | 2 ++ static/js/controllers/hostPageCtrl.js | 13 +++++++++++-- views/dashboard.html | 12 ++++++------ views/groups.html | 10 ++++++---- views/hostpage.html | 4 ++-- 10 files changed, 60 insertions(+), 39 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 1f8df6fc24d1b8899a3ec1965ddf583ba2ca691d Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 11:52:16 2015 +0200 hostpage: checkboxes of subparts selected by the saved conf + http module returns a dict --- app/modules/monitoring_modules/http.py | 20 ++++++++++---------- app/modules/monitoring_modules/smtp.py | 23 ++++++++++++----------- app/modules/storage_modules/shelve_db.py | 5 ++++- static/js/controllers/hostPageCtrl.js | 4 ++-- views/hostpage.html | 1 - 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/app/modules/monitoring_modules/http.py b/app/modules/monitoring_modules/http.py index 07fb16a..0ef3cbe 100644 --- a/app/modules/monitoring_modules/http.py +++ b/app/modules/monitoring_modules/http.py @@ -11,21 +11,21 @@ return_dict = False def check(addr_host, port_list, cnfe): - res_http_check = False + res_http_check = {} http_port_found = False for i in range(len(port_list)): # for each http port detected for this host - try: - if port_list[i]['portname'] == part: - http_port_found = True + if port_list[i]['portname'] == part: + http_port_found = True + try: # the result of the check is true if urlopen returns the http code 200 - res_http_check = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']), - None, - 10 - ).getcode() == 200 - except Exception: - return False + res_http_check[port_list[i]['portid']] = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']), + None, + 10 + ).getcode() == 200 + except Exception: + res_http_check[port_list[i]['portid']] = False if not http_port_found: # if there is no http port detected for this host exception_inst = getattr(cnfe, "CommandNotFoundException")( diff --git a/app/modules/monitoring_modules/smtp.py b/app/modules/monitoring_modules/smtp.py index a2e466b..a6f19b9 100644 --- a/app/modules/monitoring_modules/smtp.py +++ b/app/modules/monitoring_modules/smtp.py @@ -7,30 +7,31 @@ block = "network" part = "smtp" unit = "bool" connection = "" -return_dict = False +return_dict = True def check(addr_host, port_list, cnfe): - res_smtp_check = False smtp_port_found = False + res_check = {} for i in range(len(port_list)): - try: - # for each smtp port detected for this host - if port_list[i]['portname'] == part: - smtp_port_found = True - # try to connect to this port, with a timeout of 10 seconds + # for each smtp port detected for this host + if port_list[i]['portname'] == part: + smtp_port_found = True + # try to connect to this port, with a timeout of 10 seconds + try: smtp_conn_inst = smtplib.SMTP(addr_host, int(port_list[i]['portid']), 10) # send a HELO request and should return a tuple with 250 as first member if OK - res_smtp_check = smtp_conn_inst.helo()[0] == 250 + res_check[port_list[i]['portid']] = smtp_conn_inst.helo()[0] == 250 # close the connection when finished smtp_conn_inst.quit() - except Exception: - return False + except Exception: + res_check[port_list[i]['portid']] = False + if not smtp_port_found: # if there is no smtp port detected for this host exception_inst = getattr(cnfe, "CommandNotFoundException")( part, addr_host ) raise exception_inst - return res_smtp_check + return res_check diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 344dc7c..5dc918a 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -436,9 +436,10 @@ class shelve_db: "value":string } }, - 'activated_monitoring':{ + "activated_monitoring":{ mod_name: bool }, + 'subparts": [str, ...] "custom_infos":string "status": string } @@ -456,8 +457,10 @@ class shelve_db: for mod in self.db['hosts'][addr_host]['detected']: res['detected'][mod] = json.loads(self.db['hosts'][addr_host]['detected'][mod]) res['activated_monitoring'] = {} + res['subparts'] = {} for mod in self.db['hosts'][addr_host]['conf']['monitoring']: res['activated_monitoring'][mod] = self.db['hosts'][addr_host]['conf']['monitoring'][mod]['activated'] + res['subparts'][mod] = self.db['hosts'][addr_host]['conf']['monitoring'][mod]['subparts'] 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'] diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 3d4f675..d9cf99f 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -150,11 +150,11 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar $scope.collapsed[modname] = true; $scope.subparts_checked[modname] = {} for(var key in args.detected[modname]){ - $scope.subparts_checked[modname][args.detected[modname][key]] = false; + $scope.subparts_checked[modname][args.detected[modname][key]] = args.subparts[modname].hasOwnProperty(key); } } } - else{ // we takes only monitoring updates + else{ // we take only monitoring updates $scope.items.monitoring = args.monitoring; $scope.items.status = args.status; } diff --git a/views/hostpage.html b/views/hostpage.html index ea883ef..c572372 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -108,7 +108,6 @@ <tr ng-repeat-end ng-repeat="(key, val) in mod" ng-show="modname != 'nmap'"> - <td>{{key}}</td> <td>{{val}}</td> <td><input type="checkbox" ng-model="subparts_checked[modname][val]"></td> </tr> -- 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 15b94ca6def622b6df994c876924b1b88f418e7c Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 12:00:43 2015 +0200 hostpage: checkbox to selected all subparts added --- static/js/controllers/hostPageCtrl.js | 9 +++++++++ views/hostpage.html | 1 + 2 files changed, 10 insertions(+) diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index d9cf99f..bb51ed3 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -50,6 +50,8 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar $scope.subparts_checked = {}; + $scope.selectedAll = false; + $scope.update_nmap_attribute = function(attribute, new_value){ var args = {}; args['attribute'] = attribute; @@ -71,6 +73,13 @@ mumApp.controller('hostPageCtrl', function($scope, $rootScope, $route, $routePar $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'set_subpart', 'args': args}})); } + $scope.checkAll = function(modname, bool){ + $scope.selectedAll = bool; + for(key in $scope.subparts_checked[modname]){ + $scope.subparts_checked[modname][key] = bool; + } + } + $scope.get_unit = function(mod_name){ res = ''; if($scope.items.loaded_moni_mod[mod_name].unit != 'bool'){ diff --git a/views/hostpage.html b/views/hostpage.html index c572372..ed8ad90 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -99,6 +99,7 @@ ng-show="modname != 'nmap'"> <th>{{modname}}</th> <th> + <input type="checkbox" ng-model="selectedAll" ng-click="checkAll(modname, !selectedAll)"> <button type="button" class="btn btn-info btn-xs" ng-click="save_subpart(modname)"> Monitore selected subparts -- 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 6871af3b328a92205460fc3a5616b2b15146f4cf Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Wed Apr 29 13:49:51 2015 +0200 full detection launched after scan + orderby directive fixed for tables --- app/mum.py | 1 + static/js/controllers/dashboardCtrl.js | 9 ++++++--- static/js/controllers/groupCtrl.js | 2 ++ views/dashboard.html | 12 ++++++------ views/groups.html | 10 ++++++---- views/hostpage.html | 2 +- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/app/mum.py b/app/mum.py index 1f9653d..8e2899e 100755 --- a/app/mum.py +++ b/app/mum.py @@ -30,6 +30,7 @@ class ThreadDetect(threading.Thread): except WebSocketError: pass for ip in json.loads(scanned_ip): + ml.run_all_detection_modules(ip) monitoring_intructions = ml.get_db().get_monitoring_instructions(ip) for instr in monitoring_intructions: ml.add_to_waiting_list(instr) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 33b1711..9e0760d 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -30,15 +30,17 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH $scope.items = DataHosts.Items; }); - $scope.filteredItems = []; + /*$scope.filteredItems = []; $scope.groupedItems = []; $scope.itemsPerPage = 25; $scope.pagedItems = []; - $scope.currentPage = 0; + $scope.currentPage = 0;*/ $scope.addr_filter = ''; $scope.name_filter = ''; + $scope.order_val = 'status' + if($routeParams.param == null){ $scope.status_filter = ["success", "warning", "danger", "idling", ""]; } @@ -61,6 +63,7 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH return($scope.status_filter.lastIndexOf(item.status) >= 0); } + /* // Concerning the table manipulation var searchMatch = function (haystack, needle) { return !needle || haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1; @@ -133,7 +136,7 @@ mumApp.controller('dashboardCtrl', function($scope, $filter, $routeParams, DataH $scope.search(); // $scope.groupsByAddr = {} - + */ /*$scope.getGroupsByAddr = function(addr) { res = "" for(var i = 0; i<$scope.items.length; i++){ diff --git a/static/js/controllers/groupCtrl.js b/static/js/controllers/groupCtrl.js index fb2e031..e436a23 100644 --- a/static/js/controllers/groupCtrl.js +++ b/static/js/controllers/groupCtrl.js @@ -36,6 +36,8 @@ mumApp.controller('groupCtrl', function($scope, $rootScope, $filter, $route, $ro $scope.grp = "all"; + $scope.order_val = "group"; + /*$scope.getGroupsByAddr = function(addr) { res = ""; for(var i = 0; i<$scope.items.length; i++){ diff --git a/views/dashboard.html b/views/dashboard.html index e3bfb08..c8d7444 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -33,11 +33,11 @@ <thead> <tr> - <th class="id" custom-sort order="'addr'" sort="sort">Address </th> - <th class="name" custom-sort order="'name'" sort="sort">Name </th> - <th class="description" custom-sort order="'status'" sort="sort">Status </th> - <th class="field3" custom-sort order="'group'" sort="sort">Group </th> - <th class="field4" custom-sort order="'last_check'" sort="sort">Last check </th> + <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> @@ -68,7 +68,7 @@ <pre>currentPage: {{sort|json}}</pre>--> <tbody> <tr ng-repeat="item in items | - orderBy:sort.sortingOrder:sort.reverse | + orderBy:order_val | filter:{addr:addr_filter, name:name_filter, group:group_filter} | filter:filtering_status" class={{item.status}}> <!-- group.name:group_filter --> diff --git a/views/groups.html b/views/groups.html index 76e5ef5..7db6edb 100644 --- a/views/groups.html +++ b/views/groups.html @@ -20,14 +20,16 @@ <table class="table table-striped table-hover"> <thead> <tr> - <th>Address</th> - <th>Name</th> - <th>Groups</th> + <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='group'">Groups</a></th> <th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll(!selectedAll)"></th> </tr> </thead> <tbody> - <tr ng-repeat="item in items | filter:{addr:addr_filter, name:name_filter, group:grp}"> <!-- group:{name:grp} --> + <tr ng-repeat="item in items | + filter:{addr:addr_filter, name:name_filter, group:grp} | + orderBy:order_val"> <!-- group:{name:grp} --> <td>{{item.addr}}</td> <td>{{item.name}}</td> <td>{{item.group}}</td> diff --git a/views/hostpage.html b/views/hostpage.html index ed8ad90..6bfcd42 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -107,7 +107,7 @@ </th> </tr> <tr ng-repeat-end - ng-repeat="(key, val) in mod" + ng-repeat="(key, val) in mod | orderBy : val" ng-show="modname != 'nmap'"> <td>{{val}}</td> <td><input type="checkbox" ng-model="subparts_checked[modname][val]"></td> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm