Merge branch 'ent-7881-Alertas-SNMP-en-v756-rotas' into 'develop'

Ent 7881 alertas snmp en v756 rotas

See merge request artica/pandorafms!4344
This commit is contained in:
Daniel Rodriguez 2021-08-06 06:48:43 +00:00
commit 01dcfbd919
2 changed files with 4 additions and 40 deletions

View File

@ -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

View File

@ -986,12 +986,11 @@ if ($create_alert || $update_alert) {
echo html_print_select(get_priorities(), 'priority', $priority, '', '', '0', false, false, false);
echo '</td></tr>';
// Alert type (e-mail, event etc.)
echo '<tr><td class="datos">'.__('Alert commands').'</td><td class="datos">';
// Alert type (e-mail, event etc.).
echo '<tr><td class="datos">'.__('Alert action').'</td><td class="datos">';
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 ({