Added module name and agent name in actions enable and disable module - #2783

This commit is contained in:
tatiana.llorente@artica.es 2018-09-19 16:51:31 +02:00
parent daf48c3798
commit e0e098a7a6
1 changed files with 10 additions and 6 deletions

View File

@ -1760,13 +1760,15 @@ if (!empty($duplicate_module)) { // DUPLICATE agent module !
// ===================== // =====================
if ($enable_module) { if ($enable_module) {
$result = modules_change_disabled($enable_module, 0); $result = modules_change_disabled($enable_module, 0);
$modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$enable_module."");
$modulo_nombre = $modulo_nombre['nombre'];
if ($result === NOERR) { if ($result === NOERR) {
enterprise_hook('config_agents_enable_module_conf', array($id_agente, $enable_module)); enterprise_hook('config_agents_enable_module_conf', array($id_agente, $enable_module));
db_pandora_audit("Module management", 'Enable ' . $enable_module); db_pandora_audit("Module management", 'Enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
} }
else { else {
db_pandora_audit("Module management", 'Fail to enable ' . $enable_module); db_pandora_audit("Module management", 'Fail to enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
} }
ui_print_result_message ($result, ui_print_result_message ($result,
@ -1775,13 +1777,15 @@ if ($enable_module) {
if ($disable_module) { if ($disable_module) {
$result = modules_change_disabled($disable_module, 1); $result = modules_change_disabled($disable_module, 1);
$modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$disable_module."");
$modulo_nombre = $modulo_nombre['nombre'];
if ($result === NOERR) { if ($result === NOERR) {
enterprise_hook('config_agents_disable_module_conf', array($id_agente, $disable_module)); enterprise_hook('config_agents_disable_module_conf', array($id_agente, $disable_module));
db_pandora_audit("Module management", 'Disable ' . $disable_module); db_pandora_audit("Module management", 'Disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
} }
else { else {
db_pandora_audit("Module management", 'Fail to disable ' . $disable_module); db_pandora_audit("Module management", 'Fail to disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
} }
ui_print_result_message ($result, ui_print_result_message ($result,