Fixed alert management log

This commit is contained in:
Jose Gonzalez 2022-02-03 12:54:50 +01:00
parent bc6175abad
commit 2f356541ea
3 changed files with 27 additions and 37 deletions

View File

@ -115,17 +115,14 @@ if ($copy_action) {
$result = alerts_clone_alert_action($id, $al_action['id_group']);
if ($result) {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Duplicate alert action '.$id.' clone to '.$result
);
} else {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to duplicate alert action '.$id
);
}
$auditMessage = ((bool) $result === true)
? sprintf('Duplicate alert action %s clone to %s', $id, $result)
: sprintf('Fail try to duplicate alert action %s', $id);
db_pandora_audit(
AUDIT_LOG_ALERT_MANAGEMENT,
$auditMessage
);
ui_print_result_message(
$result,
@ -194,17 +191,14 @@ if ($delete_action) {
$result = alerts_delete_alert_action($id);
if ($result) {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Delete alert action #'.$id
);
} else {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to delete alert action #'.$id
);
}
$auditMessage = ((bool) $result === true)
? sprintf('Delete alert action #%s', $id)
: sprintf('Fail try to delete alert action #%s', $id);
db_pandora_audit(
AUDIT_LOG_ALERT_MANAGEMENT,
$auditMessage
);
ui_print_result_message(
$result,

View File

@ -539,7 +539,7 @@ if ($create_command) {
if ($result) {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
AUDIT_LOG_ALERT_MANAGEMENT,
'Create alert command #'.$result,
false,
false,
@ -547,7 +547,7 @@ if ($create_command) {
);
} else {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
AUDIT_LOG_ALERT_MANAGEMENT,
'Fail try to create alert command',
false,
false
@ -590,17 +590,14 @@ if ($delete_command) {
$result = alerts_delete_alert_command($id);
if ($result) {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Delete alert command #'.$id
);
} else {
db_pandora_audit(
AUDIT_LOG_COMMAND_MANAGEMENT,
'Fail try to delete alert command #'.$id
);
}
$auditMessage = ((bool) $result === true)
? sprintf('Delete alert command #%s', $id)
: sprintf('Fail try to delete alert command #%s', $id);
db_pandora_audit(
AUDIT_LOG_ALERT_MANAGEMENT,
$auditMessage
);
ui_print_result_message(
$result,

View File

@ -778,12 +778,12 @@ define('AUDIT_LOG_ACL_VIOLATION', 'ACL Violation');
define('AUDIT_LOG_METACONSOLE_NODE', 'Metaconsole node');
define('AUDIT_LOG_USER_REGISTRATION', 'Console user registration');
define('AUDIT_LOG_EXTENSION_MANAGER', 'Extension manager');
define('AUDIT_LOG_WEB_SOCKETS', 'WebSockets engine');
define('AUDIT_LOG_USER_MANAGEMENT', 'User management');
define('AUDIT_LOG_AGENT_MANAGEMENT', 'Agent management');
define('AUDIT_LOG_MODULE_MANAGEMENT', 'Module management');
define('AUDIT_LOG_CATEGORY_MANAGEMENT', 'Category management');
define('AUDIT_LOG_REPORT_MANAGEMENT', 'Report management');
define('AUDIT_LOG_COMMAND_MANAGEMENT', 'Command management');
define('AUDIT_LOG_MASSIVE_MANAGEMENT', 'Massive operation management');
define('AUDIT_LOG_POLICY_MANAGEMENT', 'Policy management');
define('AUDIT_LOG_AGENT_REMOTE_MANAGEMENT', 'Agent remote configuration');
@ -793,7 +793,6 @@ define('AUDIT_LOG_ALERT_CORRELATION_MANAGEMENT', 'Alert correlation management')
define('AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT', 'Visual Console Management');
define('AUDIT_LOG_TAG_MANAGEMENT', 'Tag management');
define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management');
define('AUDIT_LOG_WEB_SOCKETS', 'WebSockets engine');
define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');