From 1e99530fbcf8171fcdfa86657ea21358952d4c55 Mon Sep 17 00:00:00 2001 From: alexhigh Date: Mon, 18 Aug 2014 12:53:59 +0000 Subject: [PATCH] 2014-08-18 Alejandro Gallardo * pandoradb.sql, pandoradb.data.postgreSQL.sql, pandoradb.data.oracle.sql, extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql, extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql, extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: Added some inserts with the new action and command to create a ticket in Integria IMS. * include/styles/pandora.css: Fixed the header style. * operation/menu.php: Now the incidents statistics menu option takes the user to the correct place if the "Integria incidents" option is selected. * operation/integria_incidents/incident.incident.php: Fixed the incident edition. * operation/integria_incidents/incident.php: Improved the tab images. * operation/integria_incidents/incident.workunits.php: Now the default time of the incident workunits is 0. * operation/integria_incidents/incident_detail.php: File removed. * operation/integria_incidents/incident_statistics.php: Now this section show the real statistics of the Integria IMS incidents. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10431 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 31 ++ .../pandoradb_migrate_5.0.x_to_5.1.mysql.sql | 13 +- .../pandoradb_migrate_5.0.x_to_5.1.oracle.sql | 13 +- ...doradb_migrate_5.0.x_to_5.1.postgreSQL.sql | 13 +- pandora_console/include/styles/pandora.css | 7 +- .../integria_incidents/incident.incident.php | 39 +- .../integria_incidents/incident.list.php | 40 +- .../operation/integria_incidents/incident.php | 19 +- .../integria_incidents/incident.workunits.php | 2 +- .../integria_incidents/incident_detail.php | 440 ------------------ .../incident_statistics.php | 42 +- pandora_console/operation/menu.php | 6 +- pandora_console/pandoradb.data.oracle.sql | 2 + pandora_console/pandoradb.data.postgreSQL.sql | 2 + pandora_console/pandoradb_data.sql | 3 +- 15 files changed, 152 insertions(+), 520 deletions(-) delete mode 100755 pandora_console/operation/integria_incidents/incident_detail.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 16853751da..a5efc0233d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,34 @@ +2014-08-18 Alejandro Gallardo + + * pandoradb.sql, + pandoradb.data.postgreSQL.sql, + pandoradb.data.oracle.sql, + extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql, + extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql, + extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: + Added some inserts with the new action and command to create + a ticket in Integria IMS. + + * include/styles/pandora.css: Fixed the header style. + + * operation/menu.php: Now the incidents statistics menu option + takes the user to the correct place if the "Integria incidents" + option is selected. + + * operation/integria_incidents/incident.incident.php: Fixed the + incident edition. + + * operation/integria_incidents/incident.php: Improved the tab + images. + + * operation/integria_incidents/incident.workunits.php: Now the + default time of the incident workunits is 0. + + * operation/integria_incidents/incident_detail.php: File removed. + + * operation/integria_incidents/incident_statistics.php: Now this + section show the real statistics of the Integria IMS incidents. + 2014-08-14 Miguel de Dios * godmode/update_manager/update_manager.online.php, diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql index 5516382577..beb9d06a26 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql @@ -233,4 +233,15 @@ DELETE FROM `trecon_script` WHERE id_recon_script=1; -- --------------------------------------------------------------------- -- Table `tagente_modulo` -- --------------------------------------------------------------------- -ALTER TABLE tagente_modulo MODIFY COLUMN `post_process` double(18,15) default 0; \ No newline at end of file +ALTER TABLE tagente_modulo MODIFY COLUMN `post_process` double(18,15) default 0; + +/* 2014/08/18 */ +-- --------------------------------------------------------------------- +-- Table `talert_commands` +-- --------------------------------------------------------------------- +INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('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\",\"\"]'); + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +INSERT INTO `talert_actions` (`name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql index 72541bbd9a..c06a2a865e 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql @@ -221,4 +221,15 @@ DELETE FROM trecon_script WHERE id_recon_script=1; -- --------------------------------------------------------------------- -- Table `tagente_modulo` -- --------------------------------------------------------------------- -ALTER TABLE tagente_modulo MODIFY COLUMN post_process NUMBER(18,15) default 0; \ No newline at end of file +ALTER TABLE tagente_modulo MODIFY COLUMN post_process NUMBER(18,15) default 0; + +/* 2014/08/18 */ +-- --------------------------------------------------------------------- +-- Table `talert_commands` +-- --------------------------------------------------------------------- +INSERT INTO talert_commands (name, command, description, internal, fields_descriptions, fields_values) VALUES ('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\",\"\"]'); + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +INSERT INTO talert_actions (name, id_alert_command, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, id_group, action_threshold) VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql index 1dc1da9aa5..844fb2cde3 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql @@ -195,4 +195,15 @@ DELETE FROM "trecon_script" WHERE "id_recon_script"=1; -- --------------------------------------------------------------------- -- Table `tagente_modulo` -- --------------------------------------------------------------------- -ALTER TABLE "tagente_modulo" MODIFY COLUMN "post_process" NUMERIC(18,15) default 0; \ No newline at end of file +ALTER TABLE "tagente_modulo" MODIFY COLUMN "post_process" NUMERIC(18,15) default 0; + +/* 2014/08/18 */ +-- --------------------------------------------------------------------- +-- Table `talert_commands` +-- --------------------------------------------------------------------- +INSERT INTO "talert_commands" ("name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES ('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\",\"\"]'); + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +INSERT INTO "talert_actions" ("name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold") VALUES ('Create a ticket in Integria IMS',13,'http://localhost/integria/include/api.php','1234','admin','_agent_: _alert_name_','1','3','_alert_description_','','','',0,0); \ No newline at end of file diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 3c3f29993e..964b3f787d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -284,7 +284,7 @@ div#menu { div#head { font-size: 8pt; - width: 960px; + width: 100%; height: 62px; padding-top: 0px; margin-bottom: 8px; @@ -1871,11 +1871,10 @@ div#main { min-width: 720px; } div#head { - width: auto; - height: auto; - background-color: #333; + width: 100%; height: 47px; min-width: 882px; + background-color: #333; color: white; } diff --git a/pandora_console/operation/integria_incidents/incident.incident.php b/pandora_console/operation/integria_incidents/incident.incident.php index d288837352..7d55bc4aaa 100644 --- a/pandora_console/operation/integria_incidents/incident.incident.php +++ b/pandora_console/operation/integria_incidents/incident.incident.php @@ -16,7 +16,6 @@ global $result; global $result_resolutions; global $result_status; -global $result_sources; global $result_groups; global $result_users; @@ -33,11 +32,6 @@ if (isset ($result_status['status'])) { $status[$st['id']] = $st['name']; } } -if (isset ($result_sources['source'])) { - foreach($result_sources['source'] as $src) { - $sources[$src['id']] = $src['name']; - } -} if (isset ($result_groups['group'])) { foreach($result_groups['group'] as $gr) { $groups[$gr['id']] = $gr['name']; @@ -60,7 +54,6 @@ if(!isset($result['id_incidencia'])) { $result['prioridad'] = 0; $result['resolution'] = 0; $result['id_parent'] = 0; - $result['origen'] = 0; $result['id_incident_type'] = 0; $result['id_task'] = 0; $result['id_creator'] = $config['id_user']; @@ -87,22 +80,22 @@ $table->colspan[3][0] = 3; $table->colspan[4][0] = 3; $table->data[0][0] = "".__('Title')."
".html_print_input_text("title", $result['titulo'], '', 80, 255, true); -if (isset($result['id_incidencia'])) { - $table->data[1][2] = "".__('Assigned user')."
".html_print_select ($users, 'id_user_assigned', $result['id_usuario'], '', '', 0, true, false, false); -} -else { - $table->data[1][2] = ""; -} + +$table->data[0][1] = "".__('Creator')."
".$result['id_creator']; + if (isset($groups)) { $table->data[1][0] = "".__('Group')."
".html_print_select ($groups, 'group', $result['id_grupo'], '', '', 0, true, false, false); } + $table->data[1][1] = "".__('Priority')."
".html_print_select (incidents_get_priorities (), 'priority', $result['prioridad'], '', '', 0, true, false, false); -$table->data[0][1] = "".__('Creator')."
".$result['id_creator']; if (isset($result['id_incidencia'])) { - $table->data[2][0] = "".__('Source')."
".html_print_select ($sources, 'source', $result['origen'], '', '', 0, true, false, false); - $table->data[2][1] = "".__('Resolution')."
".html_print_select ($resolutions, 'resolution', $result['resolution'], '', '', 0, true, false, false); - $table->data[2][2] = "".__('Status')."
".html_print_select ($status, 'status', $result['estado'], '', '', 0, true, false, false); + $table->data[1][2] = "".__('Assigned user')."
".html_print_select ($users, 'id_user_assigned', $result['id_usuario'], '', '', 0, true, false, false); +} + +if (isset($result['id_incidencia'])) { + $table->data[2][0] = "".__('Resolution')."
".html_print_select ($resolutions, 'resolution', $result['resolution'], '', '', 0, true, false, false); + $table->data[2][1] = "".__('Status')."
".html_print_select ($status, 'status', $result['estado'], '', '', 0, true, false, false); } if (is_array($result['descripcion'])) { @@ -111,14 +104,14 @@ if (is_array($result['descripcion'])) { $table->data[3][0] = "".__('Description')."
".html_print_textarea("description", 10, 6, $result['descripcion'] , '', true); -if(isset($result['id_incidencia'])) { -if(is_array($result['epilog'])) { - $result['epilog'] = implode(',', $result['epilog']); -} -$table->data[4][0] = "".__('Resolution epilog')."
".html_print_textarea("epilog", 10, 6, $result['epilog'] , '', true); +if (isset($result['id_incidencia'])) { + if(is_array($result['epilog'])) { + $result['epilog'] = implode(',', $result['epilog']); + } + $table->data[4][0] = "".__('Resolution epilog')."
".html_print_textarea("epilog", 10, 6, $result['epilog'] , '', true); } -if(isset($result['id_incidencia'])) { +if (isset($result['id_incidencia'])) { echo "
"; html_print_table($table); html_print_submit_button(__('Update'), 'submit_button', false, "class='sub upd'"); diff --git a/pandora_console/operation/integria_incidents/incident.list.php b/pandora_console/operation/integria_incidents/incident.list.php index 2d4b29c3da..d9139bce02 100644 --- a/pandora_console/operation/integria_incidents/incident.list.php +++ b/pandora_console/operation/integria_incidents/incident.list.php @@ -91,19 +91,18 @@ $table->size = array (); $table->align = array (); $table->head[0] = __('ID'); -//$table->head[1] = __('SLA'); -$table->head[2] = __('Incident'); -$table->head[3] = __('Group'); -$table->head[4] = __('Status')."
".__('Resolution').""; -$table->head[5] = __('Priority'); -$table->head[6] = __('Updated')."
".__('Started').""; -$table->head[7] = __('Details'); -$table->head[8] = __('Creator'); -$table->head[9] = __('Owner'); -$table->head[10] = __('Action'); +$table->head[1] = __('Incident'); +$table->head[2] = __('Group'); +$table->head[3] = __('Status')."
".__('Resolution').""; +$table->head[4] = __('Priority'); +$table->head[5] = __('Updated')."
".__('Started').""; +$table->head[6] = __('Details'); +$table->head[7] = __('Creator'); +$table->head[8] = __('Owner'); +$table->head[9] = __('Action'); +$table->align[3] = "center"; $table->align[4] = "center"; -$table->align[5] = "center"; if(isset($result['incident'][0]) && is_array($result['incident'][0])) { $incidents = $result['incident']; @@ -125,16 +124,15 @@ foreach ($incidents as $row) { $data = array(); $data[0] = ''.$row["id_incidencia"].''; - //$data[1] = ""; - $data[2] = ''.substr(io_safe_output($row["titulo"]),0,45).''; - $data[3] = $groups[$row["id_grupo"]]; - $data[4] = $status[$row["estado"]]."
".$resolutions[$row["resolution"]].""; - $data[5] = incidents_print_priority_img ($row["prioridad"], true); - $data[6] = ui_print_timestamp ($row["actualizacion"], true)."
" . ui_print_timestamp ($row["inicio"], true).""; - $data[7] = $row["workunits_hours"]." ".__('Hours')."
".$row["workunits_count"]." ".__('Workunits'); - $data[8] = $row["id_creator"]; - $data[9] = $row["id_usuario"]; - $data[10] = "".html_print_image("images/cross.png", true, array('title' => __('Delete incident')))."".html_print_image("images/config.png", true, array('title' => __('View incident details'))).""; + $data[1] = ''.substr(io_safe_output($row["titulo"]),0,45).''; + $data[2] = $groups[$row["id_grupo"]]; + $data[3] = $status[$row["estado"]]."
".$resolutions[$row["resolution"]].""; + $data[4] = incidents_print_priority_img ($row["prioridad"], true); + $data[5] = ui_print_timestamp ($row["actualizacion"], true)."
" . ui_print_timestamp ($row["inicio"], true).""; + $data[6] = $row["workunits_hours"]." ".__('Hours')."
".$row["workunits_count"]." ".__('Workunits'); + $data[7] = !empty($row["id_creator"]) ? $row["id_creator"] : __('None'); + $data[8] = !empty($row["id_usuario"]) ? $row["id_usuario"] : __('None'); + $data[9] = "".html_print_image("images/cross.png", true, array('title' => __('Delete incident')))."".html_print_image("images/config.png", true, array('title' => __('View incident details'))).""; array_push ($table->data, $data); } diff --git a/pandora_console/operation/integria_incidents/incident.php b/pandora_console/operation/integria_incidents/incident.php index b654bc03be..df203d9960 100755 --- a/pandora_console/operation/integria_incidents/incident.php +++ b/pandora_console/operation/integria_incidents/incident.php @@ -51,23 +51,23 @@ else { 'list' => array( 'active' => false, 'text' => '' . - html_print_image ("images/page_white_text.png", true, array ("title" => __('Incidents'))) .''), + html_print_image ("images/list.png", true, array ("title" => __('Incidents'))) .''), 'incident' => array( 'active' => false, 'text' => '' . - html_print_image ("images/eye.png", true, array ("title" => __('Incident details'))) .''), + html_print_image ("images/zoom_mc.png", true, array ("title" => __('Incident details'))) .''), 'workunits' => array( 'active' => false, 'text' => '' . - html_print_image ("images/computer.png", true, array ("title" => __('Workunits'))) .''), + html_print_image ("images/star_white.png", true, array ("title" => __('Workunits'))) .''), 'files' => array( 'active' => false, 'text' => '' . - html_print_image ("images/file.png", true, array ("title" => __('Files'))) .''), + html_print_image ("images/save_mc.png", true, array ("title" => __('Files'))) .''), 'tracking' => array( 'active' => false, 'text' => '' . - html_print_image ("images/comments.png", true, array ("title" => __('Tracking'))) .'')); + html_print_image ("images/gm_log.png", true, array ("title" => __('Tracking'))) .'')); } $buttons[$tab]['active'] = true; @@ -81,10 +81,9 @@ if ($update_incident == 1) { $values[3] = urlencode(io_safe_output(get_parameter('epilog'))); $values[4] = get_parameter('group'); $values[5] = get_parameter('priority'); - $values[6] = get_parameter('source'); - $values[7] = get_parameter('resolution'); - $values[8] = get_parameter('status'); - $values[9] = get_parameter('id_user_assigned'); + $values[6] = get_parameter('resolution'); + $values[7] = get_parameter('status'); + $values[8] = get_parameter('id_user_assigned'); $params = implode($token, $values); @@ -275,7 +274,6 @@ switch ($tab) { } $url_resolutions = $integria_api."&op=get_incidents_resolutions"; $url_status = $integria_api."&op=get_incidents_status"; - $url_sources = $integria_api."&op=get_incidents_sources"; $url_groups = $integria_api."&op=get_groups¶ms=0"; $url_users = $integria_api."&op=get_users"; break; @@ -322,7 +320,6 @@ if (xml_parse(xml_parser_create(), $xml)) { case 'incident': $result_resolutions = incidents_xml_to_array(incidents_call_api($url_resolutions)); $result_status = incidents_xml_to_array(incidents_call_api($url_status)); - $result_sources = incidents_xml_to_array(incidents_call_api($url_sources)); $result_groups = incidents_xml_to_array(incidents_call_api($url_groups)); $result_users = incidents_xml_to_array(incidents_call_api($url_users)); require_once('incident.incident.php'); diff --git a/pandora_console/operation/integria_incidents/incident.workunits.php b/pandora_console/operation/integria_incidents/incident.workunits.php index edaf01fae5..448015216b 100644 --- a/pandora_console/operation/integria_incidents/incident.workunits.php +++ b/pandora_console/operation/integria_incidents/incident.workunits.php @@ -23,7 +23,7 @@ $table->data = array(); $table->colspan[1][0] = 3; $profiles = array(); -$default_time = "0.25"; +$default_time = "0"; $table->data[0][0] = "".__('Time used')."
".html_print_input_text ('time_used', $default_time, '', 10, 255, true); $table->data[0][1] = "".__('Have cost')."
".html_print_checkbox ('have_cost', '', false, true); $table->data[0][2] = "".__('Public')."
".html_print_checkbox ('public', '', true, true); diff --git a/pandora_console/operation/integria_incidents/incident_detail.php b/pandora_console/operation/integria_incidents/incident_detail.php deleted file mode 100755 index b1722223a4..0000000000 --- a/pandora_console/operation/integria_incidents/incident_detail.php +++ /dev/null @@ -1,440 +0,0 @@ - $config["id_user"], - 'id_incident' => $id_inc, - 'nota' => $nota); - $id_nota = db_process_sql_insert('tnota', $values); - - if ($id_nota !== false) { - incidents_process_touch ($id_inc); - } - ui_print_result_message ($id_nota, - __('Successfully added'), - __('Could not be added')); - } - - // Delete note - if (isset ($_POST["delete_nota"])) { - $id_nota = get_parameter_post ("delete_nota", 0); - $note_user = incidents_get_notes_author ($id_nota); - if (((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($note_user == $config["id_user"])) OR ($id_owner == $config["id_user"])) { - // Only admins (manage incident) or owners can modify - // incidents notes. note authors are - // able to delete their own notes - $result = incidents_delete_note ($id_nota); - - if (!empty ($result)) { - incidents_process_touch ($id_inc); - } - ui_print_result_message ($id_nota, - __('Successfully deleted'), - __('Could not be deleted')); - } - } - - // Delete file - if (((check_acl ($config["id_user"], $id_grupo, "IM")==1) OR ($id_owner == $config["id_user"])) AND isset ($_POST["delete_file"])) { - $file_id = (int) get_parameter_post ("delete_file", 0); - $filename = db_get_value ("filename", "tattachment", "id_attachment", $file_id); - - $result = db_process_sql_delete('tattachment', array('id_attachment' => $file_id)); - - if (!empty ($result)) { - unlink ($config["attachment_store"]."/pand".$file_id."_".$filename); - incidents_process_touch ($id_inc); - } - - ui_print_result_message ($result, - __('Successfully deleted'), - __('Could not be deleted')); - } - - // Upload file - if ((check_acl ($config["id_user"], $id_grupo, "IW") == 1) AND isset ($_GET["upload_file"]) AND ($_FILES['userfile']['name'] != "")) { - $description = get_parameter_post ("file_description", __('No description available')); - - // Insert into database - $filename = io_safe_input ($_FILES['userfile']['name']); - $filesize = io_safe_input ($_FILES['userfile']['size']); - - //The following is if you have clamavlib installed - //(php5-clamavlib) and enabled in php.ini - //http://www.howtoforge.com/scan_viruses_with_php_clamavlib - if (extension_loaded ('clamav')) { - cl_setlimits (5, 1000, 200, 0, 10485760); - $malware = cl_scanfile ($_FILES['file']['tmp_name']); - if ($malware) { - $error = 'Malware detected: '.$malware.'
ClamAV version: '.clam_get_version(); - die ($error); //On malware, we die because it's not good to handle it - } - } - - $values = array( - 'id_incidencia' => $id_inc, - 'id_usuario' => $config["id_user"], - 'filename' => $filename, - 'description' => $description, - 'size' => $filesize); - $id_attachment = db_process_sql_insert('tattachment', $values); - - // Copy file to directory and change name - if ($id_attachment !== false) { - $nombre_archivo = $config["attachment_store"]."/pand".$id_attachment."_".$filename; - $result = copy ($_FILES['userfile']['tmp_name'], $nombre_archivo); - } - else { - ui_print_error_message(__('File could not be saved due to database error')); - $result = false; - } - - if ($result !== false) { - unlink ($_FILES['userfile']['tmp_name']); - incidents_process_touch ($id_inc); - } - else { - db_process_sql_delete('tattachment', array('id_attachment' => $id_attachment)); - } - - ui_print_result_message ($result, - __('File uploaded'), - __('File could not be uploaded')); - } -} // else Not given id -// Create incident from event... read event data -elseif (isset ($_GET["insert_form"])) { - $titulo = ""; - $descripcion = ""; - $origen = ""; - $prioridad = 0; - $id_grupo = 0; - $estado = 0; - $texto = ""; - $usuario = $config["id_user"]; - $id_creator = $config["id_user"]; - - if (isset ($_GET["from_event"])) { - $event = get_parameter_get ("from_event"); - $titulo = events_get_description ($event); - $id_grupo = events_get_group ($event); - $origen = "Pandora FMS event"; - unset ($event); - } - $prioridad = 0; - $id_grupo = 0; -} -else { - db_pandora_audit("HACK","Trying to get to incident details in an unusual way"); - require ("general/noaccess.php"); - exit; -} - - - -// ******************************************************************************************************** -// ******************************************************************************************************** -// Show the form -// ******************************************************************************************************** - -//This is for the pretty slide down attachment form -echo ""; - -if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["insert_form"] - ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, ""); - echo ''; - echo ''; -} -else { - ui_print_page_header (__('Create incident'), "images/book_edit.png", false, "", false, ""); - echo ''; -} - -echo ''; -echo ''; - -echo ''; -echo ''; - -echo ''; - -echo '
'.__('Incident').''; - -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_input_text ("titulo", $titulo,'', 70); -} -else { - html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly"); -} - -echo '
'.__('Opened at').''.date ($config['date_format'], $inicio).''.__('Updated at').''.date ($config['date_format'], $actualizacion).'
'.__('Owner').''; - -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135"); -} -else { - html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true); -} -echo ''.__('Status').''; - -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135'); -} -else { - html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true); -} -echo '
'.__('Source').''; - -$fields = array (); -$return = db_get_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen"); -if ($return === false) - $return[0] = $estado; //Something must be displayed - -foreach ($return as $row) { - $fields[$row["origen"]] = $row["origen"]; -} - -// Only owner could change source or user with Incident management privileges -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135'); -} -else { - html_print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135', true); -} -echo ''.__('Group').''; - -// Group combo -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135'); -} -else { - html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true); -} - -echo '
'.__('Priority').''; - -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135'); -} -else { - html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true); -} - -echo ''.__('Creator').''; -if (empty ($id_creator)) { - echo 'SYSTEM'; -} -else { - echo $id_creator.' ('.get_user_fullname($id_creator).')'; -} - -echo '
'; - -if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"'); -} -else { - html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled'); -} - -echo '
'; - -// Only if user is the used who opened incident or (s)he is admin -if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) { - html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"'); -} -elseif (check_acl ($config["id_user"], $id_grupo, "IW")) { - html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"'); -} -else { - html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"'); -} -echo "
"; - -//If we're actually working on an incident -if (isset ($id_inc)) { - // ******************************************************************** - // Notes - // ******************************************************************** - - echo '
'; - - echo ''; - echo html_print_image ('images/add.png', true); - echo __('Add note'); - echo ''; - echo '
'; - echo '

'.__('Add note').'

'; - echo ' - - -
'; - - $result = incidents_get_notes ($id_inc); - - $table->cellpadding = 4; - $table->cellspacing = 4; - $table->class = "databox"; - $table->width = 600; - $table->data = array (); - $table->head = array (); - - foreach ($result as $row) { - $data = array (); - $data[0] = html_print_image("images/page_white_text.png", true, array("border" => '0')); - $data[1] = __('Author').': ' . ui_print_username ($row["id_usuario"], true).' (' . ui_print_timestamp ($row["timestamp"], true).')'; - array_push ($table->data, $data); - - $data = array (); - $data[0] = ''; - if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($row["id_usuario"] == $config["id_user"])) { - $data[0] .= html_print_input_image ("delete_nota", "images/cross.png", $row["id_nota"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true); - } - $data[1] = $row["nota"]; - array_push ($table->data, $data); - } - - if (!empty ($table->data)) { - echo "

".__('Notes attached to incident').'

'; - echo '
'; - html_print_table ($table); - echo '
'; - } - unset ($table); - - - // ************************************************************ - // Files attached to this incident - // ************************************************************ - - $result = incidents_get_attach ($id_inc); - - $table->cellpadding = 4; - $table->cellspacing = 4; - $table->class = "databox"; - $table->width = 650; - $table->head = array (); - $table->data = array (); - - $table->head[0] = __('Filename'); - $table->head[1] = __('Description'); - $table->head[2] = __('Size'); - $table->head[3] = __('Delete'); - - $table->align[2] = "center"; - $table->align[3] = "center"; - - foreach ($result as $row) { - $data[0] = html_print_image("images/disk.png", true, array("border" => '0', "align" => "top")) . '  '.$row["filename"].''; - $data[1] = $row["description"]; - $data[2] = format_for_graph ($row["size"])."B"; - if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { - $data[3] = html_print_input_image ("delete_file", "images/cross.png", $row["id_attachment"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true); - } - else { - $data[3] = ''; - } - array_push ($table->data, $data); - } - - if (!empty ($table->data)) { - echo "

".__('Attached files')."

"; - echo '
'; - html_print_table ($table); - echo '
'; - } - unset ($table); - - // ************************************************************ - // Upload control - // ************************************************************ - - - // Upload control - if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) { - - echo ''; - - echo '

'.__('Add attachment').'

'; - echo ' - - - -
'.__('Filename').'
'.__('Description').'
'; - } -} -?> diff --git a/pandora_console/operation/integria_incidents/incident_statistics.php b/pandora_console/operation/integria_incidents/incident_statistics.php index 985b345374..c7d9a0cc8c 100755 --- a/pandora_console/operation/integria_incidents/incident_statistics.php +++ b/pandora_console/operation/integria_incidents/incident_statistics.php @@ -28,21 +28,35 @@ if (! check_acl ($config['id_user'], 0, "IR") == 1) { } ui_print_page_header (__('Statistics'), "images/book_edit.png", false, "", false, ""); +$integria_api = $config['integria_url']."/include/api.php?user=".$config['id_user']."&pass=".$config['integria_api_password']; +$op = 'get_stats'; +$url = "$integria_api&op=$op"; + +$curlObj = curl_init(); +curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); +curl_setopt($curlObj, CURLOPT_URL, $url . "¶ms=opened"); +$opened_tickets = curl_exec($curlObj); +curl_setopt($curlObj, CURLOPT_URL, $url . "¶ms=closed"); +$closed_tickets = curl_exec($curlObj); +curl_close($curlObj); + +$opened_tickets = trim($opened_tickets); +$closed_tickets = trim($closed_tickets); + +if (!is_numeric($opened_tickets)) + $opened_tickets = 0; +if (!is_numeric($closed_tickets)) + $closed_tickets = 0; + +$data = array(); +$data[__('Opened tickets')] = $opened_tickets; +$data[__('Closed tickets')] = $closed_tickets; + echo '

'.__('Incidents by status').'

'; -echo graph_incidents_status (); - -echo '

'.__('Incidents by priority').'

'; -echo grafico_incidente_prioridad (); - -echo '

'.__('Incidents by group').'

'; -echo graphic_incident_group(); - -echo '

'.__('Incidents by user').'

'; -echo graphic_incident_user(); - -echo '

'.__('Incidents by source').'

'; -echo graphic_incident_source(); +echo pie3d_graph($config['flash_charts'], $data, 370, 180, + __('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png", + $config['fontpath'], $config['font_size']); echo '
'; -?> +?> \ No newline at end of file diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 17fafe5490..6a6ddacc76 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -291,9 +291,11 @@ if (check_acl ($config['id_user'], 0, "IR") == 1) { $temp_sec2 = $sec2; if($config['integria_enabled']) { $sec2 = "operation/integria_incidents/incident"; + $sec2sub = "operation/integria_incidents/incident_statistics"; } else { $sec2 = "operation/incidents/incident"; + $sec2sub = "operation/incidents/incident_statistics"; } $sub[$sec2]["text"] = __('Incidents'); @@ -301,9 +303,9 @@ if (check_acl ($config['id_user'], 0, "IR") == 1) { $sub[$sec2]["subsecs"] = array( "operation/incidents/incident_detail", "operation/integria_incidents"); - + $sub2 = array (); - $sub2["operation/incidents/incident_statistics"]["text"] = __('Statistics'); + $sub2[$sec2sub]["text"] = __('Statistics'); $sub[$sec2]["sub2"] = $sub2; $sec2 = $temp_sec2; diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 0aa98cd627..35aa53743b 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -37,6 +37,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\",\"\"]'); COMMIT; END;; @@ -1081,6 +1082,7 @@ 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',11,'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, 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',13,'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 45c5bfe67e..c83e356651 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -34,6 +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\",\"\"]'); SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands))); -- @@ -1001,6 +1002,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',11,'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", "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',13,'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))); 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'); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index c539e85673..cdeb3da013 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -22,6 +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\",\"\"]'); -- -- Dumping data for table `tconfig` @@ -983,7 +984,7 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal 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',11,'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',13,'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');