From 3a6b48c1f60dbcb61edb05cea5072dfbda5aded6 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 30 Oct 2014 18:49:27 +0100 Subject: [PATCH] Uploaded Sancho changes in the action of 'pandora event' (cherry picked from commit f944cd8d77929cc3c2dbd7af22c6d5adff49e7d2) --- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_console/pandoradb.data.postgreSQL.sql | 2 +- pandora_console/pandoradb_data.sql | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index c3c3746ee1..773882bdad 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -1080,7 +1080,7 @@ BEGIN LOCK TABLE talert_actions IN EXCLUSIVE MODE; INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (2,'Restart agent',12,'REFRESH AGENT *','','',0,0); -INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','',0,0); +INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (3,'Pandora FMS Event',3,'_agent_ _module_ generated an event alert (_data_)','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED: _agent_ _module_ generated event alert (_data_)','alert_ceased','pandora','','4','','','','',''); INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold, field1_recovery, field2_recovery, field3_recovery, field4_recovery, field5_recovery, field6_recovery, field7_recovery, field8_recovery, field9_recovery, field10_recovery) VALUES (4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','',''); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 829e3692a0..8fa9cae904 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -1001,7 +1001,7 @@ SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_comm INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (2,'Restart agent',12,'REFRESH AGENT *','','',0,0); -INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','',0,0); +INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (3,'Pandora FMS Event',3,'_agent_ _module_ generated an event alert (_data_)','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED: _agent_ _module_ generated event alert (_data_)','alert_ceased','pandora','','4','','','','',''); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','',''); SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions))); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 673b8ed070..3c482faff0 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -986,10 +986,14 @@ INSERT INTO `tgis_map_layer` VALUES (1,'Group All',1,0,1,0); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (12,'Remote agent control','/usr/share/pandora_server/util/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data',0,'[\"Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); -INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','','','','','','','','',0,0,'','','','','','','','','',''); -INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (2,'Restart agent',12,'REFRESH AGENT *','','','','','','','','','',0,0,'','','','','','','','','',''); -INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','','','','','','','','',0,0,'','','','','','','','','',''); -INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','',''); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES +(1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','','','','','','','','',0,0,'','','','','','','','','',''); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES +(2,'Restart agent',12,'REFRESH AGENT *','','','','','','','','','',0,0,'','','','','','','','','',''); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES +(3,'Pandora FMS Event',3,'_agent_ _module_ generated an event alert (_data_)','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED: _agent_ _module_ generated event alert (_data_)','alert_ceased','pandora','','4','','','','',''); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES +(4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','',''); INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`, `priority`, `id_group`, `special_day`, `wizard_level`) VALUES (1,'Critical condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','','','','','','','','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'','[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','','','','','','','',4,0,0,'basic');