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 12a97adb17c602664565d81c3f136f9ae6c55b49 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Tue May 26 16:12:00 2015 +0200 added 5 and 10 min load mod + highest value on hostpage + 10 min fock default check + rounded stats + dashboard url updated on status filter --- ...oad_snmp_linux.py => load_10_min_snmp_linux.py} | 6 ++-- ...oad_snmp_linux.py => load_15_min_snmp_linux.py} | 2 +- ...{load_ssh_linux.py => load_15_min_ssh_linux.py} | 2 +- ...load_snmp_linux.py => load_5_min_snmp_linux.py} | 6 ++-- app/modules/storage_modules/shelve_db.py | 2 +- static/js/controllers/dashboardCtrl.js | 13 ++++++++- static/js/controllers/hostPageCtrl.js | 16 ++++++++++- views/dashboard.html | 5 +++- views/hostpage.html | 32 +++++++++++----------- 9 files changed, 56 insertions(+), 28 deletions(-) diff --git a/app/modules/monitoring_modules/15_min_load_snmp_linux.py b/app/modules/monitoring_modules/load_10_min_snmp_linux.py similarity index 68% copy from app/modules/monitoring_modules/15_min_load_snmp_linux.py copy to app/modules/monitoring_modules/load_10_min_snmp_linux.py index 9e0f615..69308fa 100644 --- a/app/modules/monitoring_modules/15_min_load_snmp_linux.py +++ b/app/modules/monitoring_modules/load_10_min_snmp_linux.py @@ -3,7 +3,7 @@ __author__ = 'aguilbaud' compatible_os = ['linux'] block = "hardware" -part = "min_15_load" +part = "load_10_min" unit = "" connection = "snmp" @@ -13,6 +13,6 @@ def check(conn, mnce, subparts): # X = 1 : 5 min load # X = 2 : 10 min load # X = 3 : 15 min load - oid_15_min_load = ".1.3.6.1.4.1.2021.10.1.3.3" - load = float(conn.exec_command(oid_15_min_load)) + oid_10_min_load = ".1.3.6.1.4.1.2021.10.1.3.2" + load = float(conn.exec_command(oid_10_min_load)) return load \ No newline at end of file diff --git a/app/modules/monitoring_modules/15_min_load_snmp_linux.py b/app/modules/monitoring_modules/load_15_min_snmp_linux.py similarity index 91% copy from app/modules/monitoring_modules/15_min_load_snmp_linux.py copy to app/modules/monitoring_modules/load_15_min_snmp_linux.py index 9e0f615..c24b33b 100644 --- a/app/modules/monitoring_modules/15_min_load_snmp_linux.py +++ b/app/modules/monitoring_modules/load_15_min_snmp_linux.py @@ -3,7 +3,7 @@ __author__ = 'aguilbaud' compatible_os = ['linux'] block = "hardware" -part = "min_15_load" +part = "load_15_min" unit = "" connection = "snmp" diff --git a/app/modules/monitoring_modules/load_ssh_linux.py b/app/modules/monitoring_modules/load_15_min_ssh_linux.py similarity index 97% rename from app/modules/monitoring_modules/load_ssh_linux.py rename to app/modules/monitoring_modules/load_15_min_ssh_linux.py index 4139812..aadfc63 100644 --- a/app/modules/monitoring_modules/load_ssh_linux.py +++ b/app/modules/monitoring_modules/load_15_min_ssh_linux.py @@ -3,7 +3,7 @@ __author__ = 'aguilbaud' compatible_os = ['linux'] block = "hardware" -part = "min_15_load" +part = "load_15_min" unit = "" connection = "ssh" diff --git a/app/modules/monitoring_modules/15_min_load_snmp_linux.py b/app/modules/monitoring_modules/load_5_min_snmp_linux.py similarity index 68% rename from app/modules/monitoring_modules/15_min_load_snmp_linux.py rename to app/modules/monitoring_modules/load_5_min_snmp_linux.py index 9e0f615..565b516 100644 --- a/app/modules/monitoring_modules/15_min_load_snmp_linux.py +++ b/app/modules/monitoring_modules/load_5_min_snmp_linux.py @@ -3,7 +3,7 @@ __author__ = 'aguilbaud' compatible_os = ['linux'] block = "hardware" -part = "min_15_load" +part = "load_5_min" unit = "" connection = "snmp" @@ -13,6 +13,6 @@ def check(conn, mnce, subparts): # X = 1 : 5 min load # X = 2 : 10 min load # X = 3 : 15 min load - oid_15_min_load = ".1.3.6.1.4.1.2021.10.1.3.3" - load = float(conn.exec_command(oid_15_min_load)) + oid_5_min_load = ".1.3.6.1.4.1.2021.10.1.3.1" + load = float(conn.exec_command(oid_5_min_load)) return load \ 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 1205b3a..4786513 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -91,7 +91,7 @@ class shelve_db: # all modules are added if the os is compatible, we'll try at least # once the check, if it exists a connection that can lauch the module mod_conf['activated'] = True - mod_conf['check_frequency'] = 60 + mod_conf['check_frequency'] = 600 mod_conf['nb_min'] = 30 mod_conf['nb_hour'] = 12 mod_conf['nb_day'] = 15 diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index ce4bc0c..073616f 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('dashboardCtrl', function ($scope, $filter, $routeParams, DataHosts) { +mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, DataHosts) { $scope.param = $routeParams.param; // parameter in URL, null if none /*$scope.sort = { @@ -47,7 +47,18 @@ mumApp.controller('dashboardCtrl', function ($scope, $filter, $routeParams, Data for (var i = 0; i<tab_params.length; i++) { $scope.status_filter.push(tab_params[i]); } + } + $scope.update_url = function () { + var url = "/dashboard/"; + var nb_attr = $scope.status_filter.length; + var i = 0; + while ( i<nb_attr - 1 ) { + url += $scope.status_filter[i] + ','; + i++; + } + url += $scope.status_filter[i]; + $location.path(url); } $scope.group_filter = ''; diff --git a/static/js/controllers/hostPageCtrl.js b/static/js/controllers/hostPageCtrl.js index 294faea..e802d61 100644 --- a/static/js/controllers/hostPageCtrl.js +++ b/static/js/controllers/hostPageCtrl.js @@ -84,7 +84,7 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa } } - $scope.get_unit = function(mod_name) { + $scope.get_unit = function (mod_name) { res = ''; if ($scope.items.loaded_moni_mod[mod_name].unit != 'bool') { res = $scope.items.loaded_moni_mod[mod_name].unit; @@ -92,6 +92,14 @@ mumApp.controller('hostPageCtrl', function ($scope, $rootScope, $route, $routePa return res; }; + $scope.get_maxvalue = function (modname) { + res = Number.MIN_SAFE_INTEGER; + for (var key in $scope.items.monitoring[modname].value){ + res = Math.max(res, $scope.items.monitoring[modname].value[key]); + } + return res; + } + $scope.get_type_of = function (attr) { return typeof(attr); }; @@ -839,6 +847,8 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance var nb_check = $scope.stats[$scope.selected_mod][$scope.selected_subpart].nb_check; $scope.mean_value = total / nb_check; + // rounding at 2 decimals + $scope.mean_value = Math.round($scope.mean_value * 100) / 100; }; var update_standard_derivation = function () { @@ -847,6 +857,8 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance var variance = m2 / Math.max(1, nb_check + 1); $scope.standard_derivation = Math.sqrt(variance); + // rounding at 2 decimals + $scope.standard_derivation = Math.round($scope.standard_derivation * 100) / 100; }; var update_slope_of_linear_regression = function () { @@ -860,6 +872,8 @@ mumApp.controller('ModalStatsCtrl', function ($scope, $rootScope, $modalInstance var mXY = lin_reg / nb_check; $scope.slope_lr = (mXY - mX * mY) / (mX2 - mX * mX); + // rounding at 2 decimals + $scope.slope_lr = Math.round($scope.slope_lr * 100) / 100; }; // angular_charts fields : diff --git a/views/dashboard.html b/views/dashboard.html index 5dbca83..db81440 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -18,7 +18,10 @@ <div class="col-xs-2"> <label for="status_f">Status filter</label> - <select multiple class="form-control input-sm" id="status_f" ng-model="status_filter"> + <select multiple class="form-control input-sm" + id="status_f" + ng-model="status_filter" + ng-change="update_url()"> <option>success</option> <option>warning</option> <option>danger</option> diff --git a/views/hostpage.html b/views/hostpage.html index 91d55d5..fc0309d 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -45,30 +45,30 @@ </thead> <tbody> - <tr ng-repeat-start="(itemname, item) in items.monitoring" - class={{item.state}} - > <!-- ng-show="items.activated_monitoring[itemname]" --> - <td>{{itemname}}</td> - <td ng-show="get_type_of(item.value) != 'object'">{{item.value}} {{get_unit(itemname)}}</td> - <td ng-show="get_type_of(item.value) == 'object'"> - <a ng-click="collapsed[itemname] = !collapsed[itemname]">▼</a> + <tr ng-repeat-start="(modname, mod) in items.monitoring" + class={{mod.state}} + > <!-- ng-show="items.activated_monitoring[modname]" --> + <td>{{modname}}</td> + <td ng-show="get_type_of(mod.value) != 'object'">{{mod.value}} {{get_unit(modname)}}</td> + <td ng-show="get_type_of(mod.value) == 'object'"> + <a ng-click="collapsed[modname] = !collapsed[modname]">{{get_maxvalue(modname)}} {{get_unit(modname)}} ▼</a> </td> - <td>{{item.state}}</td> - <td>{{item.date.split('.')[0]}}</td> + <td>{{mod.state}}</td> + <td>{{mod.date.split('.')[0]}}</td> <td><button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_conf(itemname)">Configure</button></td> + ng-click="open_modal_conf(modname)">Configure</button></td> <td><button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_stats(addr_host, itemname, '')">Archives</button></td> + ng-click="open_modal_stats(addr_host, modname, '')">Archives</button></td> <td><button type="button" class="btn btn-info btn-xs" - ng-click="check(itemname)">Check now</button></td> + ng-click="check(modname)">Check now</button></td> </tr> <tr ng-repeat-end - ng-repeat="(valname, val) in item.value" - collapse="collapsed[itemname]"> + ng-repeat="(valname, val) in mod.value" + collapse="collapsed[modname]"> <td>{{valname}}</td> - <td>{{val}} {{get_unit(itemname)}}</td> + <td>{{val}} {{get_unit(modname)}}</td> <td><button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_stats(addr_host, itemname, valname)">Archives</button></td> + ng-click="open_modal_stats(addr_host, modname, valname)">Archives</button></td> </tr> </tbody> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.