branch develop updated (383e5c4 -> b88b55e)
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 383e5c4 removing *.pyc files new 75490f3 result of monitoring can be shown on dashboard new b88b55e clicking on status on the navbar now puts the right status filter The 2 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 b88b55e16f189e1ca44dffa10ad322bafe2f982b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Feb 24 17:54:20 2015 +0100 clicking on status on the navbar now puts the right status filter commit 75490f3a101a72a3d289f9a780c01346d5d412a8 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Feb 24 17:28:18 2015 +0100 result of monitoring can be shown on dashboard Summary of changes: .../detection_modules/unix/kernel_detection.py | 1 - app/modules/storage_modules/shelve_db.py | 4 +- static/js/controllers/mainCtrl.js | 92 +++------------------- views/dashboard.html | 6 +- views/index.html | 8 +- 5 files changed, 19 insertions(+), 92 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 75490f3a101a72a3d289f9a780c01346d5d412a8 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Feb 24 17:28:18 2015 +0100 result of monitoring can be shown on dashboard --- app/modules/detection_modules/unix/kernel_detection.py | 1 - app/modules/storage_modules/shelve_db.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/modules/detection_modules/unix/kernel_detection.py b/app/modules/detection_modules/unix/kernel_detection.py index 3298a21..037098a 100644 --- a/app/modules/detection_modules/unix/kernel_detection.py +++ b/app/modules/detection_modules/unix/kernel_detection.py @@ -5,7 +5,6 @@ class kernel_detection: def __init__(self, conn, db): self.conn = conn self.db = db - print __name__ def run_detection(self): cmd = "cat /proc/version" diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 1a1ebea..5c78984 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -170,7 +170,7 @@ class shelve_db: info_host = {} info_host["addr"] = detected["addr"] info_host["name"] = detected["hostname"] - if "status" in self.db["hosts"][host]["status"]: + if "state" in self.db["hosts"][host]["status"]: info_host["status"] = self.db["hosts"][host]["status"]["state"] else: info_host["status"] = "" @@ -275,7 +275,7 @@ class shelve_db: :param val: the value observed """ self.open_db() - new_val = {"date": datetime.now(), "value" : val} + new_val = {"date": str(datetime.now()), "value" : val} try: if val >= self.db['hosts'][addr_host]['conf']['monitoring'][mod_name]['minor_limit']: new_val['state'] = 'warning' -- 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 b88b55e16f189e1ca44dffa10ad322bafe2f982b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue Feb 24 17:54:20 2015 +0100 clicking on status on the navbar now puts the right status filter --- static/js/controllers/mainCtrl.js | 92 +++++---------------------------------- views/dashboard.html | 6 +-- views/index.html | 8 ++-- 3 files changed, 17 insertions(+), 89 deletions(-) diff --git a/static/js/controllers/mainCtrl.js b/static/js/controllers/mainCtrl.js index 6762f89..5a29c00 100644 --- a/static/js/controllers/mainCtrl.js +++ b/static/js/controllers/mainCtrl.js @@ -10,6 +10,10 @@ mumApp.config(function($routeProvider){ templateUrl : 'dashboard.html', controller : 'mainController' }) + .when('/dashboard/:param',{ + templateUrl : 'dashboard.html', + controller : 'mainController' + }) .when('/groups',{ templateUrl : 'groups.html', controller : 'mainController' @@ -73,7 +77,14 @@ mumApp.controller('mainController', ['$scope', 'toastr', '$interval', '$filter', $scope.addr_filter = ''; $scope.name_filter = ''; - $scope.status_filter = ''; + + if($routeParams.param == null){ + $scope.status_filter = ''; + } + else{ + $scope.status_filter = $routeParams.param; + } + $scope.group_filter = ''; $scope.items = []; @@ -295,85 +306,6 @@ mumApp.controller('mainController', ['$scope', 'toastr', '$interval', '$filter', }; }]); -mumApp.controller('DetectController', ['$scope', 'toastr', '$interval', function($scope, toastr, $interval) { - $scope.master = {}; - $scope.ip_range = "198.116.0.1-10" // la plage d'ip entree dans le champ - $scope.state = ""; // l'etat general du scan en cours - $scope.validated = false; // pour afficher ou non certaines parties de la page - $scope.scan_is_over = false; // pour afficher ou non certaines parties de la page - $scope.ip_scanned = {}; - var ws = new WebSocket("ws://0.0.0.0:1337/websocket"); - - /*ws.onopen = function() { - ws.send("Hello, world"); - };*/ - - // actions effectuees lors de la reception d'un message via la websocket - ws.onmessage = function (evt) { - JSON.parse(evt.data, function (key, value) { - switch(parseInt(key)){ - case 20: // Success of a module execution - $scope.$apply(function(){ - $scope.state = "Success!"; - $scope.ip_scanned = value; - }); - toastr.success(value, "Success on module execution"); - case 21: // Informations concerning one host - break; - case 22: // List of hosts under monitoring - break; - case 30: - $scope.$apply(function(){ - $scope.state = value; - }); - toastr.info(value, "Current status is :"); - /* - $scope.$apply(function(){ - $scope.state = value - });*/ - break; - case 31: - params = value.split(','); - if(params[0]=='success'){ - $scope.pop_success("Success on " + params[1], params[2]); - } - else if(params[0] == 'warning'){ - $scope.pop_warning("Warning on " + params[1], params[2]); - } - else if(params[0] == 'danger'){ - $scope.pop_danger("Danger on "+ params[1], params[2]); - } - break; - case 40: - toastr.error(value, "Server error"); - break; - default: - break; - } - }); - - }; - - $scope.pop_success = function(title, msg){ - toastr.success(msg, title); - }; - - $scope.pop_warning = function(title, msg){ - toastr.success(msg, title); - }; - - $scope.pop_danger = function(title, msg){ - toastr.error(msg, title); - }; - - //lace la detection apres remplissage du champ et validation du formulaire - $scope.post_val = function(){ - var request = '{"10" : "' + $scope.ip_range + '"}'; - ws.send(request); - } -}]); - - mumApp.$inject = ['$scope', '$filter']; mumApp.directive("customSort", function() { diff --git a/views/dashboard.html b/views/dashboard.html index c7e739b..d405482 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -23,11 +23,7 @@ </div> <div class="col-xs-2"> <label for="group_f">Group filter</label> - <select class="form-control input-sm" id="group_f" ng-model="group_filter"> - <option>all</option> - <option>mygroup1</option> - <option>mygroup2</option> - <option>mygroup3</option> + <select class="form-control input-sm" id="group_f" ng-model="group_filter" ng-options="item for item in allGroups() | unique:'group'"> </select> </div> <table class="table table-condensed table-hover"> diff --git a/views/index.html b/views/index.html index 35b0712..bce6dea 100644 --- a/views/index.html +++ b/views/index.html @@ -41,13 +41,13 @@ <span class="icon-bar"></span> </button> <a class="navbar-brand" href="dashboard.html">Mum</a> - <p class="navbar-text navbar-left"><a href="dashboard.html" style="color:green">OK : {{stateNumber()[0]}}</a></p> - <p class="navbar-text navbar-left"><a href="dashboard.html" style="color:orange">Warning : {{stateNumber()[1]}}</a></p> - <p class="navbar-text navbar-left"><a href="dashboard.html" style="color:red">KO : {{stateNumber()[2]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/success" style="color:green">OK : {{stateNumber()[0]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/warning" style="color:orange">Warning : {{stateNumber()[1]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/danger" style="color:red">KO : {{stateNumber()[2]}}</a></p> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> - <li><a href="profile.html">Profile</a></li> + <li><a href="#profile">Profile</a></li> <li><a href="signin.html">Logout</a></li> </ul> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm