branch develop updated (9b0876f -> 7b6efcd)
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 9b0876f rewrite/refactor all script and package (deb, rpm) new f6a40a3 updated spec file from rules new 7193aec removed test if root for nmap + changed group view on dashboard new a30b6a6 updated ssh modules for using english language only + sms notif logging errors on every case new 9d646fd updated ssh modules for using english language only + sms notif logging errors on every case + new 79ae475 migration struct on ml new 9d064af timezone on e-mail module new 7501f04 Service view on dashboard new 476dd45 Category view on dashboard new d71e23a views on URL + fullscreen on every views new 0f0ae84 host view : name shown by default (1 line for 1 host) + better ng-show conditions for status new 7b6efcd Merge branch 'develop' of https://git.chorem.org/mum into develop The 11 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 7b6efcdc96fd2a8a37cc3e5d09bb2bba1eb9a5ef Merge: 0f0ae84 9b0876f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 16:37:11 2015 +0200 Merge branch 'develop' of https://git.chorem.org/mum into develop Conflicts: debian/rules redhat/mum.spec commit 0f0ae84d311f5cee5276b02a6d696fe080a70941 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 15:26:57 2015 +0200 host view : name shown by default (1 line for 1 host) + better ng-show conditions for status commit d71e23aaac97254ed5cd6f2fb0b015ef85ff0b62 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 15:08:58 2015 +0200 views on URL + fullscreen on every views commit 476dd45c9b628fe016ee65a8a542c629f9e8dfa8 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 12:28:51 2015 +0200 Category view on dashboard commit 7501f04ad937446e5cb64fab00f63dc6bff80db6 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 10:17:41 2015 +0200 Service view on dashboard commit 9d064afde03803b826c7028ec1bca89fd9557183 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 16:41:45 2015 +0200 timezone on e-mail module commit 79ae47529d8fa6c2ea7b532395f8b0430a30e4ce Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 15:58:25 2015 +0200 migration struct on ml commit 9d646fdcd92093c202eb1aa66ee38ce0143a793b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 15:41:53 2015 +0200 updated ssh modules for using english language only + sms notif logging errors on every case + commit a30b6a6246f6ce09abd5fba74907e2802382bce2 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 11:49:31 2015 +0200 updated ssh modules for using english language only + sms notif logging errors on every case commit 7193aecf2291dfeda0104db64df797f6aa062d99 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 11:47:00 2015 +0200 removed test if root for nmap + changed group view on dashboard commit f6a40a3fbdc340c81c59cec983dbea379fe5e3c3 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 29 14:14:17 2015 +0200 updated spec file from rules Summary of changes: app/module_loader.py | 16 +- app/modules/monitoring_modules/cpu_ssh_linux.py | 2 +- app/modules/monitoring_modules/disk_ssh_linux.py | 4 +- app/modules/monitoring_modules/http.py | 2 +- app/modules/monitoring_modules/swap_ssh_linux.py | 2 +- .../updated_packages_ssh_linux.py | 31 ++-- app/modules/notification_modules/email_notif.py | 4 +- app/modules/notification_modules/sms_notif.py | 12 +- app/modules/storage_modules/shelve_db.py | 43 ++++- app/websocket_func.py | 9 +- migration_rules.json | 8 +- static/js/controllers/dashboardCtrl.js | 128 ++++++++++++--- static/js/controllers/headCtrl.js | 3 + views/dashboard.html | 174 ++++++++++++++++++--- views/hostpage.html | 33 ++++ views/index.html | 22 ++- 16 files changed, 405 insertions(+), 88 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 f6a40a3fbdc340c81c59cec983dbea379fe5e3c3 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jun 29 14:14:17 2015 +0200 updated spec file from rules --- debian/rules | 3 ++- redhat/mum.spec | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/debian/rules b/debian/rules index ad8c683..4bf7fa7 100755 --- a/debian/rules +++ b/debian/rules @@ -68,11 +68,12 @@ install : build clean $(app) $(bower_components) $(static) $(views) $(install_sc cp $(in_venv) $(DEST_APP) cp $(mum_conf) $(DEST_CONF) cp $(mum_service) $(DEST_SYSTEMD) - cp $(readme) $(DEST_APP) + cp $(readme) $(DEST_DOC) cp $(requirements) $(DEST_APP) cp $(run) $(DEST_APP) cp $(mum_daemon) $(DEST_DOC) ln -s /usr/lib/mum/mum.sh -t $(DEST_BIN) + mv $(DEST_BIN)/mum.sh $(DEST_BIN)/mum find $(DEST_APP)/app -type f -iname "*.pyc" -exec rm -f {} \; rm -rf $(DEST_APP)/bower_components/jquery diff --git a/redhat/mum.spec b/redhat/mum.spec index 8e065ae..5fb369a 100644 --- a/redhat/mum.spec +++ b/redhat/mum.spec @@ -1,4 +1,4 @@ -%define _topdir /home/aguilbaud/rpmbuild +%define _topdir %(echo $PWD)/ %define name mum %define release 1 %define version 0.1 @@ -7,6 +7,10 @@ %define DEST_CONF /etc/mum %define DEST_VAR /var/lib/mum %define DEST_BIN /usr/bin +%define DEST_INIT_D /etc/init.d +%define DEST_SYSTEMD /usr/lib/systemd/system +%define DEST_DOC /usr/share/doc/mum +%define DEST_LOGS /var/log/mum Summary: Machines Under Monitoring License: GPL @@ -42,11 +46,13 @@ cp -R views %{buildroot}/%{DEST_APP} cp install.sh %{buildroot}/%{DEST_APP} cp in-venv.sh %{buildroot}/%{DEST_APP} cp mum.conf %{buildroot}/%{DEST_CONF} -#cp $(mum_daemon) $(DEST_INIT_D) -cp README %{buildroot}/%{DEST_APP} +cp mum.service %{buildroot}/%{DEST_SYSTEMD} +cp mum-daemon.sh %{buildroot}/%{DEST_DOC} +cp README %{buildroot}/%{DEST_DOC} cp requirements.txt %{buildroot}/%{DEST_APP} cp mum.sh %{buildroot}/%{DEST_APP} -ln -s mum.sh %{buildroot}/%{DEST_BIN} +ln -s /usr/lib/mum/mum.sh -t %{buildroot}/%{DEST_BIN} +mv %{buildroot}/$(DEST_BIN)/mum.sh %{buildroot}/$(DEST_BIN)/mum find %{buildroot}/%{DEST_APP}/app -type f -iname "*.pyc" -exec rm -f {} \; rm -rf %{buildroot}/%{DEST_APP}/bower_components/jquery @@ -60,10 +66,12 @@ rm -rf %{buildroot}/%{DEST_APP}/bower_components/jquery %{DEST_APP}/install.sh %{DEST_APP}/in-venv.sh %{DEST_CONF}/mum.conf -%{DEST_APP}/README +%{DEST_SYSTEMD}/mum.service +%{DEST_DOC}/mum-daemon.sh +%{DEST_DOC}/README %{DEST_APP}/requirements.txt %{DEST_APP}/mum.sh -%{DEST_BIN}/mum.sh +%{DEST_BIN}/mum %changelog * Thu May 21 2015 Alexis Guilbaud <aguilbaud@codelutin.com> - 0.1-1 -- 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 7193aecf2291dfeda0104db64df797f6aa062d99 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 11:47:00 2015 +0200 removed test if root for nmap + changed group view on dashboard --- app/websocket_func.py | 6 +--- static/js/controllers/dashboardCtrl.js | 39 ++++++++++------------ views/dashboard.html | 61 +++++++++++++++++++++++++--------- views/hostpage.html | 33 ++++++++++++++++++ views/index.html | 22 +++++++++--- 5 files changed, 116 insertions(+), 45 deletions(-) diff --git a/app/websocket_func.py b/app/websocket_func.py index 39c8f4f..4baa086 100644 --- a/app/websocket_func.py +++ b/app/websocket_func.py @@ -50,11 +50,7 @@ def NMAP_SCAN_DEMAND(msg, ws, ml): ml.create_empty_host(msg["NMAP_SCAN_DEMAND"]["ip_range"], ws) ws.send(json.dumps({"SUCCESS_MODULE": "New host successfully created"})) else: - if os.getegid() != 0: - logger.error("Cannot run nmap without root privileges.") - ws.send(json.dumps({"ERROR": "Cannot run nmap without root privileges."})) - else: - start_first_detection(msg["NMAP_SCAN_DEMAND"], ml, ws) + start_first_detection(msg["NMAP_SCAN_DEMAND"], ml, ws) # asked from hostpage diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 6f1dc8d..94577cc 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -206,37 +206,34 @@ 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 = {}; //{addr: color} + $scope.group_obj[current_group_name].total = 0; + $scope.group_obj[current_group_name].success = 0; + $scope.group_obj[current_group_name].warning = 0; + $scope.group_obj[current_group_name].danger = 0; + $scope.group_obj[current_group_name].idling = 0; $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[current_host_name] = get_color($scope.items[pos_host].status); + $scope.group_obj[current_group_name].total ++; if ($scope.items[pos_host].status == 'danger'){ + $scope.group_obj[current_group_name].danger ++; $scope.group_obj[current_group_name].status = 'danger'; } - else if ($scope.items[pos_host].status == 'warning' && $scope.group_obj[current_group_name].status != 'danger'){ - $scope.group_obj[current_group_name].status = 'warning'; + else if ($scope.items[pos_host].status == 'warning'){ + $scope.group_obj[current_group_name].warning ++; + if($scope.group_obj[current_group_name].status != 'danger'){ + $scope.group_obj[current_group_name].status = 'warning'; + } + } + else if ($scope.items[pos_host].status == 'success'){ + $scope.group_obj[current_group_name].success ++; + } + else{ + $scope.group_obj[current_group_name].idling ++; } } } }; - - 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; - } }); \ No newline at end of file diff --git a/views/dashboard.html b/views/dashboard.html index 9996add..bccba57 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -119,8 +119,13 @@ <span popover-placement="bottom" popover="warning: {{host.warning}} ; danger: {{host.danger}}" popover-trigger="mouseenter" - style="text-decoration:underline">{{host.status}} + ng-show="host.status=='success'" + style="text-decoration:underline"> + {{host.status}} </span> + <span ng-show="host.status!='success'"> + warning: {{host.warning}} ; danger: {{host.danger}} + </span>({{host.nb_mod}}) </td> <td> <ui-select multiple @@ -176,37 +181,63 @@ <!-- Group view --> - <div ng-show="view == 'group_view' && items.length > 0"> + <div ng-show="view == 'group_view' && items.length > 0">{{group_obj}} <h2 class="sub-header">Hosts currently on monitoring (by group)</h2> <div class="row"> + <div class="col-xs-2"> + <label for="status_f_grp">Status filter</label> + <select multiple class="form-control input-sm" + id="status_f_grp" + ng-model="status_filter" + ng-change="update_url()"> + <option>success</option> + <option>warning</option> + <option>danger</option> + <option>idling</option> + </select> + </div> - <!-- - <div class="col-xs-3"> - <label for="name_f_grp_view">Name filter</label> - <input class="form-control" type="text" id="name_f_grp_view" ng-model="name_filter"> - </div>--> + <div class="col-xs-2"> + <label for="group_f_grp">Group filter</label> + <select class="form-control input-sm" + id="group_f_grp" + ng-model="group_filter" + ng-options="group for group in allGroups() | unique:'group'" + ng-change="update_url()"> + </select> + </div> <table class="table table-condensed table-hover"> <thead> <tr> <th><a ng-click="order_val='group'">Group</a></th> - <th><a ng-click="order_val='host'">Hosts</a></th> - <th><a ng-click="order_val='status'">Status</a></th> + <th><a ng-click="order_val='host'">Machines</a></th> </tr> </thead> <tbody> <tr ng-repeat="(groupname, group) in group_obj | - orderBy:order_val" + orderBy:order_val + filter:{groupname:group_filter}" class="{{group.status}}"> <!-- group:{name:grp} --> <td>{{groupname}}</td> <td> - <div ng-repeat="(host, color) in group.hosts"> - <a href="#/hostpage/{{host}}" - style="color: {{color}}">{{host}}</a> - </div> + <p class="navbar-text navbar-left"><a href="#dashboard" style="color:grey"> + Total: {{group.total}} + </a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?group_filter={{groupname}}&status_filter={{group.status}}" style="color:green"> + OK: {{group.success}} + </a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?group_filter={{groupname}}&status_filter={{group.status}}" style="color:orange"> + Warning: {{group.warning}} + </a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?group_filter={{groupname}}&status_filter={{group.status}}" style="color:red"> + KO: {{group.danger}} + </a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?group_filter={{groupname}}&status_filter={{group.status}}" style="color:grey"> + Idling: {{group.idling}} + </a></p> </td> - <td>{{group.status}}</td> <td> <button type="button" class="btn btn-{{get_group_sub_num(groupname).btn_type}} btn-xs" diff --git a/views/hostpage.html b/views/hostpage.html index 63b3143..b67b034 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -477,6 +477,32 @@ </li> </ul>--> + <div class="row"> + <input type="radio" value="login"> Login/Password + <input type="radio" value="key"> Key couple + </div> + + <div class="row"> + <div class="col-xs-3"> + <label for="usrname">Login</label> + <input type="text" id="usrname" ng-model="username"/> + </div> + <div class="col-xs-3"> + <label for="password">Password</label> + <input type="password" id="password" ng-model="password"/> + </div> + </div> + + <div class="row"> + <div class="col-xs-3"> + <label for="private_key">Select a private key</label> + <select class="form-control input-sm" id="private_key" + ng-model="private_key" + ng-options="key as key for key in keys_list"></select> + </div> + </div> + + <!-- <div class="row" ng-show="show_form('private_key')"> <div class="col-xs-3"> <label for="private_key">Select a private key</label> @@ -516,6 +542,13 @@ <input type="password" id="password" ng-model="password"/> </div> </div> + + <div class="row" ng-show="show_form('domain')"> + <div class="col-xs-3"> + <label for="domain">Domain</label> + <input type="text" id="domain" ng-model="username"/> + </div> + </div>--> </div> <div class="modal-footer"> diff --git a/views/index.html b/views/index.html index 58fca9d..a44f81e 100644 --- a/views/index.html +++ b/views/index.html @@ -58,10 +58,10 @@ </button> <a class="navbar-brand" href="#dashboard.html">Mum</a> <p class="navbar-text navbar-left"><a href="#dashboard" style="color:grey">Total : {{stateNumber()[0]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/success" style="color:green">OK : {{stateNumber()[1]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/warning" style="color:orange">Warning : {{stateNumber()[2]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/danger" style="color:red">KO : {{stateNumber()[3]}}</a></p> - <p class="navbar-text navbar-left"><a href="#dashboard/idling" style="color:grey">Idling : {{stateNumber()[4]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?status_filter=success" style="color:green">OK : {{stateNumber()[1]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?status_filter=warning" style="color:orange">Warning : {{stateNumber()[2]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?status_filter=danger" style="color:red">KO : {{stateNumber()[3]}}</a></p> + <p class="navbar-text navbar-left"><a href="#dashboard/?status_filter=idling" style="color:grey">Idling : {{stateNumber()[4]}}</a></p> <p class="navbar-text navbar-left"> <a href="#scan"> <button type="button" class="btn btn-success btn-xs" aria-label="Add host" @@ -209,6 +209,20 @@ </div> </script> + <script type="text/ng-template" id="modal_notes_label.html"> + <div class="modal-header"> + <h3 class="modal-title">Add a note</h3> + </div> + + <div class="modal-body"> + <textarea class="form-control" rows="20" ng-model="log_content"></textarea> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button> + <!--<button type="button" class="btn btn-primary" ng-click="save()">Save changes</button>--> + </div> + </script> + </body> </html> -- 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 a30b6a6246f6ce09abd5fba74907e2802382bce2 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 11:49:31 2015 +0200 updated ssh modules for using english language only + sms notif logging errors on every case --- app/modules/monitoring_modules/cpu_ssh_linux.py | 2 +- app/modules/monitoring_modules/disk_ssh_linux.py | 4 +-- app/modules/monitoring_modules/http.py | 2 +- app/modules/monitoring_modules/process.py | 35 ++++++++++++++++++++++ app/modules/monitoring_modules/swap_ssh_linux.py | 2 +- .../updated_packages_ssh_linux.py | 31 ++++++++++--------- app/modules/notification_modules/sms_notif.py | 12 +++++--- 7 files changed, 65 insertions(+), 23 deletions(-) diff --git a/app/modules/monitoring_modules/cpu_ssh_linux.py b/app/modules/monitoring_modules/cpu_ssh_linux.py index b34a0a3..e7c7794 100644 --- a/app/modules/monitoring_modules/cpu_ssh_linux.py +++ b/app/modules/monitoring_modules/cpu_ssh_linux.py @@ -13,7 +13,7 @@ def check(conn, mnce, subparts): """ Returns the greatest between the user and system CPU charge """ - cmd = "top -b -n 1" + cmd = "LANG=C top -b -n 1" stdout = conn.exec_command(cmd) # output example: diff --git a/app/modules/monitoring_modules/disk_ssh_linux.py b/app/modules/monitoring_modules/disk_ssh_linux.py index 41af338..632bca5 100644 --- a/app/modules/monitoring_modules/disk_ssh_linux.py +++ b/app/modules/monitoring_modules/disk_ssh_linux.py @@ -12,12 +12,12 @@ connection = "ssh" def check(conn, mnce, subparts): - cmd = "df -h" + cmd = "LANG=C df -h" stdout = conn.exec_command(cmd) # output example: """ - Sys. fich. Taille Util. Dispo Uti% Monte sur + Filesystem Size Used Avail Use% Mounted on rootfs 55G 11G 42G 21% / udev 10M 0 10M 0% /dev tmpfs 579M 1,1M 578M 1% /run diff --git a/app/modules/monitoring_modules/http.py b/app/modules/monitoring_modules/http.py index 87e09cd..f95bb5e 100644 --- a/app/modules/monitoring_modules/http.py +++ b/app/modules/monitoring_modules/http.py @@ -23,7 +23,7 @@ def check(addr_host, port_list, cnfe): res_http_check[port_list[i]['portid']] = urllib2.urlopen("http://" + addr_host + ":" + str(port_list[i]['portid']), None, 10 - ).getcode() == 200 + ).getcode() == 200 or 401 except Exception: res_http_check[port_list[i]['portid']] = False if not http_port_found: diff --git a/app/modules/monitoring_modules/process.py b/app/modules/monitoring_modules/process.py new file mode 100644 index 0000000..ce092d4 --- /dev/null +++ b/app/modules/monitoring_modules/process.py @@ -0,0 +1,35 @@ +__author__ = 'aguilbaud' + +compatible_os = ['linux'] +block = "software" +part = "Process" +name = "Process SSH" +unit = "" +connection = "ssh" + +param = { + {"proc_name", {'type': 'string', 'value': '', 'doc': "The name of the process"}}, +} + +def check(conn, mnce, params): + cmd = "LANG=C ps -C " + params['proc_name'] + " -opid" + stdout = conn.exec_command(cmd) + + # output if process is running + """ + PID + 2993 + 2994 + 2995 + 2996 + 2997 + 2998 + """ + # output if process is not running + """ + PID + """ + + process_number_running = len(stdout.splitlines()) - 1 + + return process_number_running \ No newline at end of file diff --git a/app/modules/monitoring_modules/swap_ssh_linux.py b/app/modules/monitoring_modules/swap_ssh_linux.py index daf1348..36d673a 100644 --- a/app/modules/monitoring_modules/swap_ssh_linux.py +++ b/app/modules/monitoring_modules/swap_ssh_linux.py @@ -10,7 +10,7 @@ connection = "ssh" def check(conn, mnce, subparts): - cmd = "free -m" + cmd = "LANG=C free -m" stdout = conn.exec_command(cmd) # output example: diff --git a/app/modules/monitoring_modules/updated_packages_ssh_linux.py b/app/modules/monitoring_modules/updated_packages_ssh_linux.py index 8436752..4662809 100644 --- a/app/modules/monitoring_modules/updated_packages_ssh_linux.py +++ b/app/modules/monitoring_modules/updated_packages_ssh_linux.py @@ -1,4 +1,6 @@ # -*- coding: utf8 -*- +import re + __author__ = 'aguilbaud' @@ -11,23 +13,24 @@ connection = "ssh" def check(conn, mnce, subparts): - cmd = "apt-get upgrade -s" + cmd = "LANG=C apt-get upgrade -s" stdout = conn.exec_command(cmd) # Output example: """ - NOTE: Ceci n'est qu'une simulation ! - apt-get a besoin des privilèges du superutilisateur - pour pouvoir vraiment fonctionner. - Veuillez aussi noter que le verrouillage est désactivé, - et la situation n'est donc pas forcément représentative - de la réalité ! - Lecture des listes de paquets... Fait - Construction de l'arbre des dépendances - Lecture des informations d'état... Fait - 0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour. + NOTE: This is only a simulation! + apt-get needs root privileges for real execution. + Keep also in mind that locking is deactivated, + so don't depend on the relevance to the real current situation! + Reading package lists... Done + Building dependency tree + Reading state information... Done + The following packages will be upgraded: + linux-image-3.16.0-0.bpo.4-amd64 linux-image-3.2.0-4-amd64 linux-libc-dev p7zip-full tzdata tzdata-java + 6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. + Inst linux-image-3.16.0-0.bpo.4-amd64 [3.16.7-ckt9-3~deb8u1~bpo70+1] (3.16.7-ckt11-1~bpo70+1 Debian Backports:/wheezy-backports [amd64]) + Inst linux-image-3.2.0-4-amd64 [3.2.68-1+deb7u1] (3.2.68-1+deb7u2 Debian-Security:7.0/oldstable [amd64]) """ - tab_res = stdout.split(':') - res_check = len(tab_res) <= 2 - return res_check \ No newline at end of file + res_check = re.search("The following packages will be upgraded:", stdout) is not None + return res_check diff --git a/app/modules/notification_modules/sms_notif.py b/app/modules/notification_modules/sms_notif.py index c758e60..2401f60 100644 --- a/app/modules/notification_modules/sms_notif.py +++ b/app/modules/notification_modules/sms_notif.py @@ -30,9 +30,13 @@ class SMS: if hasattr(e,'code'): if e.code == 400: self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 400: One of the url parameters is missing.') - if e.code == 402: + elif e.code == 402: self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 402: Too many SMS have been sent in short time.') - if e.code == 403: + elif e.code == 403: self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 403: The service is not activated or wrong login/key.') - if e.code == 500: - self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 500: Server error. Please try again later.') \ No newline at end of file + elif e.code == 404: + self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 404: The SMS URL does not exists.') + elif e.code == 500: + self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code 500: Server error. Please try again later.') + else: + self.logger.error('sms_notif ' + self.user_data['sms_url'] + ' code ' + e.code) \ No newline at end of file -- 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 9d646fdcd92093c202eb1aa66ee38ce0143a793b Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 15:41:53 2015 +0200 updated ssh modules for using english language only + sms notif logging errors on every case + --- app/modules/notification_modules/email_notif.py | 4 +++- views/dashboard.html | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/modules/notification_modules/email_notif.py b/app/modules/notification_modules/email_notif.py index 9769242..fa776a1 100644 --- a/app/modules/notification_modules/email_notif.py +++ b/app/modules/notification_modules/email_notif.py @@ -2,7 +2,7 @@ __author__ = 'aguilbaud' import smtplib from email.mime.text import MIMEText - +from datetime import datetime def get_class_name(): return "EMail" @@ -24,6 +24,8 @@ class EMail: msg_to_send['Subject'] = self.title msg_to_send['From'] = self.settings['smtp_address'] msg_to_send['To'] = self.user_data['email'] + date = datetime.now() + msg_to_send['Date'] = date.isoformat() if self.settings['smtp_port'] == '': s = smtplib.SMTP(self.settings['smtp_server']) else: diff --git a/views/dashboard.html b/views/dashboard.html index bccba57..18ec320 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -217,8 +217,7 @@ <tbody> <tr ng-repeat="(groupname, group) in group_obj | - orderBy:order_val - filter:{groupname:group_filter}" + orderBy:order_val" class="{{group.status}}"> <!-- group:{name:grp} --> <td>{{groupname}}</td> <td> -- 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 79ae47529d8fa6c2ea7b532395f8b0430a30e4ce Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 15:58:25 2015 +0200 migration struct on ml --- app/module_loader.py | 16 ++++++------- app/modules/monitoring_modules/process.py | 35 --------------------------- app/modules/storage_modules/shelve_db.py | 40 +++++++++++++++++++++++++++---- migration_rules.json | 8 +++++-- 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index 4f4b2cb..90550f2 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -31,8 +31,8 @@ class ModuleLoader: self.conf = conf self.db = self.load_db() db_version = self.db.get_db_version() - if float(db_version) < mum_vesion: - self.migrate_db(db_version) + #if float(db_version) < mum_vesion: + # self.migrate_db(db_version) self.db.reset_tasks() self.loaded_mod_moni = {} # See load_all_monitoring_modules self.loaded_mod_detect = {} # See load_all_detection_modules @@ -60,7 +60,6 @@ class ModuleLoader: A backup of the previous database is also done. """ # backup creation - """ db_loc_tree = self.conf['db_location'].split('/') old_db_name = db_loc_tree[len(db_loc_tree) -1] db_loc_tree.pop(len(db_loc_tree) -1) @@ -71,12 +70,11 @@ class ModuleLoader: migration_rules = json.loads(migration_rules_file.read()) for version in migration_rules: if float(version) > current_db_version: - for add_instr in migration_rules[version]["add_field"]: - self.db.add_field(add_instr, migration_rules[version]["add_field"][add_instr]) - for rem_instr in migration_rules[version]["rem_field"]: - self.db.rem_field(rem_instr, migration_rules[version]["rem_field"][rem_instr]) - self.db.set_db_version(version) - """ + for new_val in migration_rules[version]["add_field"]: + self.db.add_field(new_val, migration_rules[version]["add_field"][new_val]) + for val_to_rem in migration_rules[version]["rem_field"]: + self.db.rem_field(val_to_rem, migration_rules[version]["rem_field"][val_to_rem]) + #self.db.set_db_version(version) return None def get_public_keys_loc(self): diff --git a/app/modules/monitoring_modules/process.py b/app/modules/monitoring_modules/process.py deleted file mode 100644 index ce092d4..0000000 --- a/app/modules/monitoring_modules/process.py +++ /dev/null @@ -1,35 +0,0 @@ -__author__ = 'aguilbaud' - -compatible_os = ['linux'] -block = "software" -part = "Process" -name = "Process SSH" -unit = "" -connection = "ssh" - -param = { - {"proc_name", {'type': 'string', 'value': '', 'doc': "The name of the process"}}, -} - -def check(conn, mnce, params): - cmd = "LANG=C ps -C " + params['proc_name'] + " -opid" - stdout = conn.exec_command(cmd) - - # output if process is running - """ - PID - 2993 - 2994 - 2995 - 2996 - 2997 - 2998 - """ - # output if process is not running - """ - PID - """ - - process_number_running = len(stdout.splitlines()) - 1 - - return process_number_running \ 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 ea72a11..309b0c7 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -75,15 +75,46 @@ class shelve_db: self.logger.error(traceback.format_exc()) finally: self.close_db() - """ - def add_field(self, field, tab_loc): + def add_field(self, new_val_name, dict_instr): self.open_db() + path = dict_instr['path'] + new_val = dict_instr['new_val'] + path_tab = [] try: - for key in tab_loc: - if key == "*": + for i in range(len(path)): + if path[i] == '*': + + except Exception: + self.logger.error(traceback.format_exc()) + finally: + self.close_db() + + + def add_field_req(self, path_list, pos_path, path, field_to_add_name, field_to_add_val): + if pos_path < len(path): + current_key = str(path[pos_path]) + if current_key == '*': + print path + for key in self.get_nested_default(dict(self.db), path, None): + path[pos_path] = key + return self.add_field_req(path_list, pos_path + 1, path, field_to_add_name, field_to_add_val) + else: + return self.add_field_req(path_list, pos_path + 1, path, field_to_add_name, field_to_add_val) + else: + if pos_path == 0: + path_list.append('') + return path_list + else: + path_list.append(path) + return path_list """ + + @staticmethod + def get_nested_default(d, path, new_elem): + return reduce(lambda d, k: d.setdefault(k, new_elem), path, d) + def reset_tasks(self): self.open_db() try: @@ -460,6 +491,7 @@ class shelve_db: 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'] + info_host['nb_mod'] = len(self.db['hosts'][host]['monitoring'].keys()) res.append(info_host) except Exception: self.logger.error(traceback.format_exc()) diff --git a/migration_rules.json b/migration_rules.json index faac1bd..f398cfa 100644 --- a/migration_rules.json +++ b/migration_rules.json @@ -2,7 +2,11 @@ "0.2": { "add_field":{ - "test": ["hosts", "*"] - } + "test":{ + "path": ["hosts", "*"], + "new_val": {} + } + }, + "rem_field":{} } } \ No newline at end of file -- 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 9d064afde03803b826c7028ec1bca89fd9557183 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jul 3 16:41:45 2015 +0200 timezone on e-mail module --- app/modules/notification_modules/email_notif.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/notification_modules/email_notif.py b/app/modules/notification_modules/email_notif.py index fa776a1..a62ee93 100644 --- a/app/modules/notification_modules/email_notif.py +++ b/app/modules/notification_modules/email_notif.py @@ -2,7 +2,7 @@ __author__ = 'aguilbaud' import smtplib from email.mime.text import MIMEText -from datetime import datetime +from datetime import datetime, timedelta def get_class_name(): return "EMail" @@ -24,7 +24,7 @@ class EMail: msg_to_send['Subject'] = self.title msg_to_send['From'] = self.settings['smtp_address'] msg_to_send['To'] = self.user_data['email'] - date = datetime.now() + date = datetime.now() - timedelta(hours=9) # for time in UTC+1 msg_to_send['Date'] = date.isoformat() if self.settings['smtp_port'] == '': s = smtplib.SMTP(self.settings['smtp_server']) -- 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 7501f04ad937446e5cb64fab00f63dc6bff80db6 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 10:17:41 2015 +0200 Service view on dashboard --- app/modules/storage_modules/shelve_db.py | 3 ++- static/js/controllers/dashboardCtrl.js | 33 +++++++++++++++++++++++++ views/dashboard.html | 42 +++++++++++++++++++++++++++++++- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/app/modules/storage_modules/shelve_db.py b/app/modules/storage_modules/shelve_db.py index 309b0c7..7a729f3 100644 --- a/app/modules/storage_modules/shelve_db.py +++ b/app/modules/storage_modules/shelve_db.py @@ -452,7 +452,8 @@ class shelve_db: }, "warning": [mod_name, ...], "danger": [mod_name, ...], - "nb_subscribers": int + "nb_subscribers": int, + "display_name": str }, ... ] diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 94577cc..a638747 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -14,6 +14,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r { "addr":"192.168.74.1", "name":"www.example.com", + "display_name": str, "status":val, //"success" or "warning" or "danger" or "" "group":[ "all", ...], "last_check":string @@ -236,4 +237,36 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } }; + + /*** SERVICE VIEW FUNCIONS ***/ + + $scope.service_obj = {}; /* {mod_name: {'warning': [addr, ...], 'danger': [addr, ...]}, ...} */ + + $scope.is_services_in_alert = function (){ + return Object.keys($scope.service_obj).length > 0; + }; + + $scope.update_service_obj = function (){ + for (var i = 0, l=$scope.items.length; i<l; i++){ + tab_warning = $scope.items[i].warning; + for (var j = 0, l_warn = tab_warning.length; j<l_warn; j++){ + if(!$scope.service_obj.hasOwnProperty(tab_warning[j])){ + $scope.service_obj[tab_warning[j]] = {}; + $scope.service_obj[tab_warning[j]].warning = []; + $scope.service_obj[tab_warning[j]].danger = []; + } + $scope.service_obj[tab_warning[j]].warning.push($scope.items[i].display_name); + } + + tab_danger = $scope.items[i].danger; + for (var j = 0, l_dang = tab_danger.length; j<l_dang; j++){ + if(!$scope.service_obj.hasOwnProperty(tab_danger[j])){ + $scope.service_obj[tab_danger[j]] = {}; + $scope.service_obj[tab_danger[j]].warning = []; + $scope.service_obj[tab_danger[j]].danger = []; + } + $scope.service_obj[tab_danger[j]].danger.push($scope.items[i].display_name); + } + } + }; }); \ No newline at end of file diff --git a/views/dashboard.html b/views/dashboard.html index 18ec320..96eefcf 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -15,13 +15,14 @@ <div ng-show="!fullscreen"> <input type="radio" value="host_view" ng-model="view"> Host view <input type="radio" value="group_view" ng-model="view" ng-click="update_group_obj()"> Group view + <input type="radio" value="service_view" ng-model="view" ng-click="update_service_obj()"> Service view </div> <!-- Host view --> <div ng-show="view == 'host_view' && items.length > 0"> <h2 class="sub-header" - ng-show="!fullscreen">Hosts currently on monitoring</h2> + ng-show="!fullscreen">Machines under monitoring...</h2> <div class="row" ng-show="items.length > 0"> <div ng-show="!fullscreen"> @@ -262,6 +263,45 @@ </div> </div> + <!-- Service View --> + + <div ng-show="view == 'service_view' && items.length > 0"> + <div ng-show="is_services_in_alert()"> + <h2 class="sub-header">Services in alert...</h2> + + <table class="table table-condensed table-hover"> + <thead> + <tr> + <th>Service</th> + <th>Machines in alert</th> + </tr> + </thead> + + <tbody> + <tr ng-repeat="(mod_name, mod) in service_obj"> + <td> + {{mod_name}} + </td> + <td> + <span ng-repeat="machine in mod.danger" + style="color:red"> + {{machine}} <br/> + </span> + <span ng-repeat="machine in mod.warning" + style="color:orange"> + {{machine}} <br/> + </span> + </td> + </tr> + </tbody> + </table> + </div> + + <div ng-show="!is_services_in_alert()"> + <h2 class="sub-header">No services in alert at the moment.</h2> + </div> + </div> + <!-- Message when no hosts on monitoring --> <div ng-show="items.length == 0"> -- 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 476dd45c9b628fe016ee65a8a542c629f9e8dfa8 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 12:28:51 2015 +0200 Category view on dashboard --- app/websocket_func.py | 3 +++ static/js/controllers/dashboardCtrl.js | 47 ++++++++++++++++++++++++++++++++++ static/js/controllers/headCtrl.js | 3 +++ views/dashboard.html | 40 +++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) diff --git a/app/websocket_func.py b/app/websocket_func.py index 4baa086..5455895 100644 --- a/app/websocket_func.py +++ b/app/websocket_func.py @@ -90,6 +90,9 @@ def CALL_FUNC_DB(msg, ws, ml): }}) ws.send(msg) +# asked from dashboard, on category view +def GET_LOADED_MONI_MOD(msg, ws, ml): + ws.send(json.dumps({"RES_GET_LOADED_MONI_MOD": ml.get_info_mod_monitoring()})) # asked from hostpage, at the connection configuration def GET_LOADED_CONN_MOD(msg, ws, ml): diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index a638747..3c841fd 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -269,4 +269,51 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } }; + + /*** CATEGORY VIEW FUNCIONS ***/ + + $scope.category_obj = {}; + + $scope.loaded_moni_mod = {}; + + $scope.is_category_in_alert = function (){ + return Object.keys($scope.category_obj).length > 0; + }; + + $scope.get_loaded_moni_mod = function (){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_MONI_MOD": null})); + }; + + $scope.$on("resGetLoadedMoniMod", function (event, args) { + $timeout(function () { + $scope.loaded_moni_mod = args; + update_category_obj(); + }, 0); + }); + + var update_category_obj = function (){ + for (var i = 0, l=$scope.items.length; i<l; i++){ + tab_warning = $scope.items[i].warning; + for (var j = 0, l_warn = tab_warning.length; j<l_warn; j++){ + var category = $scope.loaded_moni_mod[tab_warning[j]].block; + if(!$scope.category_obj.hasOwnProperty(category)){ + $scope.category_obj[category] = {}; + $scope.category_obj[category].warning = []; + $scope.category_obj[category].danger = []; + } + $scope.category_obj[category].warning.push($scope.items[i].display_name + " on " + tab_warning[j]); + } + + tab_danger = $scope.items[i].danger; + for (var j = 0, l_dang = tab_danger.length; j<l_dang; j++){ + var category = $scope.loaded_moni_mod[tab_danger[j]].block; + if(!$scope.category_obj.hasOwnProperty(category)){ + $scope.category_obj[category] = {}; + $scope.category_obj[category].warning = []; + $scope.category_obj[category].danger = []; + } + $scope.category_obj[category].danger.push($scope.items[i].display_name + " on " + tab_danger[j]); + } + } + }; }); \ No newline at end of file diff --git a/static/js/controllers/headCtrl.js b/static/js/controllers/headCtrl.js index 49a9121..2bb9a71 100644 --- a/static/js/controllers/headCtrl.js +++ b/static/js/controllers/headCtrl.js @@ -72,6 +72,9 @@ mumApp.controller('headCtrl', function ($scope, $rootScope, toastr, $interval, $ case "RES_REM_HOST": $rootScope.$broadcast("remHost"); break; + case "RES_GET_LOADED_MONI_MOD": + $rootScope.$broadcast("resGetLoadedMoniMod", obj[key]); + break; case "RES_GET_LOADED_CONN_MOD": $rootScope.$broadcast("resGetLoadedConnMod", obj[key]); break; diff --git a/views/dashboard.html b/views/dashboard.html index 96eefcf..2fff242 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -16,6 +16,7 @@ <input type="radio" value="host_view" ng-model="view"> Host view <input type="radio" value="group_view" ng-model="view" ng-click="update_group_obj()"> Group view <input type="radio" value="service_view" ng-model="view" ng-click="update_service_obj()"> Service view + <input type="radio" value="category_view" ng-model="view" ng-click="get_loaded_moni_mod()"> Category view </div> @@ -302,6 +303,45 @@ </div> </div> + <!-- Category View --> + + <div ng-show="view == 'category_view' && items.length > 0"> + <div ng-show="is_category_in_alert()"> + <h2 class="sub-header">Categories in alert...</h2> + + <table class="table table-condensed table-hover"> + <thead> + <tr> + <th>Category</th> + <th>Machines in alert</th> + </tr> + </thead> + + <tbody> + <tr ng-repeat="(cat_name, cat) in category_obj"> + <td> + {{cat_name}} + </td> + <td> + <span ng-repeat="machine in cat.danger" + style="color:red"> + {{machine}} <br/> + </span> + <span ng-repeat="machine in cat.warning" + style="color:orange"> + {{machine}} <br/> + </span> + </td> + </tr> + </tbody> + </table> + </div> + + <div ng-show="!is_category_in_alert()"> + <h2 class="sub-header">No categories in alert at the moment.</h2> + </div> + </div> + <!-- Message when no hosts on monitoring --> <div ng-show="items.length == 0"> -- 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 d71e23aaac97254ed5cd6f2fb0b015ef85ff0b62 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 15:08:58 2015 +0200 views on URL + fullscreen on every views --- static/js/controllers/dashboardCtrl.js | 21 +++++++++++++---- views/dashboard.html | 41 +++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index 3c841fd..41c7e68 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -10,6 +10,8 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r //$scope.gap = 5; + var first_loading = true; + $scope.items = DataHosts.Items; /* [ { "addr":"192.168.74.1", @@ -32,6 +34,15 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.$on("hostsUpdate", function (event) { $scope.items = DataHosts.Items; $rootScope.$broadcast("sendViaWs", JSON.stringify({"CALL_FUNC_DB": {'func': 'get_groups','args': null}})); + $scope.update_group_obj; + $scope.update_service_obj; + if (first_loading){ + $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_MONI_MOD": null})); + first_loading = false; + } + else{ + $scope.update_category_obj; + } }); $scope.$on("resCall", function (event, args) { @@ -81,6 +92,8 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.update_url = function () { var url = ""; + url += "view=" + $scope.view + "&"; + url += "fullscreen=" + $scope.fullscreen + "&"; url += "host_filter=" + $scope.host_filter + "&"; @@ -106,6 +119,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.set_fullscreen = function(fullscreen_enabled){ $rootScope.$broadcast("set_fullscreen", fullscreen_enabled); $scope.fullscreen = fullscreen_enabled; + $scope.update_url(); }; $scope.status = ''; @@ -236,6 +250,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r } } } + $scope.update_url(); }; /*** SERVICE VIEW FUNCIONS ***/ @@ -268,6 +283,7 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.service_obj[tab_danger[j]].danger.push($scope.items[i].display_name); } } + $scope.update_url(); }; /*** CATEGORY VIEW FUNCIONS ***/ @@ -280,10 +296,6 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r return Object.keys($scope.category_obj).length > 0; }; - $scope.get_loaded_moni_mod = function (){ - $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_LOADED_MONI_MOD": null})); - }; - $scope.$on("resGetLoadedMoniMod", function (event, args) { $timeout(function () { $scope.loaded_moni_mod = args; @@ -315,5 +327,6 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r $scope.category_obj[category].danger.push($scope.items[i].display_name + " on " + tab_danger[j]); } } + $scope.update_url(); }; }); \ No newline at end of file diff --git a/views/dashboard.html b/views/dashboard.html index 2fff242..33b7212 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -1,6 +1,7 @@ <div class="col-md-offset-2 main"> - <h1 class="page-header">Dashboard + <h1 class="page-header" + ng-show="!fullscreen">Dashboard <small><button type="button" class="btn" aria-label="Fullscreen" popover-placement="bottom" popover="Fullscreen" @@ -13,10 +14,10 @@ </h1> <div ng-show="!fullscreen"> - <input type="radio" value="host_view" ng-model="view"> Host view - <input type="radio" value="group_view" ng-model="view" ng-click="update_group_obj()"> Group view - <input type="radio" value="service_view" ng-model="view" ng-click="update_service_obj()"> Service view - <input type="radio" value="category_view" ng-model="view" ng-click="get_loaded_moni_mod()"> Category view + <input type="radio" value="host_view" ng-model="view" ng-change="update_url()"> Host view + <input type="radio" value="group_view" ng-model="view" ng-change="update_group_obj()"> Group view + <input type="radio" value="service_view" ng-model="view" ng-change="update_service_obj()"> Service view + <input type="radio" value="category_view" ng-model="view" ng-change="get_loaded_moni_mod()"> Category view </div> @@ -183,10 +184,12 @@ <!-- Group view --> - <div ng-show="view == 'group_view' && items.length > 0">{{group_obj}} - <h2 class="sub-header">Hosts currently on monitoring (by group)</h2> + <div ng-show="view == 'group_view' && items.length > 0"> + <h2 class="sub-header" + ng-show="!fullscreen">Hosts currently on monitoring (by group)</h2> <div class="row"> - <div class="col-xs-2"> + <div class="col-xs-2" + ng-show="!fullscreen"> <label for="status_f_grp">Status filter</label> <select multiple class="form-control input-sm" id="status_f_grp" @@ -199,7 +202,8 @@ </select> </div> - <div class="col-xs-2"> + <div class="col-xs-2" + ng-show="!fullscreen"> <label for="group_f_grp">Group filter</label> <select class="form-control input-sm" id="group_f_grp" @@ -268,7 +272,8 @@ <div ng-show="view == 'service_view' && items.length > 0"> <div ng-show="is_services_in_alert()"> - <h2 class="sub-header">Services in alert...</h2> + <h2 class="sub-header" + ng-show="!fullscreen">Services in alert...</h2> <table class="table table-condensed table-hover"> <thead> @@ -307,7 +312,8 @@ <div ng-show="view == 'category_view' && items.length > 0"> <div ng-show="is_category_in_alert()"> - <h2 class="sub-header">Categories in alert...</h2> + <h2 class="sub-header" + ng-show="!fullscreen">Categories in alert...</h2> <table class="table table-condensed table-hover"> <thead> @@ -355,4 +361,17 @@ If you are ready, <a href="#scan">scan for new machines</a>! </p> </div> + + <div class="row" + ng-show="fullscreen"> + <button type="button" class="btn" aria-label="Disable fullscreen" + popover-placement="up" + popover="Disable fullscreen" + popover-trigger="mouseenter" + ng-click="set_fullscreen(!fullscreen)"> + <span class="fa fa-compress" + aria-hidden="true"> + </span> + </button> + </div> </div> \ No newline at end of file -- 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 0f0ae84d311f5cee5276b02a6d696fe080a70941 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 15:26:57 2015 +0200 host view : name shown by default (1 line for 1 host) + better ng-show conditions for status --- views/dashboard.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/views/dashboard.html b/views/dashboard.html index 33b7212..0159b11 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -98,7 +98,6 @@ <tr> <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> @@ -115,8 +114,9 @@ class={{host.status}}> <!-- group.name:group_filter --> <td><a href="#/hostpage/{{host.addr}}">{{host.display_name}}</a></td> <td> - {{host.addr}}<br/> {{host.name}} + <span ng-show="host.name == ''">{{host.addr}}</span> + </td> <td> <span popover-placement="bottom" @@ -127,7 +127,12 @@ {{host.status}} </span> <span ng-show="host.status!='success'"> - warning: {{host.warning}} ; danger: {{host.danger}} + <span ng-show="host.warning.length > 0"> + warning: {{host.warning}} + </span> + <span ng-show="host.danger.length > 0"> + danger: {{host.danger}} + </span> </span>({{host.nb_mod}}) </td> <td> -- 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 7b6efcdc96fd2a8a37cc3e5d09bb2bba1eb9a5ef Merge: 0f0ae84 9b0876f Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Mon Jul 6 16:37:11 2015 +0200 Merge branch 'develop' of https://git.chorem.org/mum into develop Conflicts: debian/rules redhat/mum.spec README | 8 ++-- mum.conf => conf/mum.conf | 2 + conf/mum.sudoers.d | 1 + debian/postinst | 38 +++--------------- debian/postrm | 9 +++++ debian/preinst | 5 +++ debian/rules | 43 +++++++++------------ in-venv.sh | 7 ---- install.sh | 35 ----------------- mum.sh | 11 ------ redhat/mum.spec | 70 +++++++++++++++++++++------------- mum-daemon.sh => scripts/mum-daemon.sh | 0 scripts/mum-env.sh | 69 +++++++++++++++++++++++++++++++++ scripts/mum-in-venv.sh | 14 +++++++ scripts/mum-install-venv.sh | 16 ++++++++ scripts/mum.service | 8 ++++ scripts/mum.sh | 12 ++++++ 17 files changed, 208 insertions(+), 140 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm