Improved integria alert action TICKET #3091

This commit is contained in:
fermin831 2016-01-25 14:41:10 +01:00
parent def678f37b
commit 10a46fcd74
4 changed files with 49 additions and 23 deletions

View File

@ -40,7 +40,7 @@ INSERT INTO talert_commands (id, name, command, description, internal, fields_de
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name',0,'[\"User alias\",\"Chatroom name\",\Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools.  Uses field2 as text message, field1 as destination phone (include international prefix!)',0,'[\"Destination number\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)',1,'[\"Agent name\",\"Module name\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]');
INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]');
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\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
-- Update curr val of sequence
@ -1212,7 +1212,7 @@ EXECUTE IMMEDIATE 'ALTER TRIGGER talert_actions_inc DISABLE';
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_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','integria','_agent_: _alert_name_','1','3','copy@dom.com','admin','_alert_description_',0,0,'','','','','','','','','','');
-- Update curr val of sequence
update_currval('talert_actions', 'id');

View File

@ -34,7 +34,7 @@ INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name',0,'[\"User alias\",\"Chatroom name\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools.  Uses field2 as text message, field1 as destination phone (include international prefix!)',0,'[\"Destination number\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)',1,'[\"Agent name\",\"Module name\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]');
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]');
SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands)));
--
@ -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", "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_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','integria','_agent_: _alert_name_','1','3','copy@dom.com','admin','_alert_description_',0,0,'','','','','','','','','','');
SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions)));
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "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", "field2_recovery", "field3_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');

View File

@ -22,7 +22,7 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name',0,'[\"User alias\",\"Chatroom name\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools.  Uses field2 as text message, field1 as destination phone (include international prefix!)',0,'[\"Destination number\",\"Message\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)',1,'[\"Agent name\",\"Module name\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\"]');
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (11,'Integria IMS Ticket','Internal type','This alert create a ticket into your Integria IMS.',1,'[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]');
--
-- Dumping data for table `tconfig`
@ -994,7 +994,7 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field
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,'','','','','','','','','','');
(4,'Create a ticket in Integria IMS',11,'http://localhost/integria/include/api.php','1234','admin','integria','_agent_: _alert_name_','1','3','copy@dom.com','admin','_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');

View File

@ -1196,9 +1196,11 @@ sub pandora_execute_action ($$$$$$$$$;$) {
} elsif ($clean_name eq "Integria IMS Ticket") {
$field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module);
$field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module);
$field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module);
$field6 = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module);
$field5 = subst_alert_macros ($field5, \%macros, $pa_config, $dbh, $agent, $module);
$field7 = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module);
$field8 = subst_alert_macros ($field8, \%macros, $pa_config, $dbh, $agent, $module);
$field9 = subst_alert_macros ($field9, \%macros, $pa_config, $dbh, $agent, $module);
$field10 = subst_alert_macros ($field10, \%macros, $pa_config, $dbh, $agent, $module);
# Field 1 (Integria IMS API path)
my $api_path = $field1;
@ -1209,28 +1211,37 @@ sub pandora_execute_action ($$$$$$$$$;$) {
# Field 3 (Integria IMS user)
my $integria_user = $field3;
# Field 4 (Ticket name)
my $ticket_name = $field4;
# Field 4 (Integria IMS user password)
my $integria_user_pass = $field4;
# Field 5 (Ticket name)
my $ticket_name = $field5;
if ($ticket_name eq "") {
$ticket_name = "Pandora FMS alert action created by API";
}
# Field 5 (Ticket group ID)
my $ticket_group_id = $field5;
# Field 6 (Ticket group ID)
my $ticket_group_id = $field6;
if ($ticket_group_id eq '') {
$ticket_group_id = 0;
}
# Field 6 (Ticket priority);
my $ticket_priority = $field6;
# Field 7 (Ticket priority);
my $ticket_priority = $field7;
if ($ticket_priority eq '') {
$ticket_priority = 0;
}
# Field 7 (Ticket description);
my $ticket_description = $field7;
# Field 8 (Ticket email)
my $ticket_email = $field8;
pandora_create_integria_ticket($pa_config, $api_path, $api_pass, $integria_user, $ticket_name, $ticket_group_id, $ticket_priority, $ticket_description);
# Field 9 (Ticket owner)
my $ticket_owner = $field9;
# Field 10 (Ticket description);
my $ticket_description = $field10;
pandora_create_integria_ticket($pa_config, $api_path, $api_pass, $integria_user, $integria_user_pass, $ticket_name, $ticket_group_id, $ticket_priority, $ticket_email, $ticket_owner, $ticket_description);
# Unknown
} else {
@ -5019,8 +5030,8 @@ sub pandora_edit_custom_graph ($$$$$$$$$$$) {
return $res;
}
sub pandora_create_integria_ticket ($$$$$$$$) {
my ($pa_config,$api_path,$api_pass,$integria_user,$ticket_name,$group_id,$ticket_priority,$ticket_description) = @_;
sub pandora_create_integria_ticket ($$$$$$$$$$$) {
my ($pa_config,$api_path,$api_pass,$integria_user,$user_pass,$ticket_name,$group_id,$ticket_priority,$ticket_email,$ticket_owner,$ticket_description,) = @_;
my $data_ticket;
my $call_api;
@ -5028,6 +5039,9 @@ sub pandora_create_integria_ticket ($$$$$$$$) {
if ($api_path eq "") {
return 0;
}
if ($user_pass eq "") {
return 0;
}
if ($integria_user eq "") {
$integria_user = "admin";
}
@ -5035,19 +5049,31 @@ sub pandora_create_integria_ticket ($$$$$$$$) {
$ticket_name = "Ticket created by Pandora FMS";
}
if ($group_id eq "") {
$group_id = 0;
$group_id = 1;
}
if ($ticket_priority eq "") {
$ticket_priority = 1;
}
if ($ticket_owner eq "") {
$ticket_owner = "admin";
}
$data_ticket = $ticket_name .
"|;|" . $group_id .
"|;|" . $ticket_priority .
"|;|" . $ticket_description;
"|;|" . $ticket_description .
"|;|" . #Id inventory
"|;|" . #Id incident type
"|;|" . $ticket_email .
"|;|" . $ticket_owner .
"|;|" . #Father ticket id
"|;|" . #Status
"|;|" . #Extra info
"|;|"; #Resolution
$call_api = $api_path . '?' .
'user=' . $integria_user . '&' .
'user_pass=' . $user_pass . '&' .
'pass=' . $api_pass . '&' .
'op=create_incident&' .
'params=' . $data_ticket .'&' .