branch develop updated (af8cce6 -> 9d2a824)
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 af8cce6 modal for logs on dashboard + nmap scan exception handling for range + copyright file corrected new 933c34f exception handled for notif mod new ed6a4e1 drive detection mod have same name as moni mod new d3db22c sub number on group view new 9d2a824 exception raised on snmp_walk if no oid is found... + hostpage have a specific message if host is suspended + updated mum-daemon The 4 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 9d2a82434b91d449fa7732d78edae4191a1b30d4 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 16:29:35 2015 +0200 exception raised on snmp_walk if no oid is found... + hostpage have a specific message if host is suspended + updated mum-daemon commit d3db22cb8dab8a498e038bc096c948f6315de18d Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 11:12:00 2015 +0200 sub number on group view commit ed6a4e1b92233464bd73ba2b482d7cd8582e0d48 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 10:07:34 2015 +0200 drive detection mod have same name as moni mod commit 933c34f8a9cf3946e60f7c3a0e6308f50b473dfc Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Jun 18 11:51:15 2015 +0200 exception handled for notif mod Summary of changes: app/module_loader.py | 3 + app/modules/connection_modules/snmp_walk.py | 10 +- app/modules/detection_modules/drive_detection.py | 2 +- app/modules/detection_modules/drive_snmp_linux.py | 2 +- mum-daemon.sh | 103 ++++-- static/js/controllers/dashboardCtrl.js | 31 +- views/dashboard.html | 26 +- views/hostpage.html | 406 +++++++++++----------- 8 files changed, 338 insertions(+), 245 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 933c34f8a9cf3946e60f7c3a0e6308f50b473dfc Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Thu Jun 18 11:51:15 2015 +0200 exception handled for notif mod --- app/module_loader.py | 5 +++++ views/dashboard.html | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/module_loader.py b/app/module_loader.py index 17a2973..f818ffb 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -284,6 +284,7 @@ class ModuleLoader: except AttributeError: self.logger.warning("Error : external monitoring module " + mod_name + " could not have been loaded.") self.logger.debug(traceback.format_exc()) + print self.loaded_mod_moni def run_one_monitoring_module(self, part_name, addr_host): """ @@ -293,6 +294,7 @@ class ModuleLoader: :param part_name: the name of the part to check :param addr_host: the IP address of the host """ + print part_name 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 @@ -516,6 +518,9 @@ class ModuleLoader: except KeyError: self.logger.warning('Missing setting for notification module ' + notif_mod) self.logger.debug(traceback.format_exc()) + except Exception: + self.logger.error('An error occured with notification module ' + self.loaded_mod_notif[notif_mod]['class_name']) + self.logger.error(traceback.format_exc()) def update_global_conf(self): """ diff --git a/views/dashboard.html b/views/dashboard.html index a0b7946..bd1091f 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -46,6 +46,21 @@ ng-model="group_filter" ng-options="group for group in allGroups() | unique:'group'"> </select> + <!--<ui-select multiple + tagging="tag_transform" + tagging-label="" + ng-model="group_filter" + theme="bootstrap" + sortable="true" + ng-disabled="disabled" + style="width: 300px;" + title="Group filter"> + <ui-select-match placeholder="Add to group...">{{$item}}</ui-select-match> + <ui-select-choices repeat="group in allGroups() | unique:'group' | filter:$select.search" + refresh-delay="0"> + {{group}} + </ui-select-choices> + </ui-select>--> </div> <table class="table table-condensed table-hover"> @@ -188,7 +203,9 @@ </p> </div> - <button type="button" class="btn btn-default" ng-click="open_modal_log()">See the logs...</button> + <div class="row"> + <button type="button" class="btn btn-default" ng-click="open_modal_log()">See the logs...</button> + </div> <script type="text/ng-template" id="modal_notif_label.html"> <div class="modal-header"> -- 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 ed6a4e1b92233464bd73ba2b482d7cd8582e0d48 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 10:07:34 2015 +0200 drive detection mod have same name as moni mod --- app/module_loader.py | 2 -- app/modules/detection_modules/drive_detection.py | 2 +- app/modules/detection_modules/drive_snmp_linux.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/module_loader.py b/app/module_loader.py index f818ffb..e1d5118 100644 --- a/app/module_loader.py +++ b/app/module_loader.py @@ -284,7 +284,6 @@ class ModuleLoader: except AttributeError: self.logger.warning("Error : external monitoring module " + mod_name + " could not have been loaded.") self.logger.debug(traceback.format_exc()) - print self.loaded_mod_moni def run_one_monitoring_module(self, part_name, addr_host): """ @@ -294,7 +293,6 @@ class ModuleLoader: :param part_name: the name of the part to check :param addr_host: the IP address of the host """ - print part_name 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 diff --git a/app/modules/detection_modules/drive_detection.py b/app/modules/detection_modules/drive_detection.py index 6ff6ea4..8ef9b61 100644 --- a/app/modules/detection_modules/drive_detection.py +++ b/app/modules/detection_modules/drive_detection.py @@ -2,7 +2,7 @@ __author__ = 'aguilbaud' compatible_os = ['linux', 'unix'] connection = "ssh" -part = 'disk' +part = 'Disk' def run_detection(conn): diff --git a/app/modules/detection_modules/drive_snmp_linux.py b/app/modules/detection_modules/drive_snmp_linux.py index 1e27807..0083214 100644 --- a/app/modules/detection_modules/drive_snmp_linux.py +++ b/app/modules/detection_modules/drive_snmp_linux.py @@ -3,7 +3,7 @@ import json compatible_os = ['linux', 'unix'] connection = "snmp_walk" -part = 'disk' +part = 'Disk' def run_detection(conn): oid_mounted_partitions = "1.3.6.1.4.1.2021.9.1.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 d3db22cb8dab8a498e038bc096c948f6315de18d Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 11:12:00 2015 +0200 sub number on group view --- static/js/controllers/dashboardCtrl.js | 31 ++++++++++++++++++++++++++++++- views/dashboard.html | 7 ++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/static/js/controllers/dashboardCtrl.js b/static/js/controllers/dashboardCtrl.js index a210f3d..ea383cc 100644 --- a/static/js/controllers/dashboardCtrl.js +++ b/static/js/controllers/dashboardCtrl.js @@ -1,4 +1,4 @@ -mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $rootScope, $modal, DataHosts) { +mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $rootScope, $modal, $timeout, DataHosts) { /* Host view functions */ $scope.param = $routeParams.param; // parameter in URL, null if none @@ -30,12 +30,18 @@ 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.$on("resCall", function (event, args) { if (args.func == 'remove_host_list_to_group' || args.func == 'add_host_list_to_group') { $rootScope.$broadcast("sendViaWs", JSON.stringify({"GET_HOSTS": ""})); } + if (args.func == 'get_groups') { + $timeout(function () { + $scope.groups = args.res; + }, 0); + } }); $scope.host_filter = ''; // input field @@ -149,9 +155,32 @@ mumApp.controller('dashboardCtrl', function ($scope, $routeParams, $location, $r }; /* Group view functions */ + $scope.groups = {};/*{ grp_name: { 'hosts': [host1, ...], 'subscribers': + { usr: { 'minor': int, 'major': int }, ... + } } + */ + $scope.group_obj = {}; /* {group_name:{"hosts":[addr1, ...],"status":"success"}, ...} */ + $scope.get_group_sub_num = function(grp_name){ + if(grp_name != 'all'){ + res = {}; + res.nb_sub = Object.keys($scope.groups[grp_name].subscribers).length; + if (res.nb_sub == 0){ + res.btn_type = 'default'; + } + else{ + res.btn_type = 'primary'; + } + } + else{ + res.nb_sub = null; + res.btn_type = 'default' + } + return res; + }; + $scope.update_group_obj = function (){ var allGroups = $scope.allGroups(); for (var i=0, l=allGroups.length ; i<l ; i++){ diff --git a/views/dashboard.html b/views/dashboard.html index bd1091f..e08a364 100644 --- a/views/dashboard.html +++ b/views/dashboard.html @@ -174,11 +174,12 @@ </td> <td>{{group.status}}</td> <td> - <button type="button" class="btn btn-primary btn-xs" aria-label="Subscribers" + <button type="button" class="btn btn-{{get_group_sub_num(groupname).btn_type}} btn-xs" aria-label="Subscribers" popover-placement="left" - popover="Subscribers" + popover="{{get_group_sub_num(groupname).nb_sub}} subscribers" popover-trigger="mouseenter" - ng-click="open_modal_notif(null, groupname)"> + ng-click="open_modal_notif(null, groupname)" + ng-show="groupname != 'all'"> <span class="glyphicon glyphicon-user" aria-hidden="true"> </span> </button> -- 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 9d2a82434b91d449fa7732d78edae4191a1b30d4 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Jun 19 16:29:35 2015 +0200 exception raised on snmp_walk if no oid is found... + hostpage have a specific message if host is suspended + updated mum-daemon --- app/modules/connection_modules/snmp_walk.py | 10 +- mum-daemon.sh | 103 ++++--- views/hostpage.html | 406 ++++++++++++++-------------- 3 files changed, 281 insertions(+), 238 deletions(-) diff --git a/app/modules/connection_modules/snmp_walk.py b/app/modules/connection_modules/snmp_walk.py index a346de6..c3ddcd2 100644 --- a/app/modules/connection_modules/snmp_walk.py +++ b/app/modules/connection_modules/snmp_walk.py @@ -52,7 +52,15 @@ class SNMPWalk: else: for varBindTableRow in varBindTable: for name, val in varBindTableRow: - res[name.prettyPrint()] = val.prettyPrint() + if val.prettyPrint() != "": + # if this oid returned a result + res[name.prettyPrint()] = val.prettyPrint() + if res == {}: + # we got nothing for this oid => it doens't exists on this host + exception_inst = getattr(self.CommandNotFoundException, "CommandNotFoundException")( + cmd, self.addr_host + ) + raise exception_inst return res def disconnect(self): diff --git a/mum-daemon.sh b/mum-daemon.sh index 584fe3f..28290d5 100755 --- a/mum-daemon.sh +++ b/mum-daemon.sh @@ -1,52 +1,79 @@ -#! /bin/sh -e +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: mum-daemon +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Simple monitoring through a web interface. +### END INIT INFO -DAEMON="/usr/lib/mum/run.sh" #ligne de commande du programme -daemon_OPT="/etc/mum/mum.conf" #argument à utiliser par le programme -DAEMONUSER="user" #utilisateur du programme -daemon_NAME="run.sh" #Nom du programme (doit être identique à l'exécutable) +DESC="Mum service" +NAME="mum" -PATH="/sbin:/bin:/usr/sbin:/usr/bin" #Ne pas toucher +DAEMON=/usr/lib/mum/mum.sh +DAEMON_OPTS=/etc/mum +PIDFILE=/var/run/$NAME.pid + +SCRIPTNAME=/etc/init.d/mum-daemon.sh + +# Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 . /lib/lsb/init-functions -d_start () { - log_daemon_msg "Starting system $daemon_NAME Daemon" - start-stop-daemon --background --name $daemon_NAME --start --quiet --chuid $DAEMONUSER --exec $DAEMON -- $daemon_OPT - log_end_msg $? +#test -f /etc/default/NetworkManager && . /etc/default/NetworkManager + +# +# Function that starts the daemon/service. +# +d_start() { + start-stop-daemon --start --quiet -b --pidfile $PIDFILE \ + --exec $DAEMON -- $DAEMON_OPTS } -d_stop () { - log_daemon_msg "Stopping system $daemon_NAME Daemon" - start-stop-daemon --name $daemon_NAME --stop --retry 5 --quiet --name $daemon_NAME - log_end_msg $? +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \ + --exec $DAEMON } -case "$1" in - start|stop) - d_${1} - ;; - - restart|reload|force-reload) - d_stop - d_start - ;; - - force-stop) - d_stop - killall -q $daemon_NAME || true - sleep 2 - killall -q -9 $daemon_NAME || true - ;; - - status) - status_of_proc "$daemon_NAME" "$DAEMON" "system-wide $daemon_NAME" && exit 0 || exit $? - ;; - *) - echo "Usage: /etc/init.d/$daemon_NAME {start|stop|force-stop|restart|reload|force-reload|status}" - exit 1 - ;; +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + d_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_progress_msg "already started" + log_end_msg 0 ;; + *) log_end_msg 1 ;; + esac + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + d_stop + case "$?" in + 0) log_end_msg 0 ;; + 1) log_progress_msg "already stopped" + log_end_msg 0 ;; + *) log_end_msg 1 ;; + esac + ;; + restart|force-reload) + $0 stop + $0 start + ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; esac + exit 0 \ No newline at end of file diff --git a/views/hostpage.html b/views/hostpage.html index f204aa5..db09a91 100644 --- a/views/hostpage.html +++ b/views/hostpage.html @@ -23,223 +23,231 @@ </small> </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" - ng-click="open_modal_conn()">Connection settings</button> - - <button type="button" - class="btn btn-info btn-xs" - 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'"> - - <thead> - <tr> - <th>Part </th> - <th>Value </th> - <th>State </th> - <th>Last check </th> - </tr> - </thead> - - <tbody> - <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> - {{mod.state}} - </td> - <td> - {{mod.date.split('.')[0]}} - </td> - <td> - <button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_conf(modname)">Configure - </button> - </td> - <td> - <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> - <td> - <button type="button" class="btn btn-info btn-xs" - ng-click="check(modname)">Check now - </button> - </td> - <td> - <button type="button" - class="btn btn-danger btn-xs" - aria-label="Stop monitoring of this part" - popover-placement="left" - popover="Stop the monitoring of this part" - popover-trigger="mouseenter" - ng-click="update_module_activation(modname, false)"> - <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> - </button> - </td> - </tr> - <tr ng-repeat-end - ng-repeat="(valname, val) in mod.value" - collapse="collapsed[modname]"> - <td>{{valname}}</td> - <td>{{val}} {{get_unit(modname)}}</td> - <td><button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_stats(addr_host, modname, valname)">Archives</button></td> - </tr> - </tbody> - - </table> - - <label for="add_mod_select">Add a part to monitore: </label> - <select id="add_mod_select" - ng-model="selected_mod_part"> - <optgroup ng-repeat="(blockname, block) in blocks" - label="{{blockname}}"> - <option ng-repeat="mod_obj in block" - ng-show="!mod_obj.activated" - ng-click="update_module_activation(mod_obj.modname, true)"> - {{mod_obj.modname}} - </option> - </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)"> - - <button type="button" class="btn btn-primary btn-xs" - ng-click="rescan()">Scan again</button> - - <table class="table table-bordered table-hover"> - <tr ng-repeat="(key, val) in items.detected.nmap"> - <td>{{key}}</td> - <td>{{val}}</td> - <td ng-show="(key == 'os')"> - <select ng-model="model.new_os" - ng-options="os for os in model.compatible_os_list"> - </select> - <button type="button" class="btn btn-info btn-xs" - ng-click="update_nmap_attribute('os', model.new_os)" - ng-disabled="model.new_os==''">Correct OS name</button> - </td> - <td ng-show="(key == 'hostname')"> - <input type="text" - ng-model="model.new_hostname"/> - <button type="button" class="btn btn-info btn-xs" - ng-click="update_nmap_attribute('hostname', model.new_hostname)" - ng-disabled="model.new_hostname==''">Correct hostname</button> - </td> - <td ng-show="(key == 'openports')"> - <button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_port_config(val)"> - Add/remove detected ports - </button> - </td> - </tr> - </table> - </accordion-group> - <accordion-group heading="Detected configuration (select the subparts to monitore here)"> - <table class="table table-bordered table-hover"> - <tr ng-repeat-start="(modname, mod) in items.detected" - 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 - </button> - </th> - </tr> - <tr ng-repeat-end - 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> - </tr> - </table> + <button type="button" + class="btn btn-primary btn-xs" + ng-click="open_modal_conn()">Connection settings</button> - </accordion-group> + <button type="button" + class="btn btn-info btn-xs" + ng-click="launch_detection()">Launch a full detection</button> - <accordion-group heading="Custom informations"> + <button type="button" + class="btn btn-danger btn-xs" + ng-click="open_modal_confirm_delete()">Remove this host</button> - <label for="custom_info">Add any information here :</label> - <textarea class="form-control" rows="3" id="custom_info" ng-model="model.custom_infos"></textarea> - <button type="button" class="btn btn-info btn-xs" ng-click="save_custom_infos()">Save</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> + + <div ng-show="get_idle_state() == 'success'"> + <p>There has been {{items.nb_warning}} warning(s) and {{items.nb_danger}} danger(s) consecutively.</p> + <table class="table table-condensed table-hover" + ng-show="items.status != 'idling'"> + + <thead> + <tr> + <th>Part </th> + <th>Value </th> + <th>State </th> + <th>Last check </th> + </tr> + </thead> + + <tbody> + <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> + {{mod.state}} + </td> + <td> + {{mod.date.split('.')[0]}} + </td> + <td> + <button type="button" class="btn btn-primary btn-xs" + ng-click="open_modal_conf(modname)">Configure + </button> + </td> + <td> + <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> + <td> + <button type="button" class="btn btn-info btn-xs" + ng-click="check(modname)">Check now + </button> + </td> + <td> + <button type="button" + class="btn btn-danger btn-xs" + aria-label="Stop monitoring of this part" + popover-placement="left" + popover="Stop the monitoring of this part" + popover-trigger="mouseenter" + ng-click="update_module_activation(modname, false)"> + <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> + </button> + </td> + </tr> + <tr ng-repeat-end + ng-repeat="(valname, val) in mod.value" + collapse="collapsed[modname]"> + <td>{{valname}}</td> + <td>{{val}} {{get_unit(modname)}}</td> + <td><button type="button" class="btn btn-primary btn-xs" + ng-click="open_modal_stats(addr_host, modname, valname)">Archives</button></td> + </tr> + </tbody> + + </table> + + <label for="add_mod_select">Add a part to monitore: </label> + <select id="add_mod_select" + ng-model="selected_mod_part"> + <optgroup ng-repeat="(blockname, block) in blocks" + label="{{blockname}}"> + <option ng-repeat="mod_obj in block" + ng-show="!mod_obj.activated" + ng-click="update_module_activation(mod_obj.modname, true)"> + {{mod_obj.modname}} + </option> + </optgroup> + </select> - </accordion-group> + <!--<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-group heading="Interventions done"> + <accordion close-others="false"> - <button type="button" class="btn btn-primary btn-xs" - ng-click="open_modal_interv()">Add a new intervention</button> - <div ng-show="items.interventions != ''"> + <accordion-group heading="Essential configuration (nmap detection)"> + + <button type="button" class="btn btn-primary btn-xs" + ng-click="rescan()">Scan again</button> <table class="table table-bordered table-hover"> + <tr ng-repeat="(key, val) in items.detected.nmap"> + <td>{{key}}</td> + <td>{{val}}</td> + <td ng-show="(key == 'os')"> + <select ng-model="model.new_os" + ng-options="os for os in model.compatible_os_list"> + </select> + <button type="button" class="btn btn-info btn-xs" + ng-click="update_nmap_attribute('os', model.new_os)" + ng-disabled="model.new_os==''">Correct OS name</button> + </td> + <td ng-show="(key == 'hostname')"> + <input type="text" + ng-model="model.new_hostname"/> + <button type="button" class="btn btn-info btn-xs" + ng-click="update_nmap_attribute('hostname', model.new_hostname)" + ng-disabled="model.new_hostname==''">Correct hostname</button> + </td> + <td ng-show="(key == 'openports')"> + <button type="button" class="btn btn-primary btn-xs" + ng-click="open_modal_port_config(val)"> + Add/remove detected ports + </button> + </td> + </tr> + </table> - <thead> - <tr> - <th>Date </th> - <th>Person </th> - <th>Details </th> + </accordion-group> + + <accordion-group heading="Detected configuration (select the subparts to monitore here)"> + + <table class="table table-bordered table-hover"> + <tr ng-repeat-start="(modname, mod) in items.detected" + 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 + </button> + </th> </tr> - </thead> - - <tbody> - <tr ng-repeat="interv in items.interventions | - orderBy:'-date'"> - <td>{{interv.date}}</td> - <td>{{interv.username}}</td> - <td>{{interv.details}}</td> + <tr ng-repeat-end + 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> </tr> - </tbody> - </table> - </div> + </accordion-group> + + <accordion-group heading="Custom informations"> + + <label for="custom_info">Add any information here :</label> + <textarea class="form-control" rows="3" id="custom_info" ng-model="model.custom_infos"></textarea> + <button type="button" class="btn btn-info btn-xs" ng-click="save_custom_infos()">Save</button> + + </accordion-group> + + <accordion-group heading="Interventions done"> + + <button type="button" class="btn btn-primary btn-xs" + ng-click="open_modal_interv()">Add a new intervention</button> + <div ng-show="items.interventions != ''"> + + <table class="table table-bordered table-hover"> + + <thead> + <tr> + <th>Date </th> + <th>Person </th> + <th>Details </th> + </tr> + </thead> + + <tbody> + <tr ng-repeat="interv in items.interventions | + orderBy:'-date'"> + <td>{{interv.date}}</td> + <td>{{interv.username}}</td> + <td>{{interv.details}}</td> + </tr> + </tbody> + + </table> + + </div> + + </accordion-group> - </accordion-group> + </accordion> + </div> - </accordion> + <div ng-show="get_idle_state() == 'danger'"> + The monitoring of this host is suspended... + </div> <script type="text/ng-template" id="modal_conf_label.html"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm