From a5f9e74b50ba2ec60459bc22b56758488239bb35 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 5 Aug 2021 15:53:44 +0200 Subject: [PATCH] #7881 Fixed snmp alert --- .../extras/mr/procedures/updateSnmpAlerts.sql | 35 ------------------- .../godmode/snmpconsole/snmp_alert.php | 9 +++-- 2 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 pandora_console/extras/mr/procedures/updateSnmpAlerts.sql diff --git a/pandora_console/extras/mr/procedures/updateSnmpAlerts.sql b/pandora_console/extras/mr/procedures/updateSnmpAlerts.sql deleted file mode 100644 index 5fed73fdf9..0000000000 --- a/pandora_console/extras/mr/procedures/updateSnmpAlerts.sql +++ /dev/null @@ -1,35 +0,0 @@ -CREATE PROCEDURE updateSnmpAlerts() -BEGIN - DECLARE tokenId INT DEFAULT 0; - DECLARE procedureRun INT DEFAULT 0; - DECLARE done BOOLEAN DEFAULT FALSE; - DECLARE a, b INT DEFAULT 0; - DECLARE alertsCur CURSOR FOR SELECT id, id_alert_command FROM talert_actions; - DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - - SELECT id_config, value INTO tokenId, procedureRun FROM tconfig WHERE token = 'update_snmp_alerts_procedure_already_run' LIMIT 1; - - IF procedureRun < 1 THEN - SET done = FALSE; - - OPEN alertsCur; - - read_loop: LOOP - FETCH alertsCur INTO a, b; - IF done THEN - LEAVE read_loop; - END IF; - - UPDATE talert_snmp SET id_alert = b WHERE id_alert = a; - UPDATE talert_snmp_action SET alert_type = b WHERE alert_type = a; - END LOOP; - - CLOSE alertsCur; - - IF tokenId < 1 THEN - INSERT INTO tconfig (id_config, token, value) VALUES ('', 'update_snmp_alerts_procedure_already_run', '1'); - ELSE - UPDATE tconfig SET value = 1 WHERE token = 'update_snmp_alerts_procedure_already_run'; - END IF; - END IF; -END \ No newline at end of file diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 32379d665c..674e266f62 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -986,12 +986,11 @@ if ($create_alert || $update_alert) { echo html_print_select(get_priorities(), 'priority', $priority, '', '', '0', false, false, false); echo ''; - // Alert type (e-mail, event etc.) - echo ''.__('Alert commands').''; - + // Alert type (e-mail, event etc.). + echo ''.__('Alert action').''; html_print_select_from_sql( 'SELECT id, name - FROM talert_commands + FROM talert_actions ORDER BY name', 'alert_type', $alert_type, @@ -1481,7 +1480,7 @@ $(document).ready (function () { value: "1" }); values.push ({ - name: "id", + name: "id_action", value: this.value }); values.push ({