From 36afbea8b7eab3f770a75500167a520471bfc814 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 22 May 2019 11:53:57 +0200 Subject: [PATCH 001/306] Add new search for id source event in metaconsole --- pandora_console/include/functions_events.php | 17 ++++++++ .../operation/events/events_list.php | 42 ++++++++++++++++--- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 52eb525bc1..7b75906b5e 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -32,6 +32,9 @@ require_once $config['homedir'].'/include/functions.php'; enterprise_include_once('meta/include/functions_events_meta.php'); enterprise_include_once('meta/include/functions_agents_meta.php'); enterprise_include_once('meta/include/functions_modules_meta.php'); +if (is_metaconsole()) { + $id_source_event = get_parameter('id_source_event'); +} /** @@ -228,11 +231,25 @@ function events_get_events_grouped( db_process_sql('SET group_concat_max_len = 9999999'); $event_lj = events_get_secondary_groups_left_join($table); if ($total) { + if (is_metaconsole()) { + $id_source_event = get_parameter('id_source_event'); + if ($id_source_event != '') { + $sql_post .= "AND id_source_event = $id_source_event"; + } + } + $sql = "SELECT COUNT(*) FROM (SELECT id_evento FROM $table te $event_lj WHERE 1=1 ".$sql_post.' GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra.') AS t'; } else { + if (is_metaconsole()) { + $id_source_event = get_parameter('id_source_event'); + if ($id_source_event != '') { + $sql_post .= "AND id_source_event = $id_source_event"; + } + } + $sql = "SELECT *, MAX(id_evento) AS id_evento, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '
') AS user_comment, GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids, diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 8333ca5b0d..728af2f422 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -48,6 +48,9 @@ check_login(); $sort_field = get_parameter('sort_field', 'timestamp'); $sort_order = get_parameter('sort', 'down'); +if (is_metaconsole()) { + $id_source_event = get_parameter('id_source_event'); +} $event_a = check_acl($config['id_user'], 0, 'ER'); $event_w = check_acl($config['id_user'], 0, 'EW'); @@ -125,6 +128,10 @@ if (is_ajax()) { $values['id_extra'] = get_parameter('id_extra'); $values['user_comment'] = get_parameter('user_comment'); + if (is_metaconsole()) { + $values['id_source_event'] = get_parameter('id_source_event'); + } + $exists = (bool) db_get_value_filter( 'id_filter', 'tevent_filter', @@ -172,6 +179,10 @@ if (is_ajax()) { $values['id_extra'] = get_parameter('id_extra'); $values['user_comment'] = get_parameter('user_comment'); + if (is_metaconsole()) { + $values['id_source_event'] = get_parameter('id_source_event'); + } + if (io_safe_output($values['tag_with']) == '["0"]') { $values['tag_with'] = '[]'; } @@ -248,6 +259,10 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) { $user_comment = $user_default_filter['user_comment']; $source = $user_default_filter['source']; + if (is_metaconsole()) { + $id_source_event = $user_default_filter['id_source_event']; + } + if ($user_default_filter['search'] != '') { $search = $user_default_filter['search']; } @@ -984,8 +999,12 @@ $data[2] .= html_print_input_text( 255, true ); -$table->data[] = $data; -$table->rowclass[] = ''; +if (is_metaconsole()) { + $data[3] = __('Id source event').$jump; + $data[3] .= html_print_input_text('id_source_event', $id_source_event, '', 11, 255, true); + $table->data[] = $data; + $table->rowclass[] = ''; +} $data = []; $data[0] = ui_toggle( @@ -1335,6 +1354,8 @@ $(document).ready( function() { $("#text-id_extra").val(val); if (i == 'user_comment') $("#text-user_comment").val(val); + if (i == 'id_source_event') + $("#text-id_source_event").val(val); }); reorder_tags_inputs(); // Update the info with the loaded filter @@ -1374,7 +1395,10 @@ $(document).ready( function() { $("#text-source").val(''); $("#text-id_extra").val(''); $("#text-user_comment").val(''); - + + if(is_metaconsole()){ + $("#text-id_source_event").val(''); + } clear_tags_inputs(); // Update the view of filter load with no loaded filters message @@ -1448,6 +1472,10 @@ $(document).ready( function() { $("#text-id_extra").val(val); if (i == 'user_comment') $("#text-user_comment").val(val); + + if(is_metaconsole()){if (i == 'id_source_event') + $("#text-id_source_event").val(val); + } }); reorder_tags_inputs(); // Update the info with the loaded filter @@ -1516,7 +1544,9 @@ $(document).ready( function() { "date_to": $("#text-date_to").val(), "source": $("#text-source").val(), "id_extra": $("#text-id_extra").val(), - "user_comment": $("#text-user_comment").val() + "user_comment": $("#text-user_comment").val(), + "id_source_event": $("#text-id_extra").val() + }, function (data) { $(".info_box").hide(); @@ -1616,7 +1646,9 @@ $(document).ready( function() { "date_to": $("#text-date_to").val(), "source": $("#text-source").val(), "id_extra": $("#text-id_extra").val(), - "user_comment": $("#text-user_comment").val() + "user_comment": $("#text-user_comment").val(), + "id_source_event": $("#text-id_source_event").val() + }, function (data) { $(".info_box").hide(); From a0c6dc69aa41bf691c332500b1fc345fd4f838a0 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 21 Jun 2019 11:22:06 +0200 Subject: [PATCH 002/306] add element id_source_event to filters events --- .../operation/events/events.build_query.php | 6 ++++ .../operation/events/events_list.php | 34 +++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index f915a5093b..0d51282b36 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -50,6 +50,12 @@ if (!isset($date_to)) { $date_to = ''; } +if ($id_source_event != 0 || $id_source_event != '') { + $filter_resume['id_source_event'] = $id_source_event; +} else { + $id_source_event = ''; +} + if (($date_from === '') && ($date_to === '')) { if ($event_view_hr > 0) { $filter_resume['hours_max'] = $event_view_hr; diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 728af2f422..e0c5915941 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -258,6 +258,7 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) { $id_extra = $user_default_filter['id_extra']; $user_comment = $user_default_filter['user_comment']; $source = $user_default_filter['source']; + $id_source_event = $user_default_filter['id_source_event']; if (is_metaconsole()) { $id_source_event = $user_default_filter['id_source_event']; @@ -1001,9 +1002,14 @@ $data[2] .= html_print_input_text( ); if (is_metaconsole()) { $data[3] = __('Id source event').$jump; - $data[3] .= html_print_input_text('id_source_event', $id_source_event, '', 11, 255, true); - $table->data[] = $data; - $table->rowclass[] = ''; + $data[3] .= html_print_input_text( + 'id_source_event', + $id_source_event, + '', + 5, + 255, + true + ); } $data = []; @@ -1170,12 +1176,14 @@ enterprise_hook( [ $filter_resume, [ - 'status' => $fields, - 'event_type' => $types, - 'severity' => $severities, - 'duplicate' => $repeated_sel, - 'alerts' => $alert_events_titles, - 'groups' => $user_groups_array, + 'status' => $fields, + 'event_type' => $types, + 'severity' => $severities, + 'duplicate' => $repeated_sel, + 'alerts' => $alert_events_titles, + 'groups' => $user_groups_array, + 'id_source_event' => $id_source_event, + ], ] ); @@ -1395,10 +1403,8 @@ $(document).ready( function() { $("#text-source").val(''); $("#text-id_extra").val(''); $("#text-user_comment").val(''); - - if(is_metaconsole()){ $("#text-id_source_event").val(''); - } + clear_tags_inputs(); // Update the view of filter load with no loaded filters message @@ -1473,7 +1479,7 @@ $(document).ready( function() { if (i == 'user_comment') $("#text-user_comment").val(val); - if(is_metaconsole()){if (i == 'id_source_event') + if(i == 'id_source_event') $("#text-id_source_event").val(val); } }); @@ -1545,7 +1551,7 @@ $(document).ready( function() { "source": $("#text-source").val(), "id_extra": $("#text-id_extra").val(), "user_comment": $("#text-user_comment").val(), - "id_source_event": $("#text-id_extra").val() + "id_source_event": $("#text-id_source_event").val() }, function (data) { From 1dc826c9ff178bd1a18966d9b721245081adc961 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 21 Jun 2019 11:29:51 +0200 Subject: [PATCH 003/306] Added field to tevent_filter (id_source_event) --- pandora_console/extras/mr/29.sql | 5 +++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 1 + pandora_console/pandoradb.sql | 1 + 3 files changed, 7 insertions(+) create mode 100644 pandora_console/extras/mr/29.sql diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql new file mode 100644 index 0000000000..a140d8bd58 --- /dev/null +++ b/pandora_console/extras/mr/29.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE tevent_filter ADD column id_source_event int(10); + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d5ddbdd740..8846f4b80d 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1277,6 +1277,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; +ALTER TABLE tevent_filter ADD column id_source_event int(10); -- --------------------------------------------------------------------- -- Table `tusuario` -- --------------------------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 254918026a..8e64d738bc 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1101,6 +1101,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `source` tinytext NOT NULL, `id_extra` tinytext NOT NULL, `user_comment` text NOT NULL, + `id_source_event` int(10) default NULL, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 3fd12975aa173b11b1f82be34e79eedcc671bd51 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 21 Jun 2019 11:34:36 +0200 Subject: [PATCH 004/306] added 2 lines --- pandora_console/operation/events/events_list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index e0c5915941..32880e420f 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -1012,6 +1012,9 @@ if (is_metaconsole()) { ); } +$table->data[] = $data; +$table->rowclass[] = ''; + $data = []; $data[0] = ui_toggle( html_print_table($table_advanced, true), From 56a7943a06989919fdb434f6a97db8c225ce898c Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Fri, 21 Jun 2019 11:35:56 +0200 Subject: [PATCH 005/306] Update pandoradb_migrate_6.0_to_7.0.mysql.sql --- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 18bad4b86a..2ccdcf423c 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1277,7 +1277,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; -ALTER TABLE tevent_filter ADD column id_source_event int(10); +ALTER TABLE tevent_filter ADD COLUMN id_source_event int(10); -- --------------------------------------------------------------------- -- Table `tusuario` -- --------------------------------------------------------------------- From fb24d9bf868825cea3c8298094de15adba3499e6 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Fri, 21 Jun 2019 12:08:31 +0200 Subject: [PATCH 006/306] Update 29.sql --- pandora_console/extras/mr/29.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql index a140d8bd58..65aaee1527 100644 --- a/pandora_console/extras/mr/29.sql +++ b/pandora_console/extras/mr/29.sql @@ -1,5 +1,7 @@ START TRANSACTION; +DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x'; + ALTER TABLE tevent_filter ADD column id_source_event int(10); COMMIT; From 31ec8933a2cbd2fe26e3cbe9e6b0f4656c0dfc0f Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 21 Jun 2019 12:37:32 +0200 Subject: [PATCH 007/306] changed duplicated code with id_souce_event field --- pandora_console/include/functions_events.php | 21 +++++++------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 2e0377769d..54f7ba4da0 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1309,28 +1309,21 @@ function events_get_events_grouped( $groupby_extra = ''; } + if (is_metaconsole()) { + $id_source_event = get_parameter('id_source_event'); + if ($id_source_event != '') { + $sql_post .= "AND id_source_event = $id_source_event"; + } + } + db_process_sql('SET group_concat_max_len = 9999999'); $event_lj = events_get_secondary_groups_left_join($table); if ($total) { - if (is_metaconsole()) { - $id_source_event = get_parameter('id_source_event'); - if ($id_source_event != '') { - $sql_post .= "AND id_source_event = $id_source_event"; - } - } - $sql = "SELECT COUNT(*) FROM (SELECT id_evento FROM $table te $event_lj WHERE 1=1 ".$sql_post.' GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra.') AS t'; } else { - if (is_metaconsole()) { - $id_source_event = get_parameter('id_source_event'); - if ($id_source_event != '') { - $sql_post .= "AND id_source_event = $id_source_event"; - } - } - $sql = "SELECT *, MAX(id_evento) AS id_evento, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '
') AS user_comment, GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids, From 6c45f51e64c34d233102d76f3d4a31c53e893ebe Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 25 Jul 2019 16:07:42 +0200 Subject: [PATCH 008/306] Deleted help icon --- pandora_console/include/functions_profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_profile.php b/pandora_console/include/functions_profile.php index 3308cd89b7..dc9f92eb64 100644 --- a/pandora_console/include/functions_profile.php +++ b/pandora_console/include/functions_profile.php @@ -314,7 +314,7 @@ function profile_print_profile_table($id) $tags = tags_get_all_tags(); $data['tags'] = html_print_select($tags, 'assign_tags[]', '', '', __('Any'), '', true, true); - $data['hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true).ui_print_help_icon('no_hierarchy', true); + $data['hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true); $data['actions'] = html_print_input_image('add', 'images/add.png', 1, '', true); $data['actions'] .= html_print_input_hidden('id', $id, true); From 2c79d5a61e7db8ce83eac3fe7a21d2228d713de0 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 7 Aug 2019 10:45:49 +0200 Subject: [PATCH 009/306] Added acl and fixed in meta - #4427 --- pandora_console/include/functions_api.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 899add9ec0..8d18534ab6 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11759,12 +11759,23 @@ function api_get_netflow_get_summary($discard_1, $discard_2, $params) function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnType='string') { global $config; + + if (!check_acl($config['id_user'], 0, 'EW')) { + returnError('forbidden', 'string'); + return; + } + + $table_events = 'tevento'; + if (is_metaconsole()) { + $table_events = 'tmetaconsole_event'; + } + $data['type'] = 'string'; - $check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id); + $check_id = db_get_value('id_evento', $table_events, 'id_evento', $id); if ($check_id) { // event exists - $status = db_get_value('estado', 'tevento', 'id_evento', $id); + $status = db_get_value('estado', $table_events, 'id_evento', $id); if ($status == 1) { // event already validated $data['data'] = 'Event already validated'; @@ -11778,7 +11789,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy 'estado' => 1, ]; - $result = db_process_sql_update('tevento', $values, ['id_evento' => $id]); + $result = db_process_sql_update($table_events, $values, ['id_evento' => $id]); if ($result === false) { $data['data'] = 'Error validating event'; From 762a8ad4ca1a48dec21592d6ee4574cd008b00de Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 7 Aug 2019 11:39:16 +0200 Subject: [PATCH 010/306] remove entities custom graph bullet chart --- pandora_console/include/functions_graph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d6ce0ba8af..69f56712d7 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1739,7 +1739,7 @@ function graphic_combined_module( $search_in_history_db = db_search_in_history_db($datelimit); - $temp[$module] = modules_get_agentmodule($module); + $temp[$module] = io_safe_output(modules_get_agentmodule($module)); $query_last_value = sprintf( ' SELECT datos From 8fd1f3c99e9d0349aac6254e944095eb6dd5ebdb Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 29 Aug 2019 10:07:50 +0200 Subject: [PATCH 011/306] Added compact mode to show timestamp - #4233 --- pandora_console/godmode/setup/setup_visuals.php | 17 ++++++++++++----- pandora_console/include/functions_ui.php | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 0e7e41e7d6..e07326fe6e 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1169,16 +1169,23 @@ $row++; if ($config['prominent_time'] == 'comparation') { $timestamp = false; $comparation = true; + $compact = false; } else if ($config['prominent_time'] == 'timestamp') { $timestamp = true; $comparation = false; + $compact = false; + } else if ($config['prominent_time'] == 'compact') { + $timestamp = false; + $comparation = false; + $compact = true; } - $table_other->data[$row][0] = __('Timestamp or time comparation'); - $table_other->data[$row][1] = __('Comparation in rollover').' '; - $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', '', $comparation, true); - $table_other->data[$row][1] .= '
'.__('Timestamp in rollover').' '; - $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', '', $timestamp, true); + $table_other->data[$row][0] = __('Timestamp, time comparation, or Compact mode'); + $table_other->data[$row][1] = '
'; + $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', __('Comparation in rollover'), $comparation, true); + $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', __('Timestamp in rollover'), $timestamp, true); + $table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'compact', __('Compact mode'), $compact, true); + $table_other->data[$row][1] .= '
'; $row++; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 008c05b8d7..9f897767df 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -535,6 +535,10 @@ function ui_print_timestamp($unixtime, $return=false, $option=[]) date2strftime_format($config['date_format']), $unixtime ); + } else if ($prominent == 'compact') { + $units = 'tiny'; + $title = human_time_comparation($unixtime); + $data = human_time_comparation($unixtime, $units); } else { $title = date($config['date_format'], $unixtime); $units = 'large'; From a9a2ca5178077b49b58454e9a3fafab046574625 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Fri, 30 Aug 2019 11:58:50 +0200 Subject: [PATCH 012/306] Change label for disabled status - #4573 --- pandora_console/godmode/agentes/agent_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 6ee2343fc0..76eacc0808 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -667,7 +667,7 @@ $table_adv_status .= html_print_checkbox_switch( $disabled, true ); -$table_adv_status .= '

'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'

'; +$table_adv_status .= '

'.__('Disabled mode').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'

'; $table_adv_status .= ''; // Url address. From 90b61533f856dfb9b8f7693c3d9bc89a47e71243 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 10 Sep 2019 10:26:28 +0200 Subject: [PATCH 013/306] Fixed visual bugs in black theme - #4572 --- pandora_console/general/news_dialog.php | 2 +- pandora_console/images/icon_error_db.png | Bin 2165 -> 2379 bytes pandora_console/images/icon_error_mr.png | Bin 2183 -> 2415 bytes pandora_console/images/icon_info_mr.png | Bin 1653 -> 1690 bytes pandora_console/images/icon_success_db.png | Bin 2255 -> 2082 bytes pandora_console/images/icon_success_mr.png | Bin 2228 -> 1987 bytes pandora_console/images/icon_warning_db.png | Bin 2121 -> 1882 bytes .../include/styles/pandora_black.css | 41 +++++++++++++++++- 8 files changed, 40 insertions(+), 3 deletions(-) diff --git a/pandora_console/general/news_dialog.php b/pandora_console/general/news_dialog.php index 37ca016edf..9ab685d39f 100644 --- a/pandora_console/general/news_dialog.php +++ b/pandora_console/general/news_dialog.php @@ -40,7 +40,7 @@ if (!empty($news)) { // Prints news dialog template echo ''; // Learn mode / Normal mode. $table_adv_module_mode = '

'.__('Module definition').':

'; From b12facc89b35131b49027cdd882e228dff43625b Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 12 Sep 2019 12:25:31 +0200 Subject: [PATCH 015/306] Remove hint in metaconsole monitoring view --- pandora_console/include/functions_html.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 08d60dbb6e..2f66590a1c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2812,9 +2812,12 @@ function html_print_autocomplete_modules( ['style' => 'background: url(images/search_module.png) no-repeat right;'] ); html_print_input_hidden($name.'_hidden', $id_agent_module); - ui_print_help_tip(__('Type at least two characters to search the module.'), false); - $javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false); + if (!is_metaconsole()) { + ui_print_help_tip(__('Type at least two characters to search the module.'), false); + } + + $javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false); ?> '; + } + + if (!$return) { + echo $output; + } + + return $output; +} + + /** * Generate needed code to print a datatables jquery plugin. * diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index 27a972425b..4d41cb3cd5 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -4,8 +4,28 @@ border: none; } +.remove_agent { + background-image: url("../../images/darrowleft.png"); + background-repeat: no-repeat; + border: none; +} + .edit_yaml { margin-left: 39px; margin-top: 10px; margin-bottom: 10px; } + +li > input[type="text"] { + border: 1px solid lightgrey; + border-radius: 0; + font-family: "lato-bolder", "Open Sans", sans-serif; + font-weight: lighter; + padding: 0px 0px 2px 0px; + box-sizing: border-box; + margin-bottom: 4px; +} + +.margin_button { + margin-right: 5px; +} From 7bfa0762635c73d056c1efb07c848e956293e0b6 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 30 Oct 2019 14:52:10 +0100 Subject: [PATCH 028/306] fixed error bbdd --- pandora_console/extras/mr/33.sql | 2 +- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- pandora_console/pandoradb.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 9f9e857965..c34209b867 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -21,7 +21,7 @@ CREATE TABLE `tremote_command` ( CREATE TABLE `tremote_command_target` ( `id` SERIAL, - `rcmd_id` bigint unsigned NOT NULL unique, + `rcmd_id` bigint unsigned NOT NULL, `id_agente` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, `stdout` text, diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d72c908400..d195823d7b 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2320,7 +2320,7 @@ CREATE TABLE `tremote_command` ( -- ---------------------------------------------------------------------- CREATE TABLE `tremote_command_target` ( `id` SERIAL, - `rcmd_id` bigint unsigned NOT NULL unique, + `rcmd_id` bigint unsigned NOT NULL, `id_agente` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, `stdout` text, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 61eab5f300..1b235f6d01 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3679,7 +3679,7 @@ CREATE TABLE `tremote_command` ( -- ---------------------------------------------------------------------- CREATE TABLE `tremote_command_target` ( `id` SERIAL, - `rcmd_id` bigint unsigned NOT NULL unique, + `rcmd_id` bigint unsigned NOT NULL, `id_agente` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, `stdout` text, From a3ea32d3553942268bb2f2541c50667ad56a0b50 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 31 Oct 2019 14:12:45 +0100 Subject: [PATCH 029/306] fix bug in bars graph visual console editor --- pandora_console/include/ajax/visual_console_builder.ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 2d37092078..31a9fd1897 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -1279,7 +1279,7 @@ switch ($action) { [ 'disabled' => 0, 'id_agente' => $elementFields['id_agent'], - 'tagente_modulo.id_tipo_modulo IN' => '(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,17,23,3,10,33)', + 'tagente_modulo.id_tipo_modulo IN' => '(17,23,3,10,33)', ] ); From c72f792d4367cb0ef7a62eac408290306cdedd95 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 31 Oct 2019 18:18:38 +0100 Subject: [PATCH 030/306] SAP discovery task --- pandora_console/include/constants.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 893a4f6202..4c092bad52 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -590,6 +590,7 @@ define('DISCOVERY_CLOUD_AWS_EC2', 6); define('DISCOVERY_CLOUD_AWS_RDS', 7); define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8); define('DISCOVERY_DEPLOY_AGENTS', 9); +define('DISCOVERY_APP_SAP', 10); // Discovery types matching definition. From 5a42e76650cc2f70e7073cea1d124d6258524311 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 31 Oct 2019 18:19:00 +0100 Subject: [PATCH 031/306] SAP discovery task --- pandora_console/include/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 4c092bad52..886c1f7c20 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -537,7 +537,7 @@ define('NODE_GENERIC', 3); define('STATUS_OK', 0); define('STATUS_ERROR', 1); -// Maps (new networkmaps and new visualmaps). +// Maps new networkmaps and new visualmaps. define('MAP_TYPE_NETWORKMAP', 0); define('MAP_TYPE_VISUALMAP', 1); From 115c884cd4d67c0e3f1d54ce96d24c65ea929962 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 31 Oct 2019 21:13:18 +0100 Subject: [PATCH 032/306] Discovery SAP --- pandora_console/extras/mr/33.sql | 2 ++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- .../godmode/wizards/DiscoveryTaskList.class.php | 3 +++ pandora_console/godmode/wizards/Wizard.main.php | 5 ++++- .../include/class/CredentialStore.class.php | 11 +++++++++-- pandora_console/pandoradb.sql | 2 +- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index eeca8ed5d7..56357b388b 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -6,4 +6,6 @@ INSERT INTO `ttipo_modulo` VALUES (36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'), (37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'); +ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; + COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 0b309cfd84..3075c64ddb 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2245,7 +2245,7 @@ CREATE TABLE `tvisual_console_elements_cache` ( CREATE TABLE IF NOT EXISTS `tcredential_store` ( `identifier` varchar(100) NOT NULL, `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, - `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', + `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM', `username` text, `password` text, `extra_1` text, diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index ed523d0b82..d1b98a716d 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -773,6 +773,9 @@ class DiscoveryTaskList extends Wizard case DISCOVERY_CLOUD_AWS_RDS: return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&sub=rds&page=0'; + case DISCOVERY_APP_SAP: + return 'wiz=app&mode=SAP&page=0'; + default: if ($task['description'] == 'console_task') { return 'wiz=ctask'; diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 5ffeb716d9..71115b67ed 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -806,8 +806,11 @@ class Wizard $padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;'; $padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;'; $extra_styles = isset($column['style']) ? $column['style'] : ''; + $class = isset($column['class']) ? $column['class'] : ''; - $output .= '
'; + $output .= '
'; foreach ($column['inputs'] as $input) { if (is_array($input)) { diff --git a/pandora_console/include/class/CredentialStore.class.php b/pandora_console/include/class/CredentialStore.class.php index b453318c4b..cf315d4a5b 100644 --- a/pandora_console/include/class/CredentialStore.class.php +++ b/pandora_console/include/class/CredentialStore.class.php @@ -432,7 +432,7 @@ class CredentialStore extends Wizard return $return; } - return false; + return []; } @@ -866,6 +866,7 @@ class CredentialStore extends Wizard 'CUSTOM' => __('Custom'), 'AWS' => __('Aws'), 'AZURE' => __('Azure'), + 'SAP' => __('SAP'), // 'GOOGLE' => __('Google'), ], 'selected' => (isset($values['product']) ? $values['product'] : 'CUSTOM'), @@ -900,6 +901,7 @@ class CredentialStore extends Wizard case 'GOOGLE': // Need further investigation. case 'CUSTOM': + case 'SAP': $user_label = __('Account ID'); $pass_label = __('Password'); $extra1 = false; @@ -1038,7 +1040,12 @@ class CredentialStore extends Wizard $('#div-extra_2 label').text(''); $('#div-extra_1').show(); $('#div-extra_2').show(); - } + } else if ($('#product :selected').val() == "SAP") { + $('#div-username label').text(''); + $('#div-password label').text(''); + $('#div-extra_1').hide(); + $('#div-extra_2').hide(); + } } /** diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 3786c4dad3..1682da2ec7 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -699,7 +699,7 @@ CREATE TABLE IF NOT EXISTS `tgrupo` ( CREATE TABLE IF NOT EXISTS `tcredential_store` ( `identifier` varchar(100) NOT NULL, `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, - `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', + `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM', `username` text, `password` text, `extra_1` text, From aa30a12f3172d7c9bbea71a86cc0026c14b86d1c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 31 Oct 2019 21:15:18 +0100 Subject: [PATCH 033/306] wizard doc minor fix --- .../godmode/wizards/Wizard.main.php | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 71115b67ed..6f1d59d56b 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -436,11 +436,15 @@ class Wizard * * @param array $input Definition of target block to be printed. * @param boolean $return Return as string or direct output. + * @param boolean $direct Avoid encapsulation if input print is direct. * * @return string HTML content. */ - public function printBlock(array $input, bool $return=false, bool $not_direct=false) - { + public function printBlock( + array $input, + bool $return=false, + bool $direct=false + ) { $output = ''; if ($input['hidden'] == 1) { $class = ' hidden'; @@ -453,7 +457,7 @@ class Wizard } if (is_array($input['block_content']) === true) { - $not_direct = (bool) $input['direct']; + $direct = (bool) $input['direct']; // Print independent block of inputs. $output .= '
  • '; @@ -462,17 +466,21 @@ class Wizard $output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">'; } - if (!$not_direct) { + if (!$direct) { // Avoid encapsulation if input is direct => 1. $output .= '
      '; } foreach ($input['block_content'] as $input) { - $output .= $this->printBlock($input, $return, (bool) $not_direct); + $output .= $this->printBlock( + $input, + $return, + (bool) $direct + ); } // Close block. - if (!$not_direct) { + if (!$direct) { $output .= '
    '; } @@ -483,7 +491,7 @@ class Wizard $output .= '
  • '; } else { if ($input['arguments']['type'] != 'hidden') { - if (!$not_direct) { + if (!$direct) { $output .= '
  • '; } @@ -491,7 +499,7 @@ class Wizard $output .= $this->printInput($input['arguments']); // Allow dynamic content. $output .= $input['extra']; - if (!$not_direct) { + if (!$direct) { $output .= '
  • '; } } else { From a249132fb51700d89703c5829b60d4e872fc7261 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 31 Oct 2019 21:32:34 +0100 Subject: [PATCH 034/306] sap discovery - config --- pandora_console/include/functions_config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index bab47d6926..4c46daf680 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -455,6 +455,10 @@ function config_update_config() $error_update[] = __('Ipam Ocuppied Manager Warning'); } + if (!config_update_value('sap_license', get_parameter('sap_license'))) { + $error_update[] = __('Deset SAP license'); + } + $inventory_changes_blacklist = get_parameter('inventory_changes_blacklist', []); if (!config_update_value('inventory_changes_blacklist', implode(',', $inventory_changes_blacklist))) { $error_update[] = __('Inventory changes blacklist'); From e94d8726c76a87a99a4d8f40668ee0c063b7ff2a Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 4 Nov 2019 13:59:30 +0100 Subject: [PATCH 035/306] Changed date in webchat --- pandora_console/operation/users/webchat.php | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/users/webchat.php b/pandora_console/operation/users/webchat.php index de59c5d3e8..809ccaa000 100644 --- a/pandora_console/operation/users/webchat.php +++ b/pandora_console/operation/users/webchat.php @@ -165,9 +165,13 @@ echo "
    ".html_print_button( check_users(); if (first_time) { + var date_first_message = unix_timestamp(data['log'][0]['timestamp']); + if(!date_first_message){ + date_first_message = unix_timestamp(new Date()/1000); + } print_messages({ 0: {'type' : 'notification', - 'text': ''} + 'text': ''+date_first_message} }, true); first_time = false; } @@ -308,4 +312,24 @@ echo "
    ".html_print_button( } }); } + + // Function to convert a timestamp to human date. + function unix_timestamp(timestamp){ + var date = new Date(timestamp*1000); + + const monthNames = [ + "January", "February", "March", "April", + "May", "June", "July", "August", + "September", "October", "November", "December" + ]; + var month = monthNames[date.getMonth()]; + + var day = date.getDate(); + var year = date.getFullYear(); + + var hour = date.getHours(); + var min = date.getMinutes(); + + return month + ' ' + day + ', '+ year + ', ' + hour+ ':' + min; + } From 7a20ec8e8217a8d31ee62cced9840ea210e25fb0 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Mon, 4 Nov 2019 16:04:26 +0100 Subject: [PATCH 036/306] Fixed CLI delete data --- pandora_server/util/pandora_manage.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 3b72f91063..cb60ebfaa2 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -639,9 +639,9 @@ sub pandora_delete_module_data ($$) { my $buffer = 1000; while(1) { - my $nd = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); - my $ndinc = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); - my $ndlog4x = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); + my $nd = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos WHERE id_agente_modulo=?', $id_module); + my $ndinc = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_inc WHERE id_agente_modulo=?', $id_module); + my $ndlog4x = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_log4x WHERE id_agente_modulo=?', $id_module); my $ndstring = get_db_value ($dbh, 'SELECT count(id_agente_modulo) FROM tagente_datos_string WHERE id_agente_modulo=?', $id_module); my $ntot = $nd + $ndinc + $ndlog4x + $ndstring; @@ -651,19 +651,19 @@ sub pandora_delete_module_data ($$) { } if($nd > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos', 'id_agente_modulo='.$id_module, $buffer); } if($ndinc > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_inc', 'id_agente_modulo='.$id_module, $buffer); } if($ndlog4x > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_log4x WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_log4x', 'id_agente_modulo='.$id_module, $buffer); } if($ndstring > 0) { - db_do ($dbh, 'DELETE FROM tagente_datos_string WHERE id_agente_modulo=? LIMIT ?', $id_module, $buffer); + db_delete_limit($dbh, 'tagente_datos_string', 'id_agente_modulo='.$id_module, $buffer); } } @@ -4421,7 +4421,7 @@ sub cli_delete_data($) { print_log "DELETING THE DATA OF THE AGENT $name\n\n"; - pandora_delete_data($dbh, 'module', $id_agent); + pandora_delete_data($dbh, 'agent', $id_agent); } } else { my $id_agent = get_agent_id($dbh,$name); @@ -4429,7 +4429,7 @@ sub cli_delete_data($) { print_log "DELETING THE DATA OF THE AGENT $name\n\n"; - pandora_delete_data($dbh, 'module', $id_agent); + pandora_delete_data($dbh, 'agent', $id_agent); } } elsif($opt eq '-g' || $opt eq '--g') { From 84bdc8fc17c1d0763789fea7654ea04af60305b3 Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 4 Nov 2019 17:39:21 +0100 Subject: [PATCH 037/306] add progress extend --- pandora_console/include/functions_ui.php | 33 +++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 1d43cebe28..6122cd12c0 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2915,10 +2915,10 @@ function ui_progress( * Generates a progress bar CSS based. * Requires css progress.css * - * @param integer $progress Progress. + * @param array $progress Progress. * @param string $width Width. * @param integer $height Height in 'em'. - * @param string $color Color. + * @param array $color status color. * @param boolean $return Return or paint (if false). * @param boolean $text Text to be displayed,by default progress %. * @param array $ajax Ajax: [ 'page' => 'page', 'data' => 'data' ] Sample: @@ -2942,27 +2942,36 @@ function ui_progress_extend( $text='', $ajax=false ) { - if (!$progress) { + if (!$progress['total']) { $progress = 0; } - if ($progress > 100) { - $progress = 100; + if ($progress['total'] > 100) { + $progress['total'] = 100; } - if ($progress < 0) { - $progress = 0; + if ($progress['total'] < 0) { + $progress['total'] = 0; } if (empty($text)) { - $text = $progress.'%'; + $text = $progress['total'].'%'; } + $totalW = ($progress['total'] * 10); + $badW = ($progress['bad'] * 10); + $goodW = ($progress['good'] * 10); + $unknownW = ($progress['unknown'] * 10); ui_require_css_file('progress'); - $output .= ''; - $output .= ''; - $output .= ''; + $output .= '
    '; + $output .= '
    '; + $output .= '
    '; + $output .= '
    '; + $output .= '
    '; if ($ajax !== false && is_array($ajax)) { $output .= ' + - - - From 1b3c7f8ed623ac5c6409dd788ad0562fabd45298 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 11 Nov 2019 17:58:00 +0100 Subject: [PATCH 051/306] Fixed bug in some items of reports in metaconsole --- .../include/functions_reporting.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a5e76eabf3..8e6671cefd 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -885,6 +885,10 @@ function reporting_SLA( $edge_interval = 10; if (empty($content['subitems'])) { + if (is_metaconsole()) { + metaconsole_restore_db(); + } + $slas = db_get_all_rows_field_filter( 'treport_content_sla_combined', 'id_report_content', @@ -1389,6 +1393,10 @@ function reporting_event_top_n( $return['top_n'] = $content['top_n_value']; if (empty($content['subitems'])) { + if (is_metaconsole()) { + metaconsole_restore_db(); + } + // Get all the related data. $sql = sprintf( 'SELECT id_agent_module, server_name @@ -2412,6 +2420,9 @@ function reporting_exception( WHERE id_report_content = %d', $content['id_rc'] ); + if (is_metaconsole()) { + metaconsole_restore_db(); + } $exceptions = db_process_sql($sql); } else { @@ -3462,6 +3473,7 @@ function reporting_network_interfaces_report($report, $content, $type='dinamic', $return['data'] = []; if (is_metaconsole()) { + metaconsole_restore_db(); $server_names = metaconsole_get_connection_names(); if (isset($server_names) && is_array($server_names)) { foreach ($server_names as $key => $value) { @@ -5058,6 +5070,10 @@ function reporting_sql($report, $content) $historical_db = $content['historical_db']; } + if (is_metaconsole()) { + metaconsole_restore_db(); + } + $result = db_get_all_rows_sql($sql, $historical_db); if ($result !== false) { foreach ($result as $row) { @@ -6147,6 +6163,10 @@ function reporting_availability($report, $content, $date=false, $time=false) } if (empty($content['subitems'])) { + if (is_metaconsole()) { + metaconsole_restore_db(); + } + $sql = sprintf( ' SELECT id_agent_module, @@ -6416,6 +6436,10 @@ function reporting_availability_graph($report, $content, $pdf=false) $edge_interval = 10; if (empty($content['subitems'])) { + if (is_metaconsole()) { + metaconsole_restore_db(); + } + $slas = io_safe_output( db_get_all_rows_field_filter( 'treport_content_sla_combined', @@ -7018,6 +7042,7 @@ function reporting_increment($report, $content) AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC'; $sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC'; + metaconsole_restore_db(); $servers = db_get_all_rows_sql( 'SELECT * FROM tmetaconsole_setup @@ -7121,6 +7146,10 @@ function reporting_general($report, $content) $return['show_in_same_row'] = $content['style']['show_in_same_row']; if (empty($content['subitems'])) { + if (is_metaconsole()) { + metaconsole_restore_db(); + } + $generals = db_get_all_rows_filter( 'treport_content_item', ['id_report_content' => $content['id_rc']] From ca9d168e67b035611ecc4e4caf3594a2b615ec7f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 11 Nov 2019 18:12:43 +0100 Subject: [PATCH 052/306] wip omnishell --- pandora_agents/unix/pandora_agent | 25 +++++++++++++++++---- pandora_server/lib/PandoraFMS/DataServer.pm | 6 ++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c9315a31c8..cd2c293aef 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -281,6 +281,20 @@ sub error ($) { exit 1; } +################################################################################ +# Try to load extra libraries.c +################################################################################ +sub load_libraries() { + # Dynamic load. Avoid unwanted behaviour. + eval {eval 'require YAML::Tiny;1' or die('YAML::Tiny lib not found, commands feature won\'t be available');}; + if ($@) { + $YAML = 0; + print STDERR $@; + } else { + $YAML = 1; + } +} + ################################################################################ # Check a regular expression. Returns 1 if its valid, 0 otherwise. ################################################################################ @@ -1199,14 +1213,14 @@ sub recv_file { }; if ($@) { - log_message ('error', "Error retrieving file: File transfer command is not responding."); + log_message ('error', "Error retrieving file: '.$file.' File transfer command is not responding."); exit 1; } # Get the errorlevel my $rc = $? >> 8; if ($rc != 0) { - log_message ('error', "Error retrieving file: $output"); + log_message ('error', "Error retrieving file: '$file' $output"); } exit $rc; } @@ -1469,7 +1483,7 @@ sub prepare_remote_commands { }; if ($@) { # Failed. - log_message('error', 'Failed to decode command. ' . $@); + log_message('error', 'Failed to decode command. ' . "\n".$@); delete $Conf{'commands'}->{$ref}; next; } @@ -3206,6 +3220,8 @@ my $iter_base_time = time(); $LogFileIdx = -1; # Loop while (1) { + load_libraries(); + if (-e $Conf{'logfile'} && (stat($Conf{'logfile'}))[7] > $Conf{'logsize'}) { rotate_log(); } @@ -3376,9 +3392,10 @@ while (1) { $Xml .= "\n"; $Xml .= " \n"; $Xml .= " {'name'}."]]>\n"; + $Xml .= " \n"; $Xml .= " {'error_level'}."]]>\n"; $Xml .= " {'stdout'}."]]>\n"; - $Xml .= " {'stderr'}."]]>\n"; + $Xml .= " {'stderr'}."]]>\n"; $Xml .= " \n"; $Xml .= "\n"; } diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index df1cbbecfb..38a33fc263 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -602,8 +602,12 @@ sub process_xml_data ($$$$$) { # Process events process_events_dataserver($pa_config, $data, $agent_id, $group_id, $dbh); - # Process disovery modules + # Process discovery modules enterprise_hook('process_discovery_data', [$pa_config, $data, $server_id, $dbh]); + + # Process command responses + enterprise_hook('process_rcmd_report', [$pa_config, $data, $server_id, $dbh, $agent_id, $timestamp]); + } ########################################################################## From 5ea93011d3ce77371c0ee685d22eb59d024d7015 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 12 Nov 2019 09:53:10 +0100 Subject: [PATCH 053/306] Changed title name or description in items table of reports --- .../godmode/reporting/reporting_builder.list_items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 1b7d3b4df6..00e93efa28 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -386,7 +386,7 @@ if ($items) { } $table->head[4] = __('Time lapse'); - $table->head[5] = __('Name').' / '.__('Description'); + $table->head[5] = __('Name or Description'); if (check_acl($config['id_user'], 0, 'RM')) { $table->head[6] = ''.__('Op.').''; if ($report_w || $report_m) { From ec05b52fb4938b48c52f2b4a1fb5ba183c278108 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 12 Nov 2019 10:08:35 +0100 Subject: [PATCH 054/306] update omnishell.css --- pandora_console/include/styles/omnishell.css | 44 ++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index c7379b8069..97dba30836 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -1,15 +1,3 @@ -.add_agent { - background-image: url("../../images/darrowright.png"); - background-repeat: no-repeat; - border: none; -} - -.remove_agent { - background-image: url("../../images/darrowleft.png"); - background-repeat: no-repeat; - border: none; -} - .edit_yaml { margin-left: 39px; margin-top: 10px; @@ -77,3 +65,35 @@ div.container-msg-target-modal pre { border: 3px dashed grey; border-radius: 10px; } + +ul.textarea_script, +.textarea_script { + max-height: 125px; +} + +.add_button { + height: 20%; + margin-bottom: 35px; +} + +.status_table { + margin-top: 20px; +} + +.gr_table { + margin-top: 20px; + margin-left: 75px; +} + +.btn_section { + width: 1px; + align-self: center; +} + +.btn_add_agent { + background-image: url(../../images/darrowright.png); +} + +.btn_del_agent { + background-image: url(../../images/darrowleft.png); +} From 7b06ceaafcbe289b2f8d79cefbcd8c98894c81b0 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 12 Nov 2019 10:54:36 +0100 Subject: [PATCH 055/306] add sap menu --- pandora_console/godmode/menu.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index edf7be1873..062df046b2 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -56,6 +56,7 @@ if (check_acl($config['id_user'], 0, 'AR') enterprise_hook('applications_menu'); enterprise_hook('cloud_menu'); enterprise_hook('console_task_menu'); + enterprise_hook('SAP_view'); } // Add to menu. From c652f758f4097ad523e99c580f718383541ca056 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 12 Nov 2019 13:06:59 +0100 Subject: [PATCH 056/306] Changed label agent version for agents with satellite os --- pandora_console/operation/gis_maps/ajax.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/gis_maps/ajax.php b/pandora_console/operation/gis_maps/ajax.php index c794b69c20..1ec3d93a35 100644 --- a/pandora_console/operation/gis_maps/ajax.php +++ b/pandora_console/operation/gis_maps/ajax.php @@ -302,7 +302,11 @@ switch ($opt) { $osversion_offset = 0; } - $row[] = ui_print_os_icon($agent['id_os'], true, true).' ('.substr($agent['os_version'], $osversion_offset, 15).')'; + if ($agent['os_version'] != '') { + $agent_os_version = ' ('.substr($agent['os_version'], $osversion_offset, 15).')'; + } + + $row[] = ui_print_os_icon($agent['id_os'], true, true).$agent_os_version; $table->data[] = $row; // URL @@ -331,7 +335,12 @@ switch ($opt) { // Agent version $row = []; - $row[] = __('Agent Version'); + if (strtolower(get_os_name($agent['id_os'])) == 'satellite') { + $row[] = __('Satellite Version'); + } else { + $row[] = __('Agent Version'); + } + $row[] = $agent['agent_version']; $table->data[] = $row; From 9d3c9febad228cecf10bc07a24cd8d1fc3e94339 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 12 Nov 2019 13:16:25 +0100 Subject: [PATCH 057/306] Add alert correlation wizard --- pandora_console/include/functions_html.php | 121 ++++++++++++++++++- pandora_console/include/functions_menu.php | 2 +- pandora_console/include/styles/discovery.css | 1 + pandora_console/include/styles/pandora.css | 12 ++ 4 files changed, 134 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 12a8ecfa88..e329af6013 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1618,6 +1618,89 @@ function html_print_input_email(array $settings):string } +/** + * Render an input number element. + * + * @param array $settings Array with attributes input. + * only name is necessary. + * + * @return string + */ +function html_print_input_number(array $settings):string +{ + // TODO: const. + $valid_attrs = [ + 'accept', + 'disabled', + 'maxlength', + 'name', + 'readonly', + 'placeholder', + 'size', + 'value', + 'accesskey', + 'class', + 'dir', + 'id', + 'lang', + 'style', + 'tabindex', + 'title', + 'xml:lang', + 'onfocus', + 'onblur', + 'onselect', + 'onchange', + 'onclick', + 'ondblclick', + 'onmousedown', + 'onmouseup', + 'onmouseover', + 'onmousemove', + 'onmouseout', + 'onkeypress', + 'onkeydown', + 'onkeyup', + 'required', + 'pattern', + 'autocomplete', + ]; + + $output = ''; + if (isset($settings) === true && is_array($settings) === true) { + // Check Name is necessary. + if (isset($settings['name']) === true) { + $output = ' $attr_value) { + // Check valid attribute. + if (in_array($attribute, $valid_attrs) === false) { + continue; + } + + $output .= $attribute.'="'.$attr_value.'" '; + } + + $output .= $function.'/>'; + } + } + + return $output; +} + + /** * Render an input image element. * @@ -3309,6 +3392,10 @@ function html_print_input($data, $wrapper='div', $input_only=false) $output .= html_print_input_email($data); break; + case 'number': + $output .= html_print_input_number($data); + break; + case 'hidden': $output .= html_print_input_hidden( $data['name'], @@ -3413,7 +3500,8 @@ function html_print_input($data, $wrapper='div', $input_only=false) break; case 'submit': - $output .= '<'.$wrapper.' class="action-buttons" style="width: 100%">'.html_print_submit_button( + $width = (isset($data['width']) === true) ? 'width: '.$data['width'] : 'width: 100%'; + $output .= '<'.$wrapper.' class="action-buttons" style="'.$width.'">'.html_print_submit_button( ((isset($data['label']) === true) ? $data['label'] : 'OK'), ((isset($data['name']) === true) ? $data['name'] : ''), ((isset($data['disabled']) === true) ? $data['disabled'] : false), @@ -3498,6 +3586,10 @@ function html_print_input($data, $wrapper='div', $input_only=false) $output .= html_print_input_email($data); break; + case 'multicheck': + $output .= html_print_input_multicheck($data); + break; + default: // Ignore. break; @@ -3514,6 +3606,33 @@ function html_print_input($data, $wrapper='div', $input_only=false) } +/** + * Print all checkbox in the same row. + * + * @param array $data Array with attributes input. + * only name is necessary. + * + * @return string + */ +function html_print_input_multicheck(array $data):string +{ + $html = ''; + if (isset($data['data']) === true && is_array($data['data']) === true) { + foreach ($data['data'] as $key => $value) { + $html .= $value; + $html .= html_print_checkbox( + 'days_week_'.$key, + 1, + $data['checked'][$key], + true + ); + } + } + + return $html; +} + + /** * Print an autocomplete input filled out with Integria IMS users. * diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 36785064ef..ee242a1624 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -536,7 +536,7 @@ function menu_add_extras(&$menu) $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_action']['text'] = __('Manage alert actions'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_command']['text'] = __('Manage commands'); - $menu_extra['galertas']['sub']['enterprise/godmode/alerts/alert_events']['text'] = __('Manage event alerts'); + $menu_extra['galertas']['sub']['enterprise/godmode/alerts/alert_correlation']['text'] = __('Manage event alerts'); $menu_extra['gservers']['sub']['enterprise/godmode/servers/manage_export_form']['text'] = __('Manage export targets'); diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 2aee23f645..d191357511 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -204,6 +204,7 @@ label { width: 100%; } +li > input[type="number"], li > input[type="text"], li > input[type="email"], li > input[type="password"], diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d6a1d97ecf..a7bf928bb5 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -551,6 +551,18 @@ select:-internal-list-box { align-items: center; } +.flex-space-around { + justify-content: space-around; +} + +.flex-end { + justify-content: flex-end; +} + +.flex-start { + justify-content: flex-start; +} + .nowrap { flex-wrap: nowrap; } From 02677849ced33f1ba969a3b1e376aaa09fd342ff Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 12 Nov 2019 13:17:00 +0100 Subject: [PATCH 058/306] add new css --- pandora_console/include/styles/alert.css | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pandora_console/include/styles/alert.css diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css new file mode 100644 index 0000000000..7ee5545e56 --- /dev/null +++ b/pandora_console/include/styles/alert.css @@ -0,0 +1,47 @@ +li#li-buttons-alert-list > div { + margin-left: 10px; +} + +li#li-buttons-alert-list > label, +li#li-filters-alert-list > label { + width: initial; +} + +form#general_filters_alert ul li label { + width: 150px; +} + +form#conditions_filters_alert ul li label:first-child { + width: 300px; +} + +li#li-name-group input { + margin-right: 50px; +} + +li#li-description textarea { + flex: 1 1 auto; +} + +li#li-from-to-threshold > label:not(:first-child), +li#li-time-from-to > label:not(:first-child) { + width: initial; + margin-right: 15px; +} + +li#li-from-to-threshold > input, +li#li-time-from-to > input { + margin-right: 15px; +} + +#threshold_manual, +#threshold_default { + /*TODO: UGLY*/ + width: initial !important; + margin-right: 10px; +} + +img.handle-alerts { + width: 20px; + cursor: move; +} From 50be60409ed94301d9956a3b3864a84c23e24400 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 12 Nov 2019 15:58:36 +0100 Subject: [PATCH 059/306] Dont refresh the page when filter is changed in traps view --- pandora_console/operation/snmpconsole/snmp_view.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 649a3814c5..bd59c91814 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -521,7 +521,7 @@ $table->data[1][1] = html_print_select( $alerted, 'filter_fired', $filter_fired, - 'javascript:this.form.submit();', + '', __('All'), '-1', true @@ -538,7 +538,7 @@ $table->data[2][1] = html_print_select( $paginations, 'pagination', $pagination, - 'this.form.submit();', + '', __('Default'), $config['block_size'], true @@ -550,7 +550,7 @@ $table->data[1][3] = html_print_select( $severities, 'filter_severity', $filter_severity, - 'this.form.submit();', + '', __('All'), -1, true @@ -566,7 +566,7 @@ $table->data[3][1] = html_print_select( $status_array, 'filter_status', $filter_status, - 'this.form.submit();', + '', '', '', true @@ -614,7 +614,7 @@ $table->data[6][2] = html_print_select( $trap_types, 'trap_type', $trap_type, - 'this.form.submit();', + '', '', '', true, From a11b18292c436663d4617296e48f80742da245fa Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 12 Nov 2019 17:12:44 +0100 Subject: [PATCH 060/306] Fixed width in the select to load filters in events view --- pandora_console/include/ajax/events.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index ad9d59a748..54f7576c86 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -376,8 +376,9 @@ if ($load_filter_modal) { } $table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; - if (!is_metaconsole()) { - $table->style[0] = 'width: 50%; width:50%;'; + $filter_id_width = '200px'; + if (is_metaconsole()) { + $filter_id_width = '150px'; } $data = []; @@ -390,7 +391,12 @@ if ($load_filter_modal) { '', __('None'), 0, - true + true, + false, + true, + '', + false, + 'margin-left:5px; width:'.$filter_id_width.';' ); $data[1] = html_print_submit_button( __('Load filter'), @@ -411,10 +417,11 @@ function show_filter() { resizable: true, draggable: true, modal: false, - closeOnEscape: true + closeOnEscape: true, + width: 450 }); } - +//aki function load_form_filter() { jQuery.post ( "", From f9215af803dc57a16cbc1d70937988f784bdd3e4 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 12 Nov 2019 17:33:58 +0100 Subject: [PATCH 061/306] Added tooltip to CSV datatable button --- pandora_console/include/functions_ui.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 3f2736c698..4cd7d338c3 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3233,6 +3233,7 @@ function ui_print_datatable(array $parameters) { extend: "csv", text : "'.__('Export current page to CSV').'", + titleAttr: "'.__('Export current page to CSV').'", title: "export_'.$parameters['id'].'_current_page_'.date('Y-m-d').'", fieldSeparator: "'.$config['csv_divider'].'", exportOptions : { From 25f879df00786378aa7d1064bcec38f0ae91f84c Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 12 Nov 2019 18:45:20 +0100 Subject: [PATCH 062/306] add step 3 --- pandora_console/include/styles/alert.css | 68 ++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 7ee5545e56..b2d1c4f9ce 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -45,3 +45,71 @@ img.handle-alerts { width: 20px; cursor: move; } + +.content { + width: 80%; + min-height: 4em; + border: 1px solid #ddd; + padding-top: 1em; + padding-bottom: 1em; +} +ul.sample { + max-width: 50%; + flex-grow: 1; + justify-content: space-between; +} +ul.sample li { + padding-bottom: 1em; +} +ul.sample li:last-child { + padding-bottom: 0; +} +div.target { + flex-grow: 1; + margin-left: 3em; + border: 1px solid #ddd; +} + +.field { + display: inline-block; + border-radius: 10px; + padding: 5px; + padding-left: 8px; + padding-right: 8px; + margin: 3px; + color: #fff; + font-family: "lato-lighter", "Open Sans", sans-serif; + font-weight: 600; + background-color: #333; +} + +.log { + background-color: #638460; +} +.event { + background-color: #587cff; +} + +.operator { + background-color: #908787; +} + +.variable { + background-color: #82b92e; +} + +.modifier { + background-color: #cba9d2; +} + +.nexo { + background-color: #424242; +} + +.rules div { + display: inline-block; +} + +.inEdit { + background-color: #888; +} From d1fbd36a971a87a4ca6578c77b90b72c4f260f32 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 12 Nov 2019 19:31:38 +0100 Subject: [PATCH 063/306] WIP omnishell --- .../godmode/wizards/Wizard.main.php | 29 +- pandora_console/include/styles/discovery.css | 2 +- pandora_console/include/styles/omnishell.css | 430 ++++++++++++++++-- pandora_console/include/styles/pandora.css | 2 +- 4 files changed, 409 insertions(+), 54 deletions(-) diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 5ffeb716d9..6f1d59d56b 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -436,11 +436,15 @@ class Wizard * * @param array $input Definition of target block to be printed. * @param boolean $return Return as string or direct output. + * @param boolean $direct Avoid encapsulation if input print is direct. * * @return string HTML content. */ - public function printBlock(array $input, bool $return=false, bool $not_direct=false) - { + public function printBlock( + array $input, + bool $return=false, + bool $direct=false + ) { $output = ''; if ($input['hidden'] == 1) { $class = ' hidden'; @@ -453,7 +457,7 @@ class Wizard } if (is_array($input['block_content']) === true) { - $not_direct = (bool) $input['direct']; + $direct = (bool) $input['direct']; // Print independent block of inputs. $output .= '
  • '; @@ -462,17 +466,21 @@ class Wizard $output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">'; } - if (!$not_direct) { + if (!$direct) { // Avoid encapsulation if input is direct => 1. $output .= '
      '; } foreach ($input['block_content'] as $input) { - $output .= $this->printBlock($input, $return, (bool) $not_direct); + $output .= $this->printBlock( + $input, + $return, + (bool) $direct + ); } // Close block. - if (!$not_direct) { + if (!$direct) { $output .= '
    '; } @@ -483,7 +491,7 @@ class Wizard $output .= '
  • '; } else { if ($input['arguments']['type'] != 'hidden') { - if (!$not_direct) { + if (!$direct) { $output .= '
  • '; } @@ -491,7 +499,7 @@ class Wizard $output .= $this->printInput($input['arguments']); // Allow dynamic content. $output .= $input['extra']; - if (!$not_direct) { + if (!$direct) { $output .= '
  • '; } } else { @@ -806,8 +814,11 @@ class Wizard $padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;'; $padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;'; $extra_styles = isset($column['style']) ? $column['style'] : ''; + $class = isset($column['class']) ? $column['class'] : ''; - $output .= '
    '; + $output .= '
    '; foreach ($column['inputs'] as $input) { if (is_array($input)) { diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 2aee23f645..82451e7a1e 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -31,7 +31,7 @@ li.discovery > a label { } div.data_container > label { - font-family: "lato-bolder", "Open Sans", sans-serif; + font-family: "lato", "Open Sans", sans-serif; font-weight: lighter; } diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index 97dba30836..e082facc63 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -4,16 +4,6 @@ margin-bottom: 10px; } -li > input[type="text"] { - border: 1px solid lightgrey; - border-radius: 0; - font-family: "lato-bolder", "Open Sans", sans-serif; - font-weight: lighter; - padding: 0px 0px 2px 0px; - box-sizing: border-box; - margin-bottom: 4px; -} - .margin_button { margin-right: 5px; } @@ -41,59 +31,413 @@ li > input[type="text"] { background-color: #8bbbdd; } -h4 { - color: #343434; - font-family: "lato-bolder", "Open Sans", sans-serif; - line-height: 18pt; -} - .container-msg-target-modal { max-height: 400px; overflow: initial; } -div.container-msg-target-modal p { - font-size: 10pt; +ul.wizard li > textarea { + height: 5em; +} + +.label_select { + font-family: "lato-lighter", "Open Sans", sans-serif; font-weight: bolder; - text-align: center; } -div.container-msg-target-modal pre { - padding: 20px; - white-space: pre-wrap; - background-color: #e2e2e2; - border: 3px dashed grey; - border-radius: 10px; +.divided select { + width: 100%; } -ul.textarea_script, -.textarea_script { - max-height: 125px; +.inline { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + align-content: center; + align-items: center; } -.add_button { - height: 20%; - margin-bottom: 35px; +.inline label:first-child { + width: 250px; + vertical-align: top; + display: inline-block; } -.status_table { - margin-top: 20px; +.inline label:nth-child(3) { + margin-right: 1em; + margin-left: 1em; } -.gr_table { - margin-top: 20px; - margin-left: 75px; +.inline select { + margin-right: 1em; } -.btn_section { - width: 1px; +.middle { align-self: center; } - -.btn_add_agent { - background-image: url(../../images/darrowright.png); +.edit_discovery_info { + padding-top: 0; } -.btn_del_agent { - background-image: url(../../images/darrowleft.png); +ul.wizard { + width: 100%; +} + +.filter_column { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-content: center; +} + +.filter_column .edit_discovery_input { + flex-grow: 1; + width: 100%; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + align-content: baseline; + margin-left: 2em; +} +.filter_column .edit_discovery_input .label_select { + display: inline; + margin: 0; +} + +.filter_column .edit_discovery_input select { + flex-grow: 1; + margin-left: 2em; +} + +.wizard li { + display: flex; +} + +/* + * Discovery css global + */ + +ul.bigbuttonlist { + min-height: 200px; +} + +li.discovery { + display: inline-block; + float: left; + width: 250px; + margin: 15px; + padding-bottom: 50px; +} + +li.discovery > a { + text-decoration: none; + color: #333; +} +li.discovery > a:hover { + color: #000; +} + +li.discovery img { + height: 90px; +} + +li.discovery > a label { + cursor: pointer; +} + +div.data_container > label { + font-family: "lato", "Open Sans", sans-serif; + font-weight: lighter; +} + +div.data_container { + width: 100%; + height: 100%; + text-align: center; + padding-top: 30px; + padding-bottom: 30px; +} + +div.data_container:hover { + box-shadow: 2px 2px 10px #ddd; +} + +/* + * TODO: This may be at hostdevices.css + */ +.texto { + height: auto; + text-align: center; +} +h1.wizard { + padding: 0; + margin: 0; +} +h1.wizard a { + margin-left: -20px; +} +h1.wizard a:hover { + color: #fff; +} +#text_wizard { + font-weight: bolder; + text-decoration: none; + font-size: 24px; +} +div.arrow_box { + display: inline-block; + position: relative; + color: #888; + padding: 1.3em; + margin-left: 20px; + margin-bottom: 10px; + padding-left: 3em; +} + +.arrow_box.selected { + background: #424242; + color: #ccc; +} + +.arrow_box:after { + left: 0%; + border-left-color: white; + border-width: 20px; + margin-top: -20px; +} + +div.arrow_box:before { + left: 100%; + border-left-color: #ccc; + border-width: 20px; + margin-top: -20px; +} +.arrow_box.selected:before { + border-left-color: #424242; +} + +.arrow_box.selected:hover { + color: #fff; +} +.arrow_box:hover { + color: #000; +} + +/* + * Breadcrum + */ + +#menu_tab_frame_view_bc { + display: flex; + justify-content: space-between; + border-bottom: 2px solid #82b92e; + max-height: 70px; + min-height: 55px; + width: 100%; + padding-right: 0px; + margin-left: 0px; + margin-bottom: 20px; + height: 55px; + box-sizing: border-box; + background-color: #fafafa; + border-top-right-radius: 7px; + border-top-left-radius: 7px; + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1); +} + +#menu_tab_frame_view_bc .breadcrumbs_container { + align-self: flex-start; +} + +.breadcrumbs_container { + padding-top: 4px; + text-indent: 0.25em; + padding-left: 2.5em; +} + +.breadcrumb_link { + color: #848484; + font-size: 10pt; + font-family: "lato-bolder", "Open Sans", sans-serif; + text-decoration: none; +} + +span.breadcrumb_link { + color: #d0d0d0; + font-size: 12pt; +} + +.breadcrumb_link.selected { + color: #95b750; +} + +.breadcrumb_link.selected:hover { + color: #95b750; +} +.breadcrumb_link:hover { + color: #95b750; +} + +/* + * Discovery forms structure + */ + +form.discovery * { + font-size: 10pt; +} + +form.discovery .label_select b { + font-family: "lato", "Open Sans", sans-serif; + font-weight: bolder; +} + +.edit_discovery_info { + display: flex; + align-items: flex-start; + padding-top: 25px; +} + +.edit_discovery_input { + align-items: center; + margin-bottom: 25px; +} + +/* + * Discovery text inputs + */ + +.discovery_label_hint { + display: flex; +} + +label { + color: #343434; + font-weight: bold; +} + +.discovery_full_width_input { + width: 100%; +} + +li > input[type="text"], +li > input[type="email"], +li > input[type="password"], +li > input[type="email"], +.discovery_text_input > input[type="password"], +.discovery_text_input > input[type="text"], +#interval_manual > input[type="text"] { + background-color: transparent; + border: none; + border-radius: 0; + border-bottom: 1px solid #ccc; + font-family: "lato-bolder", "Open Sans", sans-serif; + font-weight: lighter; + padding: 0px 0px 2px 0px; + box-sizing: border-box; + margin-bottom: 4px; +} + +#interval_manual > input[type="text"] { + width: 50px; + margin-left: 10px; + margin-right: 10px; +} + +.discovery_list_input { + width: 100%; + border: 1px solid #cbcbcb; + overflow-y: auto; +} + +.discovery_list_input option { + text-align: left; +} + +.discovery_list_input option:checked { + background: #1aab8e -webkit-linear-gradient(bottom, #7db742 0%, #7db742 100%); + color: #fff; +} + +.discovery_textarea_input { + background-color: #fbfbfb; + padding-left: 10px; + width: 100%; + height: 100px; + max-height: 100px; + max-width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + resize: none; +} + +a.tip { + margin-left: 8px; +} + +.inline_switch > label { + float: right; +} + +.discovery_interval_select_width { + width: 90%; +} + +a.ext_link { + margin-left: 1em; + font-size: 8pt; +} + +div.ui-tooltip.ui-corner-all.ui-widget-shadow.ui-widget.ui-widget-content.uitooltip { + background: grey; + opacity: 0.9; + border-radius: 4px; + box-shadow: 6px 5px 9px -9px black; + padding: 6px; +} + +.ui-tooltip-content { + background: transparent; + color: #fff; + font-weight: bold; + font-family: "lato-lighter", "Open Sans", sans-serif; + letter-spacing: 0.03pt; + font-size: 8pt; +} + +.arrow { + width: 70px; + height: 16px; + overflow: hidden; + position: absolute; + left: 50%; + margin-left: -35px; + bottom: -16px; +} +.arrow.top { + top: -16px; + bottom: auto; +} +.arrow.left { + left: 50%; +} +.arrow:after { + background: grey; + content: ""; + position: absolute; + left: 20px; + top: -20px; + width: 25px; + height: 25px; + box-shadow: 6px 5px 9px -9px black; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} +.arrow.top:after { + bottom: -20px; + top: auto; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index d6a1d97ecf..4eaafa9d1b 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5698,7 +5698,7 @@ div#status_pie { align-items: center; flex-wrap: wrap; padding: 1em; - min-width: fit-content; + min-width: 100%; } .white_table_graph_content { From e7dfd9b968ca187893b441827342e907399b5a27 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 12 Nov 2019 19:53:46 +0100 Subject: [PATCH 064/306] Add sap view --- pandora_console/general/sap_view.php | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 pandora_console/general/sap_view.php diff --git a/pandora_console/general/sap_view.php b/pandora_console/general/sap_view.php new file mode 100644 index 0000000000..58ee50e563 --- /dev/null +++ b/pandora_console/general/sap_view.php @@ -0,0 +1,77 @@ + '[sap_views]'.$e->getMessage() ]); + exit; + } else { + echo '[sap_views]'.$e->getMessage(); + } + + // Stop this execution, but continue 'globally'. + return; +} + +// Ajax controller. +if (is_ajax()) { + $method = get_parameter('method', ''); + + if (method_exists($sap_views, $method) === true) { + if ($sap_views->ajaxMethod($method) === true) { + $sap_views->{$method}(); + } else { + $sap_views->error('Unavailable method.'); + } + } else { + $sap_views->error('Method not found. ['.$method.']'); + } + + + // Stop any execution. + exit; +} else { + // Run. + $sap_views->run(); +} From 8c046ecdc6c8f7248d6177c33aaf453da12f1b11 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 13 Nov 2019 11:24:25 +0100 Subject: [PATCH 065/306] fix bug when accessing certain views as home screen --- pandora_console/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index f62a3da4cf..56782fd9ef 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -520,17 +520,17 @@ if (! isset($config['id_user'])) { break; case 'Group view': - $_GET['sec'] = 'estado'; + $_GET['sec'] = 'view'; $_GET['sec2'] = 'operation/agentes/group_view'; break; case 'Alert detail': - $_GET['sec'] = 'estado'; + $_GET['sec'] = 'view'; $_GET['sec2'] = 'operation/agentes/alerts_status'; break; case 'Tactical view': - $_GET['sec'] = 'estado'; + $_GET['sec'] = 'view'; $_GET['sec2'] = 'operation/agentes/tactical'; break; From 28c9718c265d68eaa9a77c48d1d73e4fd9d0d737 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 13 Nov 2019 12:07:23 +0100 Subject: [PATCH 066/306] WIP alerts-log --- pandora_console/include/styles/alert.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index b2d1c4f9ce..3368bf0796 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -7,6 +7,7 @@ li#li-filters-alert-list > label { width: initial; } +form#advanced_filters_alert ul li label, form#general_filters_alert ul li label { width: 150px; } @@ -34,6 +35,18 @@ li#li-time-from-to > input { margin-right: 15px; } +form#advanced_filters_alert textarea { + flex: 1 1 auto; + height: 5em; + min-height: 5em; +} + +form#advanced_filters_alert ul li label img { + margin-bottom: -2px; + margin-left: 5px; +} + +/*DRAG DROP*/ #threshold_manual, #threshold_default { /*TODO: UGLY*/ From f6b86042b21a7e15a184f943d9433dbe21ac3a85 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 13 Nov 2019 12:19:09 +0100 Subject: [PATCH 067/306] Fixed bug in select for linked visual console --- pandora_console/include/functions_visual_map_editor.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 0e678c6111..ed99a7b429 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -1447,9 +1447,6 @@ function visual_map_editor_print_hack_translate_strings() '; - } - - if (!$return) { + if (!$data['return']) { echo $output; } diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index b6dcd37826..e1d1a6ad98 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -19,6 +19,12 @@ height: 20px; } +.element-target-big { + width: 100px; + margin: 2px; + height: 100px; +} + .status-normal { background-color: #add570; } diff --git a/pandora_console/include/styles/progress.css b/pandora_console/include/styles/progress.css index f263e87fcf..c88687a204 100644 --- a/pandora_console/include/styles/progress.css +++ b/pandora_console/include/styles/progress.css @@ -4,6 +4,7 @@ position: relative; width: 100%; display: inline-block; + display: flex; } .progress_main:before { content: attr(data-label); From dcd9467bfb142d2468bdfa70b54b5eff0049bf3c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 14 Nov 2019 21:10:46 +0100 Subject: [PATCH 085/306] fix symbols in gotty credentials --- pandora_console/extensions/quick_shell.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 6d135260d2..a8cce0b8de 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -218,7 +218,8 @@ function quickShell() if (empty($config['gotty_user']) === false && empty($config['gotty_pass']) === false ) { - $auth_str = $config['gotty_user'].':'.$config['gotty_pass']; + $auth_str = io_safe_output($config['gotty_user']); + $auth_str .= ':'.io_output_password($config['gotty_pass']); $gotty_url = $auth_str.'@'.$host.':'.$port; } From cb43d06c13be50b86eaa5d606ffc8f9b79b05c0d Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 14 Nov 2019 21:31:07 +0100 Subject: [PATCH 086/306] minor fix --- pandora_agents/unix/pandora_agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 914896e60d..d9b3d32b3f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1439,7 +1439,7 @@ sub prepare_commands { my $rcmd_file = $ConfDir.'/commands/'.$ref.'.rcmd'; # Check for local .rcmd.done files - if (-e $Conf{'temporal'}.'/'.$ref.'.rcmd.done') { + if (-e $rcmd_file.'.done') { # Ignore. delete $Conf{'commands'}->{$ref}; next; From 8edbb7435458171caa93b5fd32f15174a7137cc4 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 14 Nov 2019 21:52:02 +0100 Subject: [PATCH 087/306] discovery help link and minor fixes --- pandora_console/godmode/menu.php | 2 +- pandora_console/godmode/servers/discovery.php | 2 +- pandora_console/include/functions.php | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3a9e3de9c0..af09d9ff0d 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -28,7 +28,7 @@ if (check_acl($config['id_user'], 0, 'AR') || check_acl($config['id_user'], 0, 'PM') ) { $sub = []; - $sub['godmode/servers/discovery&wiz=main']['text'] = __('Main'); + $sub['godmode/servers/discovery&wiz=main']['text'] = __('Start'); $sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery'; $sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list'); $sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist'; diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 2d0fcec8a1..7215ee7dfb 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -54,7 +54,7 @@ function get_wiz_class($str) __('Discovery'), '', false, - '', + 'discovery', true, '', false, diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index fbc41ce961..d75570107d 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -5438,6 +5438,15 @@ function get_help_info($section_name) } else { $result .= 'Console_Setup&printable=yes#Websocket_engine'; } + break; + + case 'discovery': + if ($es) { + $result .= 'Discovery&printable=yes'; + } else { + $result .= 'Discovery&printable=yes'; + } + break; } return $result; From 990ad339d3209baa52a6a48b88f8eb5344fbb56e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 15 Nov 2019 09:45:49 +0100 Subject: [PATCH 088/306] db schema --- pandora_console/extras/mr/33.sql | 4 ++-- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++-- pandora_console/pandoradb.sql | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 85a38a4fa7..3bc3cb9919 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -26,8 +26,8 @@ CREATE TABLE `tremote_command_target` ( `rcmd_id` bigint unsigned NOT NULL, `id_agent` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, - `stdout` text, - `stderr` text, + `stdout` MEDIUMTEXT, + `stderr` MEDIUMTEXT, `errorlevel` int(10) unsigned NOT NULL default 0, PRIMARY KEY (`id`), FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index fd51f73668..c3970da228 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2324,8 +2324,8 @@ CREATE TABLE `tremote_command_target` ( `rcmd_id` bigint unsigned NOT NULL, `id_agent` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, - `stdout` text, - `stderr` text, + `stdout` MEDIUMTEXT, + `stderr` MEDIUMTEXT, `errorlevel` int(10) unsigned NOT NULL default 0, PRIMARY KEY (`id`), FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 910961ec94..37f31f60bb 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3683,8 +3683,8 @@ CREATE TABLE `tremote_command_target` ( `rcmd_id` bigint unsigned NOT NULL, `id_agent` int(10) unsigned NOT NULL, `utimestamp` int(20) unsigned NOT NULL default 0, - `stdout` text, - `stderr` text, + `stdout` MEDIUMTEXT, + `stderr` MEDIUMTEXT, `errorlevel` int(10) unsigned NOT NULL default 0, PRIMARY KEY (`id`), FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`) From e561b1f9068773736ecc0c1bb818ec0c73689ba8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 15 Nov 2019 13:07:23 +0100 Subject: [PATCH 089/306] omnishell multiselect --- pandora_console/include/functions_agents.php | 26 +++++++++++++++ pandora_console/include/styles/omnishell.css | 32 +++++++++++++++++++ .../operation/agentes/ver_agente.php | 9 +----- 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 826ca971c5..bc5ef43430 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -132,6 +132,32 @@ function agents_get_agent_id_by_alias($alias) } +/** + * Return seconds left to contact again with agent. + * + * @param integer $id_agente Target agent + * + * @return integer|null Seconds left. + */ +function agents_get_next_contact_time_left(int $id_agente) +{ + $last_contact = false; + + if ($id_agente > 0) { + $last_contact = db_get_value_sql( + sprintf( + 'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val" + FROM `tagente` + WHERE id_agente = %d ', + $id_agente + ) + ); + } + + return $last_contact; +} + + /** * Creates an agent. * diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index e1d1a6ad98..265ca5f445 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -25,6 +25,32 @@ height: 100px; } +.element-target-big:hover { + box-shadow: 0 0 10px -5px #424242; +} + +.element-target-big:before { + content: attr(data-label); + position: relative; + text-align: center; + width: 100%; + height: 100%; + color: #373737; + font-weight: bolder; + display: flex; + flex-direction: row; + font-size: 1.8em; + align-items: center; + justify-content: center; + overflow: hidden; + font-family: "lato-bolder", "Open Sans", sans-serif; + text-decoration: none; +} + +.container-target a:hover { + text-decoration: none; +} + .status-normal { background-color: #add570; } @@ -156,6 +182,12 @@ ul.wizard { display: flex; } +.no-class.action-buttons.mw120px.textright.sorting_disabled, +.textright { + text-align: right; + padding-right: 2em; +} + /* * Discovery css global */ diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 7444dda595..fa53e1c6ec 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -68,14 +68,7 @@ if (is_ajax()) { if ($refresh_contact) { $id_agente = get_parameter('id_agente', 0); if ($id_agente > 0) { - $last_contact = db_get_value_sql( - sprintf( - 'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val" - FROM `tagente` - WHERE id_agente = %d ', - $id_agente - ) - ); + $last_contact = agents_get_next_contact_time_left($id_agente); $progress = agents_get_next_contact($id_agente); if ($progress < 0 || $progress > 100) { From 91f28384b87a4d3e7b1ff41f554bc2e034b1c66a Mon Sep 17 00:00:00 2001 From: marcos Date: Fri, 15 Nov 2019 16:22:30 +0100 Subject: [PATCH 090/306] changed sap icon button --- .../godmode/agentes/configurar_agente.php | 2 +- pandora_console/images/sap_icon.png | Bin 0 -> 324 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 pandora_console/images/sap_icon.png diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 741fb536bb..4f6c3e463e 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -488,7 +488,7 @@ if ($id_agente) { $is_sap = agents_get_sap_agents($id_agente); if ($is_sap) { - $saptab['text'] = ''.html_print_image('images/chart_curve.png', true, ['title' => __('SAP view')]).''; + $saptab['text'] = ''.html_print_image('images/sap_icon.png', true, ['title' => __('SAP view')]).''; if ($tab == 'sap_view') { $saptab['active'] = true; diff --git a/pandora_console/images/sap_icon.png b/pandora_console/images/sap_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..536c43b28b8bc6407d4197fc7db3abab6b170229 GIT binary patch literal 324 zcmV-K0lWT*P) Date: Fri, 15 Nov 2019 16:35:25 +0100 Subject: [PATCH 091/306] minor fix omnishell functionality - unix agent --- pandora_agents/unix/pandora_agent | 232 +++++++++++++++++++++++++----- 1 file changed, 194 insertions(+), 38 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d9b3d32b3f..d6095d6d24 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -296,6 +296,77 @@ sub load_libraries() { } } +################################################################################ +# Erase blank spaces before and after the string +################################################################################ +sub trim { + my $string = shift; + if (empty($string)){ + return ""; + } + + $string =~ s/\r//g; + + chomp($string); + $string =~ s/^\s+//g; + $string =~ s/\s+$//g; + + return $string; +} + +################################################################################ +# Mix hashses +################################################################################ +sub merge_hashes { + my $_h1 = shift; + my $_h2 = shift; + + if (ref($_h1) ne "HASH") { + return \%{$_h2} if (ref($_h2) eq "HASH"); + } + + if (ref($_h2) ne "HASH") { + return \%{$_h1} if (ref($_h1) eq "HASH"); + } + + if ((ref($_h1) ne "HASH") && (ref($_h2) ne "HASH")) { + return {}; + } + + my %ret = (%{$_h1}, %{$_h2}); + + return \%ret; +} + +################################################################################ +# Empty +################################################################################ +sub empty { + my $str = shift; + + if (!(defined($str)) ){ + return 1; + } + + if(looks_like_number($str)){ + return 0; + } + + if (ref($str) eq "ARRAY") { + return (($#{$str}<0)?1:0); + } + + if (ref($str) eq "HASH") { + my @tmp = keys %{$str}; + return (($#tmp<0)?1:0); + } + + if ($str =~ /^\ *[\n\r]{0,2}\ *$/) { + return 1; + } + return 0; +} + ################################################################################ # Check a regular expression. Returns 1 if its valid, 0 otherwise. ################################################################################ @@ -731,13 +802,6 @@ sub parse_conf_modules($) { # Macros } elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) { $module->{'macros'}{$1} = $2; - # Commands - } elsif ($line =~ /^\s*cmd_file\s+(.+)$/) { - if (ref ($Conf{'commands'}) ne "HASH") { - $Conf{'commands'} = {}; - } - # Initialize empty command hash. - $Conf{'commands'}->{$1} = {}; } } return; @@ -832,7 +896,21 @@ sub read_config (;$) { next if ($line =~ /^module\s*\w*/); #Configuration token - if ($line =~ /^\s*(\S+)\s+(.*)$/) { + if ($line =~ /^\s*(\S+)\s+(.*)$/) { + # Reserved keyword. + next if ($1 eq "commands"); + + if ($1 eq "cmd_file") { + # Commands + if (ref ($Conf{'commands'}) ne "HASH") { + $Conf{'commands'} = {}; + } + # Initialize empty command hash. + $Conf{'commands'}->{$2} = {}; + log_message('setup', "Command required $2"); + next; + } + log_message ('setup', "$1 is $2"); $Conf{$1} = $2; @@ -980,8 +1058,6 @@ sub read_config (;$) { $Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq '1'); } - # Check remote commands - prepare_commands(); } ################################################################################# @@ -1292,6 +1368,10 @@ sub check_remote_config () { %Collections = (); %Conf = %DefaultConf; + # Supposed to discard current configuration but not. + # Cleanup old commands configuration. + $Conf{'commands'} = {}; + # Reload the new configuration read_config (); @@ -1433,6 +1513,20 @@ sub prepare_commands { return; } + # Force configuration file read. + my @commands = read_config('cmd_file'); + + if (empty(\@commands)) { + $Conf{'commands'} = {}; + } else { + foreach my $rcmd (@commands) { + $Conf{'commands'}->{trim($rcmd)} = {}; + } + } + + # Cleanup old commands. Not registered. + cleanup_old_commands(); + foreach my $ref (keys %{$Conf{'commands'}}) { my $file_content; my $download = 0; @@ -1534,19 +1628,101 @@ sub report_command { return $return; } +################################################################################ +# Cleanup unreferenced rcmd and rcmd.done files. +################################################################################ +sub cleanup_old_commands { + # Cleanup old .rcmd and .rcmd.done files. + my %registered = map { $_.'.rcmd' => 1 } keys %{$Conf{'commands'}}; + if(opendir(my $dir, $ConfDir.'/commands/')) { + while (my $item = readdir($dir)) { + + # Skip other files. + next if ($item !~ /\.rcmd$/); + + # Clean .rcmd.done file if its command is not referenced in conf. + if (!defined($registered{$item})) { + if (-e $ConfDir.'/commands/'.$item) { + unlink($ConfDir.'/commands/'.$item); + } + if (-e $ConfDir.'/commands/'.$item.'.done') { + unlink($ConfDir.'/commands/'.$item.'.done'); + } + } + } + + # Close dir. + closedir($dir); + } + +} + ################################################################################ # Executes a command using defined timeout. ################################################################################ sub execute_command_timeout { - my ($command, $timeout) = @_; + my ($cmd, $timeout) = @_; - if (!looks_like_number($timeout)) { - `$command`; - } else { - `$command`; + if (!defined($timeout) + || !looks_like_number($timeout) + || $timeout <= 0 + ) { + `$cmd`; + return $?>>8; } - return $?>>8; + my $remaining_timeout = $timeout; + + my $RET; + my $output; + + my $pid = open ($RET, "-|"); + if (!defined($pid)) { + # Failed to fork. + log_message('error', '[command] Failed to fork.'); + return undef; + } + if ($pid == 0) { + # Child. + my $ret; + eval { + local $SIG{ALRM} = sub { die "timeout\n" }; + alarm $timeout; + `$cmd`; + alarm 0; + }; + + my $result = ($?>>8); + print $result; + + # Exit child. + # Child finishes. + exit; + + } else { + # Parent waiting. + while( --$remaining_timeout > 0 ){ + if (wait == -1) { + last; + } + # Wait child up to timeout seconds. + sleep 1; + } + } + + if ($remaining_timeout > 0) { + # Retrieve output from child. + $output = do { local $/; <$RET> }; + $output = $output>>8; + } + else { + # Timeout expired. + return 124; + } + + close($RET); + + return $output; } ################################################################################ @@ -3274,28 +3450,8 @@ while (1) { # Check file collections check_collections () unless ($Conf{'debug'} eq '1'); - if ($Conf{'debug'} ne '1') { - # Cleanup old .rcmd and .rcmd.done files. - my %registered = map { $_.'.rcmd' => 1 } keys %{$Conf{'commands'}}; - if(opendir(my $dir, $ConfDir.'/commands/')) { - while (my $item = readdir($dir)) { - # Skip other files. - next if ($item !~ /\.rcmd$/); - # Clean .rcmd.done file if its command is not referenced in conf. - if (!defined($registered{$item})) { - if (-e $item) { - unlink ($item); - } - if (-e $item.'.done') { - unlink ($item.'.done'); - } - } - } - - # Close dir. - closedir($dir); - } - } + # Check scheduled commands + prepare_commands() unless ($Conf{'debug'} eq '1'); # Launch broker agents @BrokerPid = (); From 17918cd5c6183ac856e25023ff493e172e22c81e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 15 Nov 2019 16:35:25 +0100 Subject: [PATCH 092/306] minor fix omnishell functionality - unix agent --- pandora_agents/unix/pandora_agent | 232 +++++++++++++++++++++++++----- 1 file changed, 194 insertions(+), 38 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d9b3d32b3f..d6095d6d24 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -296,6 +296,77 @@ sub load_libraries() { } } +################################################################################ +# Erase blank spaces before and after the string +################################################################################ +sub trim { + my $string = shift; + if (empty($string)){ + return ""; + } + + $string =~ s/\r//g; + + chomp($string); + $string =~ s/^\s+//g; + $string =~ s/\s+$//g; + + return $string; +} + +################################################################################ +# Mix hashses +################################################################################ +sub merge_hashes { + my $_h1 = shift; + my $_h2 = shift; + + if (ref($_h1) ne "HASH") { + return \%{$_h2} if (ref($_h2) eq "HASH"); + } + + if (ref($_h2) ne "HASH") { + return \%{$_h1} if (ref($_h1) eq "HASH"); + } + + if ((ref($_h1) ne "HASH") && (ref($_h2) ne "HASH")) { + return {}; + } + + my %ret = (%{$_h1}, %{$_h2}); + + return \%ret; +} + +################################################################################ +# Empty +################################################################################ +sub empty { + my $str = shift; + + if (!(defined($str)) ){ + return 1; + } + + if(looks_like_number($str)){ + return 0; + } + + if (ref($str) eq "ARRAY") { + return (($#{$str}<0)?1:0); + } + + if (ref($str) eq "HASH") { + my @tmp = keys %{$str}; + return (($#tmp<0)?1:0); + } + + if ($str =~ /^\ *[\n\r]{0,2}\ *$/) { + return 1; + } + return 0; +} + ################################################################################ # Check a regular expression. Returns 1 if its valid, 0 otherwise. ################################################################################ @@ -731,13 +802,6 @@ sub parse_conf_modules($) { # Macros } elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) { $module->{'macros'}{$1} = $2; - # Commands - } elsif ($line =~ /^\s*cmd_file\s+(.+)$/) { - if (ref ($Conf{'commands'}) ne "HASH") { - $Conf{'commands'} = {}; - } - # Initialize empty command hash. - $Conf{'commands'}->{$1} = {}; } } return; @@ -832,7 +896,21 @@ sub read_config (;$) { next if ($line =~ /^module\s*\w*/); #Configuration token - if ($line =~ /^\s*(\S+)\s+(.*)$/) { + if ($line =~ /^\s*(\S+)\s+(.*)$/) { + # Reserved keyword. + next if ($1 eq "commands"); + + if ($1 eq "cmd_file") { + # Commands + if (ref ($Conf{'commands'}) ne "HASH") { + $Conf{'commands'} = {}; + } + # Initialize empty command hash. + $Conf{'commands'}->{$2} = {}; + log_message('setup', "Command required $2"); + next; + } + log_message ('setup', "$1 is $2"); $Conf{$1} = $2; @@ -980,8 +1058,6 @@ sub read_config (;$) { $Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq '1'); } - # Check remote commands - prepare_commands(); } ################################################################################# @@ -1292,6 +1368,10 @@ sub check_remote_config () { %Collections = (); %Conf = %DefaultConf; + # Supposed to discard current configuration but not. + # Cleanup old commands configuration. + $Conf{'commands'} = {}; + # Reload the new configuration read_config (); @@ -1433,6 +1513,20 @@ sub prepare_commands { return; } + # Force configuration file read. + my @commands = read_config('cmd_file'); + + if (empty(\@commands)) { + $Conf{'commands'} = {}; + } else { + foreach my $rcmd (@commands) { + $Conf{'commands'}->{trim($rcmd)} = {}; + } + } + + # Cleanup old commands. Not registered. + cleanup_old_commands(); + foreach my $ref (keys %{$Conf{'commands'}}) { my $file_content; my $download = 0; @@ -1534,19 +1628,101 @@ sub report_command { return $return; } +################################################################################ +# Cleanup unreferenced rcmd and rcmd.done files. +################################################################################ +sub cleanup_old_commands { + # Cleanup old .rcmd and .rcmd.done files. + my %registered = map { $_.'.rcmd' => 1 } keys %{$Conf{'commands'}}; + if(opendir(my $dir, $ConfDir.'/commands/')) { + while (my $item = readdir($dir)) { + + # Skip other files. + next if ($item !~ /\.rcmd$/); + + # Clean .rcmd.done file if its command is not referenced in conf. + if (!defined($registered{$item})) { + if (-e $ConfDir.'/commands/'.$item) { + unlink($ConfDir.'/commands/'.$item); + } + if (-e $ConfDir.'/commands/'.$item.'.done') { + unlink($ConfDir.'/commands/'.$item.'.done'); + } + } + } + + # Close dir. + closedir($dir); + } + +} + ################################################################################ # Executes a command using defined timeout. ################################################################################ sub execute_command_timeout { - my ($command, $timeout) = @_; + my ($cmd, $timeout) = @_; - if (!looks_like_number($timeout)) { - `$command`; - } else { - `$command`; + if (!defined($timeout) + || !looks_like_number($timeout) + || $timeout <= 0 + ) { + `$cmd`; + return $?>>8; } - return $?>>8; + my $remaining_timeout = $timeout; + + my $RET; + my $output; + + my $pid = open ($RET, "-|"); + if (!defined($pid)) { + # Failed to fork. + log_message('error', '[command] Failed to fork.'); + return undef; + } + if ($pid == 0) { + # Child. + my $ret; + eval { + local $SIG{ALRM} = sub { die "timeout\n" }; + alarm $timeout; + `$cmd`; + alarm 0; + }; + + my $result = ($?>>8); + print $result; + + # Exit child. + # Child finishes. + exit; + + } else { + # Parent waiting. + while( --$remaining_timeout > 0 ){ + if (wait == -1) { + last; + } + # Wait child up to timeout seconds. + sleep 1; + } + } + + if ($remaining_timeout > 0) { + # Retrieve output from child. + $output = do { local $/; <$RET> }; + $output = $output>>8; + } + else { + # Timeout expired. + return 124; + } + + close($RET); + + return $output; } ################################################################################ @@ -3274,28 +3450,8 @@ while (1) { # Check file collections check_collections () unless ($Conf{'debug'} eq '1'); - if ($Conf{'debug'} ne '1') { - # Cleanup old .rcmd and .rcmd.done files. - my %registered = map { $_.'.rcmd' => 1 } keys %{$Conf{'commands'}}; - if(opendir(my $dir, $ConfDir.'/commands/')) { - while (my $item = readdir($dir)) { - # Skip other files. - next if ($item !~ /\.rcmd$/); - # Clean .rcmd.done file if its command is not referenced in conf. - if (!defined($registered{$item})) { - if (-e $item) { - unlink ($item); - } - if (-e $item.'.done') { - unlink ($item.'.done'); - } - } - } - - # Close dir. - closedir($dir); - } - } + # Check scheduled commands + prepare_commands() unless ($Conf{'debug'} eq '1'); # Launch broker agents @BrokerPid = (); From 84c6640032732631d34bffee263baef6f980b8ff Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 15 Nov 2019 16:51:53 +0100 Subject: [PATCH 093/306] minor style fix --- pandora_console/include/functions_ui.php | 2 +- pandora_console/include/styles/progress.css | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index d6afa8ffac..c66b96a48e 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2964,7 +2964,7 @@ function ui_progress_extend( ui_require_css_file('progress'); // Main container. - $output .= '
    '; diff --git a/pandora_console/include/styles/progress.css b/pandora_console/include/styles/progress.css index c88687a204..bfbb2409ef 100644 --- a/pandora_console/include/styles/progress.css +++ b/pandora_console/include/styles/progress.css @@ -6,6 +6,15 @@ display: inline-block; display: flex; } + +.progress_main_noborder { + height: 2.5em; + position: relative; + width: 100%; + display: inline-block; + display: flex; +} + .progress_main:before { content: attr(data-label); position: absolute; From 2f807592273a221a7ee590191fd699f271ca94c3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 10:04:47 +0100 Subject: [PATCH 094/306] minor updates pandora sap --- pandora_server/conf/pandora_server.conf.new | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index a5896e6050..ae8b980b14 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -130,9 +130,15 @@ networkserver 1 dataserver 1 -# Activate (1) Pandora FMS Recon server +# Activate (1) Pandora FMS Discovery server -reconserver 1 +discoveryserver 1 + +# Discovery SAP (PANDORA FMS ENTERPRISE ONLY) +# java /usr/bin/java + +# Discovery SAP utils (PANDORA FMS ENTERPRISE ONLY) +# sap_utils /usr/share/pandora_server/util/recon_scripts/SAP # pluginserver : 1 or 0. Set to 1 to activate plugin server with this setup From 1cacbbc08f62cbf5aef4df7b2c59bd5af7fabac9 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 10:40:02 +0100 Subject: [PATCH 095/306] fix tools --- pandora_server/lib/PandoraFMS/Tools.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index c161a464ed..05adbf79d1 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -499,11 +499,17 @@ sub credential_store_get_key($$$) { my ($pa_config, $dbh, $identifier) = @_; my $sql = 'SELECT * FROM tcredential_store WHERE identifier = ?'; - my $key = get_db_single_row($dbh, $sql, $identifier); + my $key = PandoraFMS::DB::get_db_single_row($dbh, $sql, $identifier); return { - 'username' => pandora_output_password($pa_config, $key->{'username'}), - 'password' => pandora_output_password($pa_config, $key->{'password'}), + 'username' => PandoraFMS::Core::pandora_output_password( + $pa_config, + $key->{'username'} + ), + 'password' => PandoraFMS::Core::pandora_output_password( + $pa_config, + $key->{'password'} + ), 'extra_1' => $key->{'extra_1'}, 'extra_2' => $key->{'extra_2'}, }; From 99b071485062ca7b4029fd8d51ac9654759ff4a5 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 11:06:27 +0100 Subject: [PATCH 096/306] PWE keep db connection up --- .../include/lib/WebSocketServer.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pandora_console/include/lib/WebSocketServer.php b/pandora_console/include/lib/WebSocketServer.php index 2d9eb1d9fd..5ce45845d5 100644 --- a/pandora_console/include/lib/WebSocketServer.php +++ b/pandora_console/include/lib/WebSocketServer.php @@ -439,6 +439,9 @@ abstract class WebSocketServer if ((time() - $this->lastTickTimestamp) > $this->tickInterval) { $this->lastTickTimestamp = time(); $this->tick(); + + // Keep connection with DB active. + $this->dbHearthbeat(); } socket_select($read, $write, $except, 0, $this->timeout); @@ -1530,4 +1533,25 @@ abstract class WebSocketServer } + /** + * Keeps db connection opened. + * + * @return void + */ + public function dbHearthbeat() + { + global $config; + + \hd($config['dbconnection']); + + if (isset($config['dbconnection']) === false + || mysqli_ping($config['dbconnection']) === false + ) { + // Retry connection. + db_select_engine(); + $config['dbconnection'] = db_connect(); + } + } + + } From 85ca03b054e843c36b3552a98eee1f817934679e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 11:07:04 +0100 Subject: [PATCH 097/306] fix- removed traces --- pandora_console/include/lib/WebSocketServer.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/include/lib/WebSocketServer.php b/pandora_console/include/lib/WebSocketServer.php index 5ce45845d5..dfdc81d075 100644 --- a/pandora_console/include/lib/WebSocketServer.php +++ b/pandora_console/include/lib/WebSocketServer.php @@ -1542,8 +1542,6 @@ abstract class WebSocketServer { global $config; - \hd($config['dbconnection']); - if (isset($config['dbconnection']) === false || mysqli_ping($config['dbconnection']) === false ) { From a5ab29e90ed409dc9f0891e34413eadeeb730eca Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 11:22:54 +0100 Subject: [PATCH 098/306] omnishell retries --- pandora_agents/unix/pandora_agent | 38 +++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d6095d6d24..79f8586b15 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1731,28 +1731,48 @@ sub execute_command_timeout { # $std_files = ' >> /tmp/stdout 2>> /tmp/stderr ################################################################################ sub execute_command_block { - my ($commands, $std_files, $timeout) = @_; + my ($commands, $std_files, $timeout, $retry) = @_; return 0 unless defined($commands); + my $retries = $retry; + + $retries = 1 unless looks_like_number($retries) && $retries > 0; + my $err_level = 0; $std_files = '' unless defined ($std_files); if (ref($commands) ne "ARRAY") { return 0 if $commands eq ''; - $err_level = execute_command_timeout( - "($commands) $std_files", - $timeout - ); + + do { + $err_level = execute_command_timeout( + "($commands) $std_files", + $timeout + ); + + # Do not retry if success. + last if looks_like_number($err_level) && $err_level == 0; + } while ((--$retries) > 0); } else { foreach my $comm (@{$commands}) { next unless defined($comm); - $err_level = execute_command_timeout( - "($comm) $std_files", - $timeout - ); + $retries = $retry; + $retries = 1 unless looks_like_number($retries) && $retries > 0; + do { + $err_level = execute_command_timeout( + "($comm) $std_files", + $timeout + ); + + # Do not retry if success. + last if looks_like_number($err_level) && $err_level == 0; + + } while ((--$retries) > 0); + + # Do not continue evaluating block if failed. last unless ($err_level == 0); } } From 61ccd5bdbc108efe865c67f8be3e48aacdf7bb9d Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 12:30:12 +0100 Subject: [PATCH 099/306] help_link omnishell --- pandora_console/include/functions.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index a7d94d43bc..042e27b170 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -5416,6 +5416,14 @@ function get_help_info($section_name) } break; + case 'omnishell': + if ($es) { + $result .= 'Omnishell&printable=yes'; + } else { + $result .= 'Omnishell&printable=yes'; + } + break; + case 'module_type_tab': if ($es) { $result .= 'Operacion&printable=yes#Tipos_de_m.C3.B3dulos'; From 79f5e879cc6f10c5413c11a2188a8a44f1f54ed8 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Mon, 18 Nov 2019 13:37:10 +0100 Subject: [PATCH 100/306] WIP Alerts --- pandora_console/include/javascript/alert.js | 118 ++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 pandora_console/include/javascript/alert.js diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js new file mode 100644 index 0000000000..d293e247d8 --- /dev/null +++ b/pandora_console/include/javascript/alert.js @@ -0,0 +1,118 @@ +/* eslint-disable no-unused-vars */ +/* global $, load_modal, generalShowMsg, confirmDialog */ + +function allowDrop(ev) { + ev.preventDefault(); +} + +function drag(ev) { + ev.dataTransfer.setData("html", ev.target.outerHTML); +} + +function drop(ev) { + ev.preventDefault(); + var data = document.createElement("span"); + var content = ev.dataTransfer.getData("html"); + if (content.includes("nexo")) { + content = "
    " + content; + } + data.innerHTML = content; + document.getElementById(ev.target.id).appendChild(data); +} + +function add_alert_action(settings) { + load_modal({ + target: $("#modal-add-action-form"), + form: "modal_form_add_actions", + url: settings.url_ajax, + modal: { + title: settings.title, + cancel: settings.btn_cancel, + ok: settings.btn_text + }, + onshow: { + page: settings.url, + method: "addAlertActionForm", + extradata: { + id: settings.id + } + }, + onsubmit: { + page: settings.url, + method: "addAlertAction", + dataType: "json" + }, + ajax_callback: add_alert_action_acept, + idMsgCallback: "msg-add-action" + }); +} + +function add_alert_action_acept(data, idMsg) { + if (data.error === 1) { + console.log(data.text); + return; + } + + if ($("#emptyli-al-" + data.id_alert).length > 0) { + $("#emptyli-al-" + data.id_alert).remove(); + } + + $.ajax({ + method: "post", + url: data.url, + data: { + page: data.page, + method: "addRowActionAjax", + id_alert: data.id_alert, + id_action: data.id_action + }, + dataType: "html", + success: function(li) { + $(".ui-dialog-content").dialog("close"); + $("#ul-al-" + data.id_alert).append(li); + }, + error: function(error) { + console.log(error); + } + }); +} + +function delete_alert_action(settings) { + confirmDialog({ + title: settings.title, + message: settings.msg, + onAccept: function() { + $.ajax({ + method: "post", + url: settings.url, + data: { + page: settings.page, + method: "deleteActionAlert", + id_alert: settings.id_alert, + id_action: settings.id_action + }, + dataType: "json", + success: function(data) { + // Delete row table. + $( + "#li-al-" + settings.id_alert + "-act-" + settings.id_action + ).remove(); + + var num_row = $("#ul-al-" + settings.id_alert + " li").length; + if (num_row === 0) { + var emptyli = + "
  • " + + settings.emptyli + + "
  • "; + $("#ul-al-" + settings.id_alert).append(emptyli); + } + }, + error: function(error) { + console.log(error); + } + }); + } + }); +} From 8811095a3e171bdd9c63e97185abf1d5e0ae4518 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Mon, 18 Nov 2019 15:25:35 +0100 Subject: [PATCH 101/306] WIP ALerts --- pandora_console/include/javascript/alert.js | 56 +++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index d293e247d8..435649833d 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -116,3 +116,59 @@ function delete_alert_action(settings) { } }); } + +function standby_alert(settings) { + confirmDialog({ + title: settings.title, + message: settings.msg, + onAccept: function() { + $.ajax({ + method: "post", + url: settings.url, + data: { + page: settings.page, + method: "standByAlert", + id_alert: settings.id_alert, + standby: settings.standby + }, + dataType: "html", + success: function(data) { + $("#standby-alert-" + settings.id_alert).empty(); + $("#standby-alert-" + settings.id_alert).append(data); + }, + error: function(error) { + console.log(error); + } + }); + } + }); +} + +function disabled_alert(settings) { + confirmDialog({ + title: settings.title, + message: settings.msg, + onAccept: function() { + $.ajax({ + method: "post", + url: settings.url, + data: { + page: settings.page, + method: "disabledAlert", + id_alert: settings.id_alert, + disabled: settings.disabled + }, + dataType: "json", + success: function(data) { + $("#disabled-alert-" + settings.id_alert).empty(); + $("#disabled-alert-" + settings.id_alert).append(data.disabled); + $("#status-alert-" + settings.id_alert).empty(); + $("#status-alert-" + settings.id_alert).append(data.status); + }, + error: function(error) { + console.log(error); + } + }); + } + }); +} From fe1e7da0eda1f380fdd1df0c54d2ac88417b364b Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 18 Nov 2019 17:36:16 +0100 Subject: [PATCH 102/306] Adjusted margin on static image item --- .../visual_console_builder.editor.js | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index a4c18d3737..946fe0422c 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1892,33 +1892,53 @@ function toggle_item_palette() { $("#text-label_ifr") .contents() .find("p") - .attr("data-mce-style", "line-height:" + $(this).val() + ";"); + .attr("data-mce-style", "line-height:" + $(this).val() + ";") + .attr("data-mce-style", "margin-top:", "-10px;"); $("#text-label_ifr") .contents() .find("p") - .css("line-height", $(this).val()); + .css("line-height", $(this).val()) + .css("margin-top", "-10px"); $("#text-label_ifr") .contents() .find("span") - .attr("data-mce-style", "line-height:" + $(this).val() + ";"); + .attr("data-mce-style", "line-height:" + $(this).val() + ";") + .attr("data-mce-style", "margin-top:", "-10px;"); $("#text-label_ifr") .contents() .find("span") - .css("line-height", $(this).val()); + .css("line-height", $(this).val()) + .css("margin-top", "-10px"); }); - $("#text-label_ifr") - .contents() - .find("p") - .css("line-height", $("#lineheight").val()); - $("#text-label_ifr") - .contents() - .find("span") - .css("line-height", $("#lineheight").val()); - $("#text-label_ifr") - .contents() - .find("body") - .css("background", "lightgray"); + if (item == "static_graph") { + $("#text-label_ifr") + .contents() + .find("p") + .css("line-height", $("#lineheight").val()) + .css("margin-top", "-10px"); + $("#text-label_ifr") + .contents() + .find("span") + .css("line-height", $("#lineheight").val()); + $("#text-label_ifr") + .contents() + .find("body") + .css("background", "lightgray"); + } else { + $("#text-label_ifr") + .contents() + .find("p") + .css("line-height", $("#lineheight").val()); + $("#text-label_ifr") + .contents() + .find("span") + .css("line-height", $("#lineheight").val()); + $("#text-label_ifr") + .contents() + .find("body") + .css("background", "lightgray"); + } } if (creationItem != "simple_value") { From 83e7d5a70122c9955a0aa7ca091820b0f5b5b942 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 18 Nov 2019 19:32:57 +0100 Subject: [PATCH 103/306] Minor fixes --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 2 +- pandora_server/lib/PandoraFMS/Tools.pm | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index b444e92672..9b2a725ae2 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1531,7 +1531,7 @@ sub database_scan($$$) { && "$dbObjCfg->{'scan_databases'}" eq "1") { # Skip database scan in Oracle tasks - next if $self->{'type'} == DISCOVERY_APP_ORACLE; + next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_ORACLE; my $__data = $obj->scan_databases(); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 05adbf79d1..f81b228eea 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -21,7 +21,6 @@ use warnings; use Time::Local; use POSIX qw(setsid strftime); use POSIX; -use PandoraFMS::Sendmail; use HTML::Entities; use Encode; use Socket qw(inet_ntoa inet_aton); @@ -31,6 +30,9 @@ use LWP::UserAgent; use threads; use threads::shared; +use lib '/usr/lib/perl5'; +use PandoraFMS::Sendmail; + # New in 3.2. Used to sendmail internally, without external scripts # use Module::Loaded; @@ -824,6 +826,11 @@ sub enterprise_hook ($$) { # Try to call the function my $output = eval { &$func (@args); }; + # Discomment to debug. + # if ($@) { + # print STDERR $@; + # } + # Check for errors #return undef if ($@); return '' unless defined ($output); From 0fd95647ea1bc34849c23b7fdefbf30a89c59437 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 19 Nov 2019 11:56:11 +0100 Subject: [PATCH 104/306] log_window --- pandora_server/conf/pandora_server.conf.new | 6 +++++- pandora_server/lib/PandoraFMS/Config.pm | 4 ++++ pandora_server/lib/PandoraFMS/Tools.pm | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 16a4a51b62..2eb9fad569 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -449,10 +449,14 @@ export_threads 1 eventserver 0 -# Event Server event window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY). +# Correlated alerts, event window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY). event_window 3600 +# Correlated Alerts, log window in seconds (3600 by default) (PANDORA FMS ENTERPRISE ONLY). + +log_window 3600 + # If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status. event_inhibit_alerts 0 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 06790c7c87..64804cca4e 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -303,6 +303,7 @@ sub pandora_load_config { $pa_config->{'openstreetmaps_description'} = 0; $pa_config->{"eventserver"} = 1; # 4.0 $pa_config->{"event_window"} = 3600; # 4.0 + $pa_config->{"log_window"} = 3600; # 7.741 $pa_config->{"icmpserver"} = 0; # 4.0 $pa_config->{"icmp_threads"} = 3; # 4.0 $pa_config->{"snmpserver"} = 0; # 4.0 @@ -980,6 +981,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^event_window\s+([0-9]*)/i) { $pa_config->{'event_window'}= clean_blank($1); } + elsif ($parametro =~ m/^log_window\s+([0-9]*)/i) { + $pa_config->{'log_window'}= clean_blank($1); + } elsif ($parametro =~ m/^snmp_threads\s+([0-9]*)/i) { $pa_config->{'snmp_threads'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index f81b228eea..92bf78c04d 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -827,9 +827,9 @@ sub enterprise_hook ($$) { my $output = eval { &$func (@args); }; # Discomment to debug. - # if ($@) { - # print STDERR $@; - # } + if ($@) { + print STDERR $@; + } # Check for errors #return undef if ($@); From 9cea1313782cd97b819d77a29c97f74519d40a8e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 19 Nov 2019 23:35:29 +0100 Subject: [PATCH 105/306] WIP CorrelatedAlerts --- pandora_server/lib/PandoraFMS/Core.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 263ce5722c..48a6cbe4d9 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -448,8 +448,9 @@ B: =cut ########################################################################## -sub pandora_evaluate_alert ($$$$$$$;$$$) { - my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh, $last_data_value, $events, $event) = @_; +sub pandora_evaluate_alert ($$$$$$$;$$$$) { + my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh, + $last_data_value, $correlatedItems, $event, $log) = @_; if (defined ($agent)) { logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10); @@ -592,9 +593,20 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) { return $status if ($last_status != 3 && $alert->{'type'} eq 'unknown'); return $status if ($last_status == 0 && $alert->{'type'} eq 'not_normal'); } - # Event alert + # Correlated alert else { - my $rc = enterprise_hook ('evaluate_event_alert', [$pa_config, $dbh, $alert, $events, $event]); + my $rc = enterprise_hook ( + 'evaluate_correlated_alert', + [ + $pa_config, + $dbh, + $alert, + $correlatedItems, + $event, + $log + ] + ); + return $status unless (defined ($rc) && $rc == 1); } From cd8f52fd92d3a76a042144e4cb1f8182d557429f Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 20 Nov 2019 09:11:03 +0100 Subject: [PATCH 106/306] WIP alert correlations --- pandora_console/include/javascript/alert.js | 94 ++++++++++++++++++++- pandora_console/include/styles/alert.css | 5 ++ 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index 435649833d..a3a3311a76 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -11,12 +11,104 @@ function drag(ev) { function drop(ev) { ev.preventDefault(); - var data = document.createElement("span"); + + // Source Element. var content = ev.dataTransfer.getData("html"); + + // Extract ID. + var id = $(content).attr("id"); + + // Extract clas type. + var classType = $(content) + .attr("class") + .split(/\s+/)[0]; + + // Input hidden. + var valueHidden = $("#hidden-json-rule").val(); + + // Initialize stack. + var stack = []; + // Check first. + if (valueHidden != 0) { + // Value decode. + stack = JSON.parse(valueHidden); + } + + // Add stack. + stack.push({ + type: classType, + value: id + }); + + // Convert to json tring for value input hidden. + var stackString = JSON.stringify(stack); + + // Set input hidden. + $("#hidden-json-rule").val(stackString); + + // Source class type action. + switch (classType) { + case "fields": + $(".fields").addClass("opacityElements"); + $(".fields").attr("draggable", false); + + $(".operators").removeClass("opacityElements"); + $(".operators").attr("draggable", true); + break; + + case "operators": + $(".operators").addClass("opacityElements"); + $(".operators").attr("draggable", false); + + $(".variable").removeClass("opacityElements"); + $(".variable").attr("draggable", true); + break; + + case "variable": + $(".variable").addClass("opacityElements"); + $(".variable").attr("draggable", false); + + $(".modifier").removeClass("opacityElements"); + $(".modifier").attr("draggable", true); + $(".nexo").removeClass("opacityElements"); + $(".nexo").attr("draggable", true); + break; + + case "modifier": + $(".modifier").addClass("opacityElements"); + $(".modifier").attr("draggable", false); + $(".nexo").addClass("opacityElements"); + $(".nexo").attr("draggable", false); + + $(".variable").removeClass("opacityElements"); + $(".variable").attr("draggable", true); + break; + + case "nexo": + $(".modifier").addClass("opacityElements"); + $(".modifier").attr("draggable", false); + $(".nexo").addClass("opacityElements"); + $(".nexo").attr("draggable", false); + + $(".fields").removeClass("opacityElements"); + $(".fields").attr("draggable", true); + break; + default: + break; + } + + // Create content. + var data = document.createElement("span"); + + // If content nexo line break. if (content.includes("nexo")) { content = "
    " + content; } + + // Add source element in content. data.innerHTML = content; + + // Add content to target. document.getElementById(ev.target.id).appendChild(data); } diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 3368bf0796..c2d4c84b2b 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -96,6 +96,11 @@ div.target { background-color: #333; } +.field.opacityElements { + opacity: 0.2; + cursor: not-allowed; +} + .log { background-color: #638460; } From bae61d4225cd4052dc47674aff9b244ed9c62406 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 20 Nov 2019 10:30:22 +0100 Subject: [PATCH 107/306] Changed date format to last remote contact --- pandora_console/include/functions_events.php | 2 +- pandora_console/include/functions_treeview.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index cb8ef39481..b462d80764 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3980,7 +3980,7 @@ function events_page_details($event, $server='') $data = []; $data[0] = '
    '.__('Last contact').'
    '; - $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : date_w_fixed_tz($agent['ultimo_contacto']); + $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : ui_print_timestamp($agent['ultimo_contacto'], true); $table_details->data[] = $data; $data = []; diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index c8b893c091..558cc0f061 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -624,7 +624,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) if ($agent['ultimo_contacto_remoto'] == '01-01-1970 00:00:00') { $last_remote_contact = __('Never'); } else { - $last_remote_contact = ui_print_timestamp($agent['ultimo_contacto_remoto'], true); + $last_remote_contact = date_w_fixed_tz($agent['ultimo_contacto_remoto']); } $row = []; From 43ecba3bbb13730e9dcd7e1303931a6c807ccbfe Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Nov 2019 10:40:52 +0100 Subject: [PATCH 108/306] operator fields for event_rule --- pandora_console/extras/mr/33.sql | 14 ++++++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 14 ++++++++++++++ pandora_console/pandoradb.sql | 13 +++++++++++++ 3 files changed, 41 insertions(+) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index e7396397d5..ee06202af6 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -12,6 +12,20 @@ ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text DESC 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text DESC 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text DESC 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text DESC 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text DESC 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text DESC 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text DESC 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text DESC 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text DESC 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text DESC 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text DESC 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text DESC 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text DESC 'Operator for log_agent'; + CREATE TABLE `tremote_command` ( `id` SERIAL, `name` varchar(150) NOT NULL, diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 9fcd845c6e..1e779797ff 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -567,6 +567,20 @@ ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0 ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text DESC 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text DESC 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text DESC 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text DESC 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text DESC 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text DESC 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text DESC 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text DESC 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text DESC 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text DESC 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text DESC 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text DESC 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text DESC 'Operator for log_agent'; + -- ----------------------------------------------------- -- Table `tevent_alert` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 28bb83d287..432c54aa1b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2785,6 +2785,19 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `log_content` text, `log_source` text, `log_agent` text, + `operator_agent` text DESC 'Operator for agent', + `operator_id_usuario` text DESC 'Operator for id_usuario', + `operator_id_grupo` text DESC 'Operator for id_grupo', + `operator_evento` text DESC 'Operator for evento', + `operator_event_type` text DESC 'Operator for event_type', + `operator_module` text DESC 'Operator for module', + `operator_alert` text DESC 'Operator for alert', + `operator_criticity` text DESC 'Operator for criticity', + `operator_user_comment` text DESC 'Operator for user_comment', + `operator_id_tag` text DESC 'Operator for id_tag', + `operator_log_content` text DESC 'Operator for log_content', + `operator_log_source` text DESC 'Operator for log_source', + `operator_log_agent` text DESC 'Operator for log_agent', PRIMARY KEY (`id_event_rule`), KEY `idx_id_event_alert` (`id_event_alert`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 79a135b07762e2e259a187dd554f645fcad86fb1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Nov 2019 11:36:15 +0100 Subject: [PATCH 109/306] Fix errata DESC => COMMENT --- pandora_console/extras/mr/33.sql | 26 +++++++++---------- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 26 +++++++++---------- pandora_console/pandoradb.sql | 26 +++++++++---------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index ee06202af6..c6dcd70dec 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -12,19 +12,19 @@ ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text DESC 'Operator for agent'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text DESC 'Operator for id_usuario'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text DESC 'Operator for id_grupo'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text DESC 'Operator for evento'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text DESC 'Operator for event_type'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text DESC 'Operator for module'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text DESC 'Operator for alert'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text DESC 'Operator for criticity'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text DESC 'Operator for user_comment'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text DESC 'Operator for id_tag'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text DESC 'Operator for log_content'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text DESC 'Operator for log_source'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text DESC 'Operator for log_agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; CREATE TABLE `tremote_command` ( `id` SERIAL, diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 1e779797ff..5aed467ab7 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -567,19 +567,19 @@ ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0 ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text DESC 'Operator for agent'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text DESC 'Operator for id_usuario'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text DESC 'Operator for id_grupo'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text DESC 'Operator for evento'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text DESC 'Operator for event_type'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text DESC 'Operator for module'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text DESC 'Operator for alert'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text DESC 'Operator for criticity'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text DESC 'Operator for user_comment'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text DESC 'Operator for id_tag'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text DESC 'Operator for log_content'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text DESC 'Operator for log_source'; -ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text DESC 'Operator for log_agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; -- ----------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 432c54aa1b..412ff3bcfd 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2785,19 +2785,19 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `log_content` text, `log_source` text, `log_agent` text, - `operator_agent` text DESC 'Operator for agent', - `operator_id_usuario` text DESC 'Operator for id_usuario', - `operator_id_grupo` text DESC 'Operator for id_grupo', - `operator_evento` text DESC 'Operator for evento', - `operator_event_type` text DESC 'Operator for event_type', - `operator_module` text DESC 'Operator for module', - `operator_alert` text DESC 'Operator for alert', - `operator_criticity` text DESC 'Operator for criticity', - `operator_user_comment` text DESC 'Operator for user_comment', - `operator_id_tag` text DESC 'Operator for id_tag', - `operator_log_content` text DESC 'Operator for log_content', - `operator_log_source` text DESC 'Operator for log_source', - `operator_log_agent` text DESC 'Operator for log_agent', + `operator_agent` text COMMENT 'Operator for agent', + `operator_id_usuario` text COMMENT 'Operator for id_usuario', + `operator_id_grupo` text COMMENT 'Operator for id_grupo', + `operator_evento` text COMMENT 'Operator for evento', + `operator_event_type` text COMMENT 'Operator for event_type', + `operator_module` text COMMENT 'Operator for module', + `operator_alert` text COMMENT 'Operator for alert', + `operator_criticity` text COMMENT 'Operator for criticity', + `operator_user_comment` text COMMENT 'Operator for user_comment', + `operator_id_tag` text COMMENT 'Operator for id_tag', + `operator_log_content` text COMMENT 'Operator for log_content', + `operator_log_source` text COMMENT 'Operator for log_source', + `operator_log_agent` text COMMENT 'Operator for log_agent', PRIMARY KEY (`id_event_rule`), KEY `idx_id_event_alert` (`id_event_alert`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 4d7f92e3f0082f591863c74e2d32718823f6282b Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 20 Nov 2019 13:25:16 +0100 Subject: [PATCH 110/306] Add button diagnostic --- .../include/class/Diagnostics.class.php | 31 ++++++++++++++++++- pandora_console/tools/diagnostics.php | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 94acbc4ba2..c062793b9d 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -68,6 +68,10 @@ class Diagnostics extends Wizard // Check access. check_login(); + $this->url = ui_get_full_url( + 'index.php?sec=gextensions&sec2=tools/diagnostics' + ); + $this->ajaxController = $page; $this->pdf = $pdf; $this->product_name = io_safe_output(get_product_name()); @@ -123,15 +127,34 @@ class Diagnostics extends Wizard { global $config; + if ($this->pdf === true) { + $this->exportPDF(); + exit; + } + ui_require_css_file('diagnostics'); + $pdf_url = $this->url.'&pdf=true'; + $pdf_img = html_print_image( + 'images/pdf.png', + true, + ['title' => __('Export to PDF')] + ); + $header_buttons = [ + 'csv' => [ + 'active' => false, + 'text' => ''.$pdf_img.'', + ], + ]; + // Header. ui_print_page_header( __('%s Diagnostic tool', $this->product_name), 'images/gm_massive_operations.png', false, 'diagnostic_tool_tab', - true + true, + $header_buttons ); // Print all Methods Diagnostic Info. @@ -2080,6 +2103,10 @@ class Diagnostics extends Wizard enterprise_include_once('/include/class/Pdf.class.php'); $mpdf = new Pdf([]); + // Ignore pending HTML outputs. + while (@ob_end_clean()) { + } + // ADD style. $mpdf->addStyle($config['homedir'].'/include/styles/diagnostics.css'); @@ -2112,6 +2139,8 @@ class Diagnostics extends Wizard // Write html filename. $mpdf->writePDFfile($filename); + + exit; } diff --git a/pandora_console/tools/diagnostics.php b/pandora_console/tools/diagnostics.php index 30be89efc4..fc2b2fecd2 100644 --- a/pandora_console/tools/diagnostics.php +++ b/pandora_console/tools/diagnostics.php @@ -32,7 +32,7 @@ global $config; require_once $config['homedir'].'/include/class/Diagnostics.class.php'; $ajaxPage = 'tools/diagnostics'; -$pdf = false; +$pdf = get_parameter('pdf', false); // Control call flow. From 61568ee3b7d760a13398e4382b3f4872d1db9181 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 20 Nov 2019 13:26:02 +0100 Subject: [PATCH 111/306] Add button diagnostic --- pandora_console/include/class/Diagnostics.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index c062793b9d..ee61ec743d 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -2105,6 +2105,7 @@ class Diagnostics extends Wizard // Ignore pending HTML outputs. while (@ob_end_clean()) { + $ignore_me; } // ADD style. From fb6013bd6271d7daaaf04250eb664a56c89a3c89 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 20 Nov 2019 15:55:08 +0100 Subject: [PATCH 112/306] Wip alert correlation --- pandora_console/include/javascript/alert.js | 85 +++++++++++++++------ 1 file changed, 63 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index a3a3311a76..811ce42ada 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -9,6 +9,35 @@ function drag(ev) { ev.dataTransfer.setData("html", ev.target.outerHTML); } +function edit(id, str) { + // If not defined id return. + console.log(id); + + if (id == "variable-text") { + return; + } + + // Value input hidden. + var valueHidden = $("#hidden-json-rule").val(); + + // Convert to array. + var arrayValueHidden = JSON.parse(valueHidden); + + // Extract to id number row. + var numberField = id.replace("element-", ""); + + // Check do no undefined. + if (arrayValueHidden[numberField] != undefined) { + // Change value. + arrayValueHidden[numberField].value = str; + + // Update value json-rule. + $("#hidden-json-rule").val(JSON.stringify(arrayValueHidden)); + } + + return; +} + function drop(ev) { ev.preventDefault(); @@ -23,6 +52,9 @@ function drop(ev) { .attr("class") .split(/\s+/)[0]; + // Remove Class. + content = $(content).removeClass(classType); + // Input hidden. var valueHidden = $("#hidden-json-rule").val(); @@ -34,10 +66,14 @@ function drop(ev) { stack = JSON.parse(valueHidden); } + // Change ID for non repeat and use variable change text. + content = $(content).attr("id", "element-" + stack.length); + // Add stack. stack.push({ type: classType, - value: id + element: id.replace(classType + "-", ""), + value: $(content).text() }); // Convert to json tring for value input hidden. @@ -46,6 +82,9 @@ function drop(ev) { // Set input hidden. $("#hidden-json-rule").val(stackString); + // Next button to submit is disabled + $("#submit-rule").attr("disabled", true); + // Source class type action. switch (classType) { case "fields": @@ -60,35 +99,36 @@ function drop(ev) { $(".operators").addClass("opacityElements"); $(".operators").attr("draggable", false); - $(".variable").removeClass("opacityElements"); - $(".variable").attr("draggable", true); + $(".variables").removeClass("opacityElements"); + $(".variables").attr("draggable", true); break; - case "variable": - $(".variable").addClass("opacityElements"); - $(".variable").attr("draggable", false); + case "variables": + $(".variables").addClass("opacityElements"); + $(".variables").attr("draggable", false); - $(".modifier").removeClass("opacityElements"); - $(".modifier").attr("draggable", true); - $(".nexo").removeClass("opacityElements"); - $(".nexo").attr("draggable", true); + $(".modifiers").removeClass("opacityElements"); + $(".modifiers").attr("draggable", true); + $(".nexos").removeClass("opacityElements"); + $(".nexos").attr("draggable", true); + $("#submit-rule").attr("disabled", false); break; - case "modifier": - $(".modifier").addClass("opacityElements"); - $(".modifier").attr("draggable", false); - $(".nexo").addClass("opacityElements"); - $(".nexo").attr("draggable", false); + case "modifiers": + $(".modifiers").addClass("opacityElements"); + $(".modifiers").attr("draggable", false); + $(".nexos").addClass("opacityElements"); + $(".nexos").attr("draggable", false); - $(".variable").removeClass("opacityElements"); - $(".variable").attr("draggable", true); + $(".variables").removeClass("opacityElements"); + $(".variables").attr("draggable", true); break; - case "nexo": - $(".modifier").addClass("opacityElements"); - $(".modifier").attr("draggable", false); - $(".nexo").addClass("opacityElements"); - $(".nexo").attr("draggable", false); + case "nexos": + $(".modifiers").addClass("opacityElements"); + $(".modifiers").attr("draggable", false); + $(".nexos").addClass("opacityElements"); + $(".nexos").attr("draggable", false); $(".fields").removeClass("opacityElements"); $(".fields").attr("draggable", true); @@ -100,6 +140,7 @@ function drop(ev) { // Create content. var data = document.createElement("span"); + content = $(content).prop("outerHTML"); // If content nexo line break. if (content.includes("nexo")) { content = "
    " + content; From a064f47ef3b9be1846a0e0a56f637620cd03285f Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 20 Nov 2019 17:20:17 +0100 Subject: [PATCH 113/306] fix module cron values --- pandora_console/include/functions_html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index d63d5ba117..073c98738c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1183,7 +1183,7 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*', } // Month days - for ($i = 0; $i <= 31; $i++) { + for ($i = 1; $i <= 31; $i++) { $mdays[$i] = $i; } From 624a1e0086852fda27b3a730bdd60f31fede2473 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Nov 2019 18:17:43 +0100 Subject: [PATCH 114/306] WIP alert correlation --- .../godmode/wizards/Wizard.main.php | 12 +- pandora_console/include/javascript/alert.js | 193 ++++++++++++++++-- 2 files changed, 190 insertions(+), 15 deletions(-) diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 30b0706342..65a76191b9 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -514,7 +514,9 @@ class Wizard $output .= ''; } else { - if ($input['arguments']['type'] != 'hidden') { + if ($input['arguments']['type'] != 'hidden' + && $input['arguments']['type'] != 'hidden_extended' + ) { if (!$direct) { $output .= '
  • '; } @@ -572,7 +574,9 @@ class Wizard $output .= '
  • '; } else { - if ($input['arguments']['type'] != 'hidden') { + if ($input['arguments']['type'] != 'hidden' + && $input['arguments']['type'] != 'hidden_extended' + ) { if ($input['arguments']['inline'] != 'true') { $output .= '
    '; } else { @@ -675,7 +679,9 @@ class Wizard $output .= ''; } else { - if ($input['arguments']['type'] != 'hidden') { + if ($input['arguments']['type'] != 'hidden' + && $input['arguments']['type'] != 'hidden_extended' + ) { $output .= '
  • '; $output .= ''; $output .= $this->printInput($input['arguments']); diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index 811ce42ada..a051eb6ede 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -18,7 +18,7 @@ function edit(id, str) { } // Value input hidden. - var valueHidden = $("#hidden-json-rule").val(); + var valueHidden = $("#rule-stack").val(); // Convert to array. var arrayValueHidden = JSON.parse(valueHidden); @@ -31,13 +31,182 @@ function edit(id, str) { // Change value. arrayValueHidden[numberField].value = str; - // Update value json-rule. - $("#hidden-json-rule").val(JSON.stringify(arrayValueHidden)); + // Update value rule-stack. + $("#rule-stack").val(JSON.stringify(arrayValueHidden)); } return; } +function getStack() { + return JSON.parse($("#rule-stack").val()); +} + +function setStack(stack) { + return $("#rule-stack").val(JSON.stringify(stack)); +} + +function addStack(stack, item) { + console.log("voy a meterla bien al fondo"); + console.log(item); + stack.push(item); + setStack(stack); + console.log(stack); +} + +function prevStack(stack) { + return stack[stack.length - 1]; +} + +function getBlockState() { + return $("#block-status").val(); +} + +function setBlockState(st) { + return $("#block-status").val(st); +} + +function getBlockOrder() { + return $("#block-order").val(); +} + +function increaseBlockOrder(order) { + return $("#block-order").val(parseInt($("#block-order").val()) + 1); +} + +function gramaticRules(content) { + console.log($(content)); + var stack = getStack(); + var id = $(content).attr("id"); + var latest = prevStack(stack); + + console.log("ME LLAMAN CON " + id); + var classType = $(content) + .attr("class") + .split(/\s+/)[0]; + + var item; + + item = { + type: classType, + id: id, + value: $(content).text(), + order: getBlockOrder() + }; + + // Control block start. + if (id == "block-start") { + if (getBlockState() == "1") { + console.log("Block already opened"); + return false; + } + + if (stack.length > 0) { + if (latest.type == "nexos") { + // Can add a block start after a nexus. + addStack(stack, item); + setBlockState("1"); + return true; + } + } + + if (stack.length == 0) { + addStack(stack, item); + setBlockState("1"); + return true; + } + } + + // Control block end. + if (id == "block-end") { + if (getBlockState() == "0") { + console.log("Block already closed"); + return false; + } + + if (stack.length > 0) { + // We can only close a block after add a variable. + if (latest.type == "variables") { + // Can add a block start after a nexus. + addStack(stack, item); + setBlockState("0"); + increaseBlockOrder(); + return true; + } + } + } + + // Control field. + if (classType == "fields") { + if ( + stack.length == 0 || + latest.id == "block-start" || + latest.type == "nexos" + ) { + // We can add a field after a block start or a nexo + addStack(stack, item); + return true; + } + } + + console.log(latest); + // Control operator. + if (classType == "operators") { + if (latest.type == "fields" || latest.type == "variables") { + // We can add a operator after a field or a variable. + addStack(stack, item); + return true; + } + } + + // Control variables. + if (classType == "variables") { + if (latest.type == "operators" || latest.type == "modifiers") { + // We can add a operator after a field or a variable. + addStack(stack, item); + return true; + } + } + + // Control modifiers. + if (classType == "modifiers") { + // TODO: Could not be repeated per block!! + if (latest.type == "variables") { + // We can add a operator after a field or a variable. + addStack(stack, item); + return true; + } + } + + // Control nexos. + if (classType == "nexos") { + if (latest.type == "variables" && getBlockState() == "0") { + // After a variable and at the end of a block (rule). + // Could be anything. + addStack(stack, item); + increaseBlockOrder(); + return true; + } + + if (latest.id == "block-end" && getBlockState() == "0") { + // After a block-end could be anything. + addStack(stack, item); + increaseBlockOrder(); + return true; + } + + if (getBlockState() == "1") { + // I'm inside a block. Coul only use AND nexos. + if (id == "nexo-and") { + addStack(stack, item); + return true; + } + } + } + + return false; +} + function drop(ev) { ev.preventDefault(); @@ -47,6 +216,13 @@ function drop(ev) { // Extract ID. var id = $(content).attr("id"); + console.log("Moving: " + id); + + // Ensure rules. + if (gramaticRules(content) != true) { + return; + } + // Extract clas type. var classType = $(content) .attr("class") @@ -56,7 +232,7 @@ function drop(ev) { content = $(content).removeClass(classType); // Input hidden. - var valueHidden = $("#hidden-json-rule").val(); + var valueHidden = $("#rule-stack").val(); // Initialize stack. var stack = []; @@ -69,18 +245,11 @@ function drop(ev) { // Change ID for non repeat and use variable change text. content = $(content).attr("id", "element-" + stack.length); - // Add stack. - stack.push({ - type: classType, - element: id.replace(classType + "-", ""), - value: $(content).text() - }); - // Convert to json tring for value input hidden. var stackString = JSON.stringify(stack); // Set input hidden. - $("#hidden-json-rule").val(stackString); + $("#rule-stack").val(stackString); // Next button to submit is disabled $("#submit-rule").attr("disabled", true); From d222553aba0d443b7e5cf09cc6723b06c1104585 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Wed, 20 Nov 2019 18:27:21 +0100 Subject: [PATCH 115/306] Fixed audit log OUM entities bug --- pandora_console/include/ajax/update_manager.ajax.php | 5 +++-- pandora_console/include/functions_update_manager.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php index 9c964536b1..1988916bd5 100644 --- a/pandora_console/include/ajax/update_manager.ajax.php +++ b/pandora_console/include/ajax/update_manager.ajax.php @@ -266,9 +266,10 @@ if ($install_package) { [$version] ); + $product_name = io_safe_output(get_product_name()); db_pandora_audit( - 'Update '.get_product_name(), - "Update version: $version of ".get_product_name().' by '.$config['id_user'] + 'Update '.$product_name, + "Update version: $version of ".$product_name.' by '.$config['id_user'] ); $return['status'] = 'success'; diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index 73a654a50d..da74bac523 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -1166,7 +1166,7 @@ function update_manager_install_package_step2() } update_manager_enterprise_set_version($version); - $product_name = get_product_name(); + $product_name = io_safe_output(get_product_name()); // Generate audit entry. db_pandora_audit( From 17e7710f45d33109ccc301321661dbe098b98389 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Thu, 21 Nov 2019 09:05:34 +0100 Subject: [PATCH 116/306] add datepicker alert correlation --- pandora_console/include/javascript/alert.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index a051eb6ede..fa185691d4 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -474,3 +474,23 @@ function disabled_alert(settings) { } }); } + +function datetime_picker_callback(set) { + $("#text-time_from, #text-time_to").timepicker({ + showSecond: true, + timeFormat: set.timeFormat, + timeOnlyTitle: set.timeOnlyTitle, + timeText: set.timeText, + hourText: set.hourText, + minuteText: set.minuteText, + secondText: set.secondText, + currentText: set.currentText, + closeText: set.closeText + }); + + $("#text-date_from, #text-date_to").datepicker({ + dateFormat: set.dateFormat + }); + + $.datepicker.setDefaults($.datepicker.regional[set.regional]); +} From 791454ee87be336ef129b6b246f58fab7167cbd0 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 21 Nov 2019 10:22:51 +0100 Subject: [PATCH 117/306] Added Group by in tree view --- pandora_console/include/class/Tree.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 5c6434c8bd..57a69dd3ad 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1075,8 +1075,6 @@ class Tree ON ta.id_agente = tasg.id_agent LEFT JOIN talert_template_modules tatm ON tatm.id_agent_module = tam.id_agente_modulo - AND tatm.id_alert_template = 1 - OR tatm.id_alert_template = NULL $inner WHERE tam.disabled = 0 AND ta.disabled = 0 $condition @@ -1086,7 +1084,8 @@ class Tree $agent_status_filter $module_search_filter $tag_condition - ORDER BY tam.nombre ASC, tam.id_agente_modulo ASC"; + GROUP BY tam.id_agente_modulo + ORDER BY tam.nombre ASC, tam.id_agente_modulo ASC"; return $sql; } From 0f2b8a55a564f963daf4be5b93614fdf1cbc7f21 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 21 Nov 2019 12:05:14 +0100 Subject: [PATCH 118/306] wip alert correlation --- pandora_console/include/javascript/alert.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js index fa185691d4..2d9399389a 100644 --- a/pandora_console/include/javascript/alert.js +++ b/pandora_console/include/javascript/alert.js @@ -67,7 +67,7 @@ function setBlockState(st) { } function getBlockOrder() { - return $("#block-order").val(); + return parseInt($("#block-order").val()); } function increaseBlockOrder(order) { @@ -130,7 +130,6 @@ function gramaticRules(content) { // Can add a block start after a nexus. addStack(stack, item); setBlockState("0"); - increaseBlockOrder(); return true; } } @@ -183,15 +182,17 @@ function gramaticRules(content) { if (latest.type == "variables" && getBlockState() == "0") { // After a variable and at the end of a block (rule). // Could be anything. - addStack(stack, item); increaseBlockOrder(); + item.order = item.order + 1; + addStack(stack, item); return true; } if (latest.id == "block-end" && getBlockState() == "0") { // After a block-end could be anything. - addStack(stack, item); increaseBlockOrder(); + item.order += 1; + addStack(stack, item); return true; } From e4ba7ccde0eba5e97650858e7d247dded35da8e7 Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 21 Nov 2019 12:06:00 +0100 Subject: [PATCH 119/306] Added hint --- .../reporting/graph_builder.graph_editor.php | 77 +++++++------------ .../visual_console_builder.wizard.php | 6 +- 2 files changed, 31 insertions(+), 52 deletions(-) diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index 33cacc9bab..d69729eac9 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -59,52 +59,36 @@ switch ($action) { $resultOperationDB = false; } else if (!empty($ids_serialize)) { $ids = explode('|', $ids_serialize); - - switch ($config['dbtype']) { - case 'mysql': - $items = db_get_all_rows_sql( - ' - SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - break; - } + $items = db_get_all_rows_sql( + 'SELECT id_gs, `field_order` + FROM tgraph_source + WHERE id_graph = '.$id_graph.' + ORDER BY `field_order`' + ); if ($items === false) { $items = []; } - // Clean the repeated order values + // Clean the repeated order values. $order_temp = 1; foreach ($items as $item) { - switch ($config['dbtype']) { - case 'mysql': - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => $order_temp], - ['id_gs' => $item['id_rc']] - ); - break; - } + db_process_sql_update( + 'tgraph_source', + ['`field_order`' => $order_temp], + ['id_gs' => $item['id_rc']] + ); $order_temp++; } - - switch ($config['dbtype']) { - case 'mysql': - $items = db_get_all_rows_sql( - ' - SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - break; - } + $items = db_get_all_rows_sql( + 'SELECT id_gs, `field_order` + FROM tgraph_source + WHERE id_graph = '.$id_graph.' + ORDER BY `field_order`' + ); if ($items === false) { $items = []; @@ -116,7 +100,7 @@ switch ($action) { $temp = []; foreach ($items as $item) { - // Remove the contents from the block to sort + // Remove the contents from the block to sort. if (array_search($item['id_gs'], $ids) === false) { $temp[$item['field_order']] = $item['id_gs']; } @@ -150,16 +134,11 @@ switch ($action) { foreach ($items as $order => $id) { - switch ($config['dbtype']) { - case 'mysql': - - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => ($order + 1)], - ['id_gs' => $id] - ); - break; - } + db_process_sql_update( + 'tgraph_source', + ['`field_order`' => ($order + 1)], + ['id_gs' => $id] + ); } $resultOperationDB = true; @@ -211,7 +190,7 @@ if ($editGraph) { $weights = implode(',', $weight_array); } -// Modules table +// Modules table. if (count($module_array) > 0) { echo ""; echo ' @@ -224,7 +203,7 @@ if (count($module_array) > 0) { '; $color = 0; for ($a = 0; $a < count($module_array); $a++) { - // Calculate table line color + // Calculate table line color. if ($color == 1) { $tdcolor = 'datos'; $color = 0; @@ -332,7 +311,7 @@ echo ''; echo '
    '; -// Configuration form +// Configuration form. echo ''; echo ""; @@ -352,7 +331,7 @@ echo "'; echo ''; -echo "'; +echo "'; echo ''; echo "'; echo ''; diff --git a/pandora_console/godmode/reporting/visual_console_builder.wizard.php b/pandora_console/godmode/reporting/visual_console_builder.wizard.php index 955d4f88a9..6079d4bb1d 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.wizard.php +++ b/pandora_console/godmode/reporting/visual_console_builder.wizard.php @@ -15,7 +15,7 @@ global $config; check_login(); -// Visual console required +// Visual console required. if (empty($visualConsole)) { db_pandora_audit( 'ACL Violation', @@ -425,7 +425,7 @@ $table->data['all_one_item_per_agent'][1] .= html_print_input_hidden( $table->rowstyle['all_4'] = 'display: none;'; -$table->data['all_4'][0] = __('Agents'); +$table->data['all_4'][0] = __('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true); $agents_list = []; if (!is_metaconsole()) { @@ -506,7 +506,7 @@ $table->data['all_8'][1] = html_print_select( VISUAL_MAP_WIZARD_PARENTS_NONE, true ); -$table->data['all_8'][2] = ''.__('Item in the map').''.''.ui_print_help_tip( +$table->data['all_8'][2] = ''.__('Item in the map').''.ui_print_help_tip( __('The parenting relationships in %s will be drawn on the map.', get_product_name()), true ).''; From 5195d6a7543750489396e1c07c3ecb1495c5b303 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 21 Nov 2019 12:42:06 +0100 Subject: [PATCH 120/306] Allow single quotes hidden_extended --- pandora_console/include/functions_html.php | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index e329af6013..c66924d27a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1828,11 +1828,18 @@ function html_print_input_hidden($name, $value, $return=false, $class=false) * @param string $id Input value. * @param boolean $return Whether to return an output string or echo now (optional, echo by default). * @param string $class Set the class of input. + * @param boolean $quotes Use simple quotes or double quotes. * * @return string HTML code if return parameter is true. */ -function html_print_input_hidden_extended($name, $value, $id, $return=false, $class=false) -{ +function html_print_input_hidden_extended( + $name, + $value, + $id, + $return=false, + $class=false, + $quotes=false +) { if ($class !== false) { $classText = 'class="'.$class.'"'; } else { @@ -1845,7 +1852,16 @@ function html_print_input_hidden_extended($name, $value, $id, $return=false, $cl $ouput_id = $id; } - $output = ''; + $quote = '"'; + if ($quotes === true) { + $quote = "'"; + } + + $output = ' Date: Thu, 21 Nov 2019 13:12:17 +0100 Subject: [PATCH 121/306] moved alert.js to correlated_alerts.js --- pandora_console/include/javascript/alert.js | 497 -------------------- 1 file changed, 497 deletions(-) delete mode 100644 pandora_console/include/javascript/alert.js diff --git a/pandora_console/include/javascript/alert.js b/pandora_console/include/javascript/alert.js deleted file mode 100644 index 2d9399389a..0000000000 --- a/pandora_console/include/javascript/alert.js +++ /dev/null @@ -1,497 +0,0 @@ -/* eslint-disable no-unused-vars */ -/* global $, load_modal, generalShowMsg, confirmDialog */ - -function allowDrop(ev) { - ev.preventDefault(); -} - -function drag(ev) { - ev.dataTransfer.setData("html", ev.target.outerHTML); -} - -function edit(id, str) { - // If not defined id return. - console.log(id); - - if (id == "variable-text") { - return; - } - - // Value input hidden. - var valueHidden = $("#rule-stack").val(); - - // Convert to array. - var arrayValueHidden = JSON.parse(valueHidden); - - // Extract to id number row. - var numberField = id.replace("element-", ""); - - // Check do no undefined. - if (arrayValueHidden[numberField] != undefined) { - // Change value. - arrayValueHidden[numberField].value = str; - - // Update value rule-stack. - $("#rule-stack").val(JSON.stringify(arrayValueHidden)); - } - - return; -} - -function getStack() { - return JSON.parse($("#rule-stack").val()); -} - -function setStack(stack) { - return $("#rule-stack").val(JSON.stringify(stack)); -} - -function addStack(stack, item) { - console.log("voy a meterla bien al fondo"); - console.log(item); - stack.push(item); - setStack(stack); - console.log(stack); -} - -function prevStack(stack) { - return stack[stack.length - 1]; -} - -function getBlockState() { - return $("#block-status").val(); -} - -function setBlockState(st) { - return $("#block-status").val(st); -} - -function getBlockOrder() { - return parseInt($("#block-order").val()); -} - -function increaseBlockOrder(order) { - return $("#block-order").val(parseInt($("#block-order").val()) + 1); -} - -function gramaticRules(content) { - console.log($(content)); - var stack = getStack(); - var id = $(content).attr("id"); - var latest = prevStack(stack); - - console.log("ME LLAMAN CON " + id); - var classType = $(content) - .attr("class") - .split(/\s+/)[0]; - - var item; - - item = { - type: classType, - id: id, - value: $(content).text(), - order: getBlockOrder() - }; - - // Control block start. - if (id == "block-start") { - if (getBlockState() == "1") { - console.log("Block already opened"); - return false; - } - - if (stack.length > 0) { - if (latest.type == "nexos") { - // Can add a block start after a nexus. - addStack(stack, item); - setBlockState("1"); - return true; - } - } - - if (stack.length == 0) { - addStack(stack, item); - setBlockState("1"); - return true; - } - } - - // Control block end. - if (id == "block-end") { - if (getBlockState() == "0") { - console.log("Block already closed"); - return false; - } - - if (stack.length > 0) { - // We can only close a block after add a variable. - if (latest.type == "variables") { - // Can add a block start after a nexus. - addStack(stack, item); - setBlockState("0"); - return true; - } - } - } - - // Control field. - if (classType == "fields") { - if ( - stack.length == 0 || - latest.id == "block-start" || - latest.type == "nexos" - ) { - // We can add a field after a block start or a nexo - addStack(stack, item); - return true; - } - } - - console.log(latest); - // Control operator. - if (classType == "operators") { - if (latest.type == "fields" || latest.type == "variables") { - // We can add a operator after a field or a variable. - addStack(stack, item); - return true; - } - } - - // Control variables. - if (classType == "variables") { - if (latest.type == "operators" || latest.type == "modifiers") { - // We can add a operator after a field or a variable. - addStack(stack, item); - return true; - } - } - - // Control modifiers. - if (classType == "modifiers") { - // TODO: Could not be repeated per block!! - if (latest.type == "variables") { - // We can add a operator after a field or a variable. - addStack(stack, item); - return true; - } - } - - // Control nexos. - if (classType == "nexos") { - if (latest.type == "variables" && getBlockState() == "0") { - // After a variable and at the end of a block (rule). - // Could be anything. - increaseBlockOrder(); - item.order = item.order + 1; - addStack(stack, item); - return true; - } - - if (latest.id == "block-end" && getBlockState() == "0") { - // After a block-end could be anything. - increaseBlockOrder(); - item.order += 1; - addStack(stack, item); - return true; - } - - if (getBlockState() == "1") { - // I'm inside a block. Coul only use AND nexos. - if (id == "nexo-and") { - addStack(stack, item); - return true; - } - } - } - - return false; -} - -function drop(ev) { - ev.preventDefault(); - - // Source Element. - var content = ev.dataTransfer.getData("html"); - - // Extract ID. - var id = $(content).attr("id"); - - console.log("Moving: " + id); - - // Ensure rules. - if (gramaticRules(content) != true) { - return; - } - - // Extract clas type. - var classType = $(content) - .attr("class") - .split(/\s+/)[0]; - - // Remove Class. - content = $(content).removeClass(classType); - - // Input hidden. - var valueHidden = $("#rule-stack").val(); - - // Initialize stack. - var stack = []; - // Check first. - if (valueHidden != 0) { - // Value decode. - stack = JSON.parse(valueHidden); - } - - // Change ID for non repeat and use variable change text. - content = $(content).attr("id", "element-" + stack.length); - - // Convert to json tring for value input hidden. - var stackString = JSON.stringify(stack); - - // Set input hidden. - $("#rule-stack").val(stackString); - - // Next button to submit is disabled - $("#submit-rule").attr("disabled", true); - - // Source class type action. - switch (classType) { - case "fields": - $(".fields").addClass("opacityElements"); - $(".fields").attr("draggable", false); - - $(".operators").removeClass("opacityElements"); - $(".operators").attr("draggable", true); - break; - - case "operators": - $(".operators").addClass("opacityElements"); - $(".operators").attr("draggable", false); - - $(".variables").removeClass("opacityElements"); - $(".variables").attr("draggable", true); - break; - - case "variables": - $(".variables").addClass("opacityElements"); - $(".variables").attr("draggable", false); - - $(".modifiers").removeClass("opacityElements"); - $(".modifiers").attr("draggable", true); - $(".nexos").removeClass("opacityElements"); - $(".nexos").attr("draggable", true); - $("#submit-rule").attr("disabled", false); - break; - - case "modifiers": - $(".modifiers").addClass("opacityElements"); - $(".modifiers").attr("draggable", false); - $(".nexos").addClass("opacityElements"); - $(".nexos").attr("draggable", false); - - $(".variables").removeClass("opacityElements"); - $(".variables").attr("draggable", true); - break; - - case "nexos": - $(".modifiers").addClass("opacityElements"); - $(".modifiers").attr("draggable", false); - $(".nexos").addClass("opacityElements"); - $(".nexos").attr("draggable", false); - - $(".fields").removeClass("opacityElements"); - $(".fields").attr("draggable", true); - break; - default: - break; - } - - // Create content. - var data = document.createElement("span"); - - content = $(content).prop("outerHTML"); - // If content nexo line break. - if (content.includes("nexo")) { - content = "
    " + content; - } - - // Add source element in content. - data.innerHTML = content; - - // Add content to target. - document.getElementById(ev.target.id).appendChild(data); -} - -function add_alert_action(settings) { - load_modal({ - target: $("#modal-add-action-form"), - form: "modal_form_add_actions", - url: settings.url_ajax, - modal: { - title: settings.title, - cancel: settings.btn_cancel, - ok: settings.btn_text - }, - onshow: { - page: settings.url, - method: "addAlertActionForm", - extradata: { - id: settings.id - } - }, - onsubmit: { - page: settings.url, - method: "addAlertAction", - dataType: "json" - }, - ajax_callback: add_alert_action_acept, - idMsgCallback: "msg-add-action" - }); -} - -function add_alert_action_acept(data, idMsg) { - if (data.error === 1) { - console.log(data.text); - return; - } - - if ($("#emptyli-al-" + data.id_alert).length > 0) { - $("#emptyli-al-" + data.id_alert).remove(); - } - - $.ajax({ - method: "post", - url: data.url, - data: { - page: data.page, - method: "addRowActionAjax", - id_alert: data.id_alert, - id_action: data.id_action - }, - dataType: "html", - success: function(li) { - $(".ui-dialog-content").dialog("close"); - $("#ul-al-" + data.id_alert).append(li); - }, - error: function(error) { - console.log(error); - } - }); -} - -function delete_alert_action(settings) { - confirmDialog({ - title: settings.title, - message: settings.msg, - onAccept: function() { - $.ajax({ - method: "post", - url: settings.url, - data: { - page: settings.page, - method: "deleteActionAlert", - id_alert: settings.id_alert, - id_action: settings.id_action - }, - dataType: "json", - success: function(data) { - // Delete row table. - $( - "#li-al-" + settings.id_alert + "-act-" + settings.id_action - ).remove(); - - var num_row = $("#ul-al-" + settings.id_alert + " li").length; - if (num_row === 0) { - var emptyli = - "
  • " + - settings.emptyli + - "
  • "; - $("#ul-al-" + settings.id_alert).append(emptyli); - } - }, - error: function(error) { - console.log(error); - } - }); - } - }); -} - -function standby_alert(settings) { - confirmDialog({ - title: settings.title, - message: settings.msg, - onAccept: function() { - $.ajax({ - method: "post", - url: settings.url, - data: { - page: settings.page, - method: "standByAlert", - id_alert: settings.id_alert, - standby: settings.standby - }, - dataType: "html", - success: function(data) { - $("#standby-alert-" + settings.id_alert).empty(); - $("#standby-alert-" + settings.id_alert).append(data); - }, - error: function(error) { - console.log(error); - } - }); - } - }); -} - -function disabled_alert(settings) { - confirmDialog({ - title: settings.title, - message: settings.msg, - onAccept: function() { - $.ajax({ - method: "post", - url: settings.url, - data: { - page: settings.page, - method: "disabledAlert", - id_alert: settings.id_alert, - disabled: settings.disabled - }, - dataType: "json", - success: function(data) { - $("#disabled-alert-" + settings.id_alert).empty(); - $("#disabled-alert-" + settings.id_alert).append(data.disabled); - $("#status-alert-" + settings.id_alert).empty(); - $("#status-alert-" + settings.id_alert).append(data.status); - }, - error: function(error) { - console.log(error); - } - }); - } - }); -} - -function datetime_picker_callback(set) { - $("#text-time_from, #text-time_to").timepicker({ - showSecond: true, - timeFormat: set.timeFormat, - timeOnlyTitle: set.timeOnlyTitle, - timeText: set.timeText, - hourText: set.hourText, - minuteText: set.minuteText, - secondText: set.secondText, - currentText: set.currentText, - closeText: set.closeText - }); - - $("#text-date_from, #text-date_to").datepicker({ - dateFormat: set.dateFormat - }); - - $.datepicker.setDefaults($.datepicker.regional[set.regional]); -} From 8b9177c2e78d5327ff668496c010e842239bfcab Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 21 Nov 2019 13:18:04 +0100 Subject: [PATCH 122/306] fix bug when selecting and unselecting feature in gis maps --- pandora_console/include/functions_gis.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 049c0be3ac..9d923eccd1 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -275,7 +275,16 @@ function gis_activate_select_control($layers=null) $(document).ready ( function () { var layers = map.getLayersByClass("OpenLayers.Layer.Vector"); - var select = new OpenLayers.Control.SelectFeature(layers); + var select = new OpenLayers.Control.SelectFeature(layers, { + clickout: true, + multiple: true, + toggle: true, + autoActivate: true, + onSelect: function() { + OpenLayers.Control.SelectFeature.prototype.unselectAll.apply( + select); + } + }); map.addControl(select); select.activate(); } From dcf33758fa31e249bbb49f90f93bac9edd893ef2 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 21 Nov 2019 14:36:31 +0100 Subject: [PATCH 123/306] Fis bug on reports db interface query --- pandora_console/include/functions_reporting_xml.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_reporting_xml.php b/pandora_console/include/functions_reporting_xml.php index 91e3288d83..938961da75 100644 --- a/pandora_console/include/functions_reporting_xml.php +++ b/pandora_console/include/functions_reporting_xml.php @@ -39,6 +39,9 @@ function reporting_xml_get_report($report, $filename, $return=false) } } + // Remove entities. + $report = io_safe_output($report); + $xml = null; $xml = array2XML($report, 'report', $xml); $xml = preg_replace('/(<[^>]+>)(<[^>]+>)(<[^>]+>)/', "$1\n$2\n$3", $xml); From 66035a8b67e363020c85c19c4445989ae80c47e6 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Thu, 21 Nov 2019 15:27:47 +0100 Subject: [PATCH 124/306] fixed errors css --- pandora_console/include/styles/alert.css | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index c2d4c84b2b..280ed1decc 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -131,3 +131,31 @@ div.target { .inEdit { background-color: #888; } + +.info-container { + width: 100%; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-around; +} + +.info-item { + width: 25%; +} + +.info-days { + width: 65%; +} + +.info-item table.info_table thead tr th { + text-align: center; +} + +.info-item table.info_table tbody tr { + border-bottom: none; +} + +.info-container table.no-class tbody tr td { + padding: 10px; +} From 02780aed410815b709a2cac2bd30285d52cb8f96 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 21 Nov 2019 16:36:34 +0100 Subject: [PATCH 125/306] fix bug when checking acl permissions with regard to secondary groups in monitor view --- pandora_console/operation/agentes/status_monitor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 03fb79d168..1f09545f97 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1485,7 +1485,8 @@ if (!empty($result)) { // Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions if (!is_metaconsole()) { - $acl_graphs = check_acl($config['id_user'], $row['id_group'], 'RR'); + $agent_groups = agents_get_all_groups_agent($row['id_agent'], $row['id_group']); + $acl_graphs = check_acl_one_of_groups($config['id_user'], $agent_groups, 'RR'); } else { $acl_graphs = true; } From d392978a70fec15848689fb87012c9fb570a3985 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 21 Nov 2019 17:28:58 +0100 Subject: [PATCH 126/306] Fixed bug when deleting nodes in network maps --- .../javascript/functions_pandora_networkmap.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 5d3477dca1..f45ebe3463 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -792,8 +792,8 @@ function edit_node(data_node, dblClick) { var id_networkmap_lenght = networkmap_id.toString().length; var id_node_length = id.length - id_networkmap_lenght; id = id.substring(0, id_node_length); - var node_selected = graph.nodes[id]; - + var index_node = $.inArray(data_node, graph.nodes); + var node_selected = graph.nodes[index_node]; var selected_links = get_relations(node_selected); $( @@ -2868,10 +2868,13 @@ function init_drag_and_drop() { var selection = d3.selectAll(".node_selected"); selection.each(function(d) { - graph.nodes[d.id].x = d.x + delta[0]; - graph.nodes[d.id].y = d.y + delta[1]; - graph.nodes[d.id].px = d.px + delta[0]; - graph.nodes[d.id].py = d.py + delta[1]; + // We search the position of this node in the array (index). + // This is to avoid errors when deleting nodes (id doesn't match index). + var index_node = $.inArray(d, graph.nodes); + graph.nodes[index_node].x = d.x + delta[0]; + graph.nodes[index_node].y = d.y + delta[1]; + graph.nodes[index_node].px = d.px + delta[0]; + graph.nodes[index_node].py = d.py + delta[1]; }); draw_elements_graph(); From 93c4793025b98c724f8d0e2cdc06a3fecf1d3913 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 21 Nov 2019 17:36:01 +0100 Subject: [PATCH 127/306] add id_source_event 33.sql --- pandora_console/extras/mr/33.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 755ec5f9c4..0d8eda13c6 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -17,5 +17,7 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); +ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10); + COMMIT; From 362837f85609f8839069f2ed2135ffff12bee42f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 21 Nov 2019 17:47:21 +0100 Subject: [PATCH 128/306] updated default values for tevent_rule, new tokens for correlated alerts --- pandora_console/extras/mr/33.sql | 3 +++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 3 ++- pandora_console/pandoradb.sql | 4 ++-- pandora_server/conf/pandora_server.conf.new | 3 +++ pandora_server/lib/PandoraFMS/Config.pm | 4 ++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index c6dcd70dec..954fa89a08 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -8,6 +8,9 @@ INSERT INTO `ttipo_modulo` VALUES (36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'), (37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'); +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned NOT NULL default '99'; + ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 5aed467ab7..388a008b45 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -580,7 +580,8 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator fo ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content'; ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; - +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned NOT NULL default '99'; -- ----------------------------------------------------- -- Table `tevent_alert` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 412ff3bcfd..500eeed86f 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2774,10 +2774,10 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `id_usuario` varchar(100) NOT NULL default '', `id_grupo` mediumint(4) NOT NULL default '0', `evento` text NOT NULL default '', - `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default 'unknown', + `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '', `module` text default '', `alert` text default '', - `criticity` int(4) unsigned NOT NULL default '0', + `criticity` int(4) unsigned NOT NULL default '99', `user_comment` text NOT NULL, `id_tag` integer(10) unsigned NOT NULL default '0', `name` text default '', diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 2eb9fad569..d51d1515b2 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -457,6 +457,9 @@ event_window 3600 log_window 3600 +# Pre-load windows on start with available information. (PANDORA FMS ENTERPRISE ONLY). +#preload_windows 0 + # If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status. event_inhibit_alerts 0 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 64804cca4e..639e915b4d 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -304,6 +304,7 @@ sub pandora_load_config { $pa_config->{"eventserver"} = 1; # 4.0 $pa_config->{"event_window"} = 3600; # 4.0 $pa_config->{"log_window"} = 3600; # 7.741 + $pa_config->{"preload_windows"} = 0; # 7.741 $pa_config->{"icmpserver"} = 0; # 4.0 $pa_config->{"icmp_threads"} = 3; # 4.0 $pa_config->{"snmpserver"} = 0; # 4.0 @@ -984,6 +985,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^log_window\s+([0-9]*)/i) { $pa_config->{'log_window'}= clean_blank($1); } + elsif ($parametro =~ m/^preload_windows\s+([0-9]*)/i) { + $pa_config->{'preload_windows'}= clean_blank($1); + } elsif ($parametro =~ m/^snmp_threads\s+([0-9]*)/i) { $pa_config->{'snmp_threads'}= clean_blank($1); } From 561e73d52401757e5d0790ad9c611a384ac60f8e Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 22 Nov 2019 10:03:53 +0100 Subject: [PATCH 129/306] Updated version and build strings. --- pandora_agents/pc/AIX/pandora_agent.conf | 2 +- pandora_agents/pc/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/pc/HP-UX/pandora_agent.conf | 2 +- pandora_agents/pc/Linux/pandora_agent.conf | 2 +- pandora_agents/pc/NT4/pandora_agent.conf | 2 +- pandora_agents/pc/SunOS/pandora_agent.conf | 2 +- pandora_agents/pc/Win32/pandora_agent.conf | 2 +- pandora_agents/shellscript/aix/pandora_agent.conf | 2 +- pandora_agents/shellscript/bsd-ipso/pandora_agent.conf | 2 +- pandora_agents/shellscript/hp-ux/pandora_agent.conf | 2 +- pandora_agents/shellscript/linux/pandora_agent.conf | 2 +- pandora_agents/shellscript/mac_osx/pandora_agent.conf | 2 +- pandora_agents/shellscript/openWRT/pandora_agent.conf | 2 +- pandora_agents/shellscript/solaris/pandora_agent.conf | 2 +- pandora_agents/unix/AIX/pandora_agent.conf | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/Darwin/pandora_agent.conf | 2 +- pandora_agents/unix/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/unix/HP-UX/pandora_agent.conf | 2 +- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/unix/NT4/pandora_agent.conf | 2 +- pandora_agents/unix/NetBSD/pandora_agent.conf | 2 +- pandora_agents/unix/SunOS/pandora_agent.conf | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 4 ++-- pandora_agents/unix/pandora_agent.spec | 4 ++-- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/bin/pandora_agent.conf | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 4 ++-- pandora_console/pandora_console.rhel7.spec | 4 ++-- pandora_console/pandora_console.spec | 4 ++-- pandora_console/pandora_console_install | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/conf/pandora_server.conf.new | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 4 ++-- pandora_server/pandora_server.spec | 4 ++-- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 50 files changed, 58 insertions(+), 58 deletions(-) diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index f3657d3a7a..bf26d33be8 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, AIX version +# Version 7.0NG.741, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 95fd1090ad..fffddfa142 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, FreeBSD Version +# Version 7.0NG.741, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index 04122feb30..3d22eafb0e 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, HP-UX Version +# Version 7.0NG.741, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index b083e7f3aa..01359f33f5 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, GNU/Linux +# Version 7.0NG.741, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 4bb88c5b4e..ab8a35f9f8 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, GNU/Linux +# Version 7.0NG.741, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index a90b7227ca..90c1ba02a1 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, Solaris Version +# Version 7.0NG.741, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index d750898b70..61eab4edeb 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.740 +# Version 7.0NG.741 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 6a663d6331..3409d48740 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.740, AIX version +# Version 7.0NG.741, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index 99e4c62462..b8306e30c3 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.740 +# Version 7.0NG.741 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index 7a9d2c4347..15d2dab2d4 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.740, HPUX Version +# Version 7.0NG.741, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index a55d96a952..dbe433408f 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740 +# Version 7.0NG.741 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index a24a24d16e..4ad2f0d8df 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740 +# Version 7.0NG.741 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index 74d515cb4e..594f626617 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740 +# Version 7.0NG.741 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index dc915ef18e..eace98cb90 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.740, Solaris version +# Version 7.0NG.741, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index de7e97911b..2a02b6133f 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, AIX version +# Version 7.0NG.741, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 30bb717737..b87a17fb14 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.740-191122 +Version: 7.0NG.741 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index ac1792f927..80d11ebec7 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.740-191122" +pandora_version="7.0NG.741" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 34dd1bf4fc..adf05bac05 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, GNU/Linux +# Version 7.0NG.741, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index e4ad74ffe7..e5e3a2cc1b 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, FreeBSD Version +# Version 7.0NG.741, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index e55445fe13..409f06034b 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, HP-UX Version +# Version 7.0NG.741, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 54ace6a811..6340281c06 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, GNU/Linux +# Version 7.0NG.741, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 94e32e8056..c27a3f2da2 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, GNU/Linux +# Version 7.0NG.741, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index 71e7d14192..ab0ca2ad46 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, NetBSD Version +# Version 7.0NG.741, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index cc89dee501..4b6654b6ef 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.740, Solaris Version +# Version 7.0NG.741, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 3296156e53..21e85f888c 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -54,7 +54,7 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.740'; +use constant AGENT_VERSION => '7.0NG.741'; use constant AGENT_BUILD => '191122'; # Agent log default file size maximum and instances diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index eebd281636..76d1c8f828 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.740 -%define release 191122 +%define version 7.0NG.741 +%define release 1 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 51ca3872f1..f3ec603d95 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.740 -%define release 191122 +%define version 7.0NG.741 +%define release 1 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index d0d49023a3..3563200937 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,7 +9,7 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.740" +PI_VERSION="7.0NG.741" PI_BUILD="191122" OS_NAME=`uname -s` diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 79660e5b5d..8b51fc94f1 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.740 +# Version 7.0NG.741 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2fc3287a56..c69f34ab63 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.740} +{Pandora FMS Windows Agent v7.0NG.741} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-<%Version%>-Setup<%Ext%>} +{<%AppName%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 289598ecf3..9553546fc7 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.740(Build 191122)") +#define PANDORA_VERSION ("7.0NG.741(Build 191122)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5056749b6c..1dec86fe84 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.740(Build 191122))" + VALUE "ProductVersion", "(7.0NG.741(Build 191122))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9fcbbebf3d..a2c7e362e4 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.740-191122 +Version: 7.0NG.741 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 32acc651b2..0df64d8d55 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.740-191122" +pandora_version="7.0NG.741" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 21b647c827..6332a29284 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -21,7 +21,7 @@ * Pandora build version and version */ $build_version = 'PC191122'; -$pandora_version = 'v7.0NG.740'; +$pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/install.php b/pandora_console/install.php index ca6c8e2e7e..81338cc8e8 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -128,7 +128,7 @@
    Date: Fri, 22 Nov 2019 10:24:12 +0100 Subject: [PATCH 130/306] WIP alert correlations --- pandora_console/include/styles/alert.css | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 280ed1decc..5a01300dfa 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -2,6 +2,7 @@ li#li-buttons-alert-list > div { margin-left: 10px; } +li#li-filters_show_action_alerts > label, li#li-buttons-alert-list > label, li#li-filters-alert-list > label { width: initial; From de3f8b2a0fab85e6c44385bb323845ec0d701019 Mon Sep 17 00:00:00 2001 From: marcos Date: Fri, 22 Nov 2019 10:56:30 +0100 Subject: [PATCH 131/306] updates --- pandora_console/extras/mr/33.sql | 2 +- pandora_console/include/functions_events.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 0d8eda13c6..cb3669979b 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -17,7 +17,7 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); -ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10); +ALTER TABLE tevent_filter ADD COLUMN id_source_event int(10); COMMIT; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 4c68ff4306..9a3ccacdff 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -37,7 +37,7 @@ enterprise_include_once('meta/include/functions_agents_meta.php'); enterprise_include_once('meta/include/functions_modules_meta.php'); if (is_metaconsole()) { $id_source_event = get_parameter('id_source_event'); -enterprise_include_once('meta/include/functions_events_meta.php'); +} /** @@ -174,7 +174,6 @@ function events_translate_event_criticity($criticity) default: return __('UNKNOWN'); } ->>>>>>> pandora_console/include/functions_events.php } From 35abd1249959b8944960ad3d4d6a3d00df9a706a Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Fri, 22 Nov 2019 11:06:55 +0100 Subject: [PATCH 132/306] WIP alert correlations --- pandora_console/extras/mr/33.sql | 3 +++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 3 +++ pandora_console/pandoradb.sql | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 954fa89a08..afa7a2bb95 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -29,6 +29,9 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operat ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; +ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; +ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; + CREATE TABLE `tremote_command` ( `id` SERIAL, `name` varchar(150) NOT NULL, diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 388a008b45..6f6f82e866 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -630,6 +630,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; +ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; + -- ----------------------------------------------------- -- Table `tevent_alert_action` -- ----------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 500eeed86f..852244b562 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2821,7 +2821,7 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( `field8` text NOT NULL default '', `field9` text NOT NULL default '', `field10` text NOT NULL default '', - `time_threshold` int(10) NOT NULL default '0', + `time_threshold` int(10) NOT NULL default 86400, `max_alerts` int(4) unsigned NOT NULL default '1', `min_alerts` int(4) unsigned NOT NULL default '0', `time_from` time default '00:00:00', @@ -2846,6 +2846,7 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( `priority` tinyint(4) default '0', `force_execution` tinyint(1) default '0', `group_by` enum ('','id_agente','id_agentmodule','id_alert_am','id_grupo') default '', + `special_days` tinyint(1) default 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From fd12c5a009d764dfbea2c4dd3f3d69ab861e2dd3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 11:57:20 +0100 Subject: [PATCH 133/306] DB update, default values for Alert correlation --- pandora_console/extras/mr/33.sql | 4 +++- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 3 ++- pandora_console/pandoradb.sql | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index afa7a2bb95..90cf099656 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -9,7 +9,9 @@ INSERT INTO `ttipo_modulo` VALUES (37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'); ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; -ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned NOT NULL default '99'; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL, + ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 6f6f82e866..d30f95ba49 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -581,7 +581,8 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operat ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; -ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned NOT NULL default '99'; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL, -- ----------------------------------------------------- -- Table `tevent_alert` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 852244b562..629276f352 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2772,12 +2772,12 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( `count` int(4) NOT NULL default '1', `agent` text default '', `id_usuario` varchar(100) NOT NULL default '', - `id_grupo` mediumint(4) NOT NULL default '0', + `id_grupo` mediumint(4) default NULL, `evento` text NOT NULL default '', `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '', `module` text default '', `alert` text default '', - `criticity` int(4) unsigned NOT NULL default '99', + `criticity` int(4) unsigned default NULL, `user_comment` text NOT NULL, `id_tag` integer(10) unsigned NOT NULL default '0', `name` text default '', From 1565fee3f46b235aac9baea6a7516f36015bdac0 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 11:59:24 +0100 Subject: [PATCH 134/306] minor fix, errata --- pandora_console/extras/mr/33.sql | 2 +- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 90cf099656..ebbdf549ac 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -10,7 +10,7 @@ INSERT INTO `ttipo_modulo` VALUES ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; -ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL, +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d30f95ba49..1b5db78cd3 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -582,7 +582,7 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operato ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; -ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL, +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; -- ----------------------------------------------------- -- Table `tevent_alert` From 5b5895a6443acadda40f7ac2380f93ee8a5ae366 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 13:30:25 +0100 Subject: [PATCH 135/306] minor fix --- pandora_console/include/functions_agents.php | 23 ++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index e85798cfde..e15a0a0f97 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -3542,17 +3542,22 @@ function agents_get_sap_agents($id_agent) $array_agents = []; foreach ($sap_modules as $module => $key) { + $new_ones = db_get_all_rows_sql( + 'SELECT ta.id_agente,ta.alias + FROM tagente ta + INNER JOIN tagente_modulo tam + ON tam.id_agente = ta.id_agente + WHERE tam.nombre + LIKE "%SAP%" + GROUP BY ta.id_agente' + ); + if ($new_ones === false) { + continue; + } + $array_agents = array_merge( $array_agents, - db_get_all_rows_sql( - 'SELECT ta.id_agente,ta.alias - FROM tagente ta - INNER JOIN tagente_modulo tam - ON tam.id_agente = ta.id_agente - WHERE tam.nombre - LIKE "%SAP%" - GROUP BY ta.id_agente' - ) + $new_ones ); } From 21bf49c218f0be9dfaa379916c632bf5c7466925 Mon Sep 17 00:00:00 2001 From: marcos Date: Fri, 22 Nov 2019 13:38:08 +0100 Subject: [PATCH 136/306] update id_source_event --- pandora_console/extras/mr/33.sql | 3 ++- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- .../godmode/events/event_edit_filter.php | 12 ++++++++++++ pandora_console/include/ajax/events.php | 14 ++++++++++---- pandora_console/include/functions_events.php | 10 ++++++++++ .../operation/events/events.build_query.php | 13 +++++++------ pandora_console/operation/events/events.php | 19 +++++++++++++++++++ .../operation/events/events_list.php | 15 +++++---------- pandora_console/pandoradb.sql | 2 +- 9 files changed, 67 insertions(+), 23 deletions(-) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 9c343d2cdb..1d912a96b2 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -47,9 +47,10 @@ CREATE TABLE `tremote_command_target` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); -ALTER TABLE tevent_filter ADD COLUMN id_source_event int(10); ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; +ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10); + COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 3e4c754aac..92e4289ab3 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1358,7 +1358,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; -ALTER TABLE tevent_filter ADD COLUMN id_source_event int(10); +ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10); ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index e66e1d30b4..41068372d4 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -588,6 +588,18 @@ $table->data[23][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255, $table->data[24][0] = ''.__('Comment').''; $table->data[24][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true); +if (is_metaconsole()) { + $table->data[25][0] = ''.__('Id souce event').''; + $table->data[25][1] = html_print_input_text( + 'id_source_event', + $id_source_event, + '', + 35, + 255, + true + ); +} + echo ''; html_print_table($table); diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index ad9d59a748..af3388ffbf 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -84,7 +84,7 @@ $delete_event = get_parameter('delete_event', 0); $get_event_filters = get_parameter('get_event_filters', 0); $get_comments = get_parameter('get_comments', 0); $get_events_fired = (bool) get_parameter('get_events_fired'); - +$get_id_source_event = get_parameter('get_id_source_event'); if ($get_comments) { $event = get_parameter('event', false); $filter = get_parameter('filter', false); @@ -253,7 +253,7 @@ if ($save_event_filter) { $values['source'] = get_parameter('source'); $values['id_extra'] = get_parameter('id_extra'); $values['user_comment'] = get_parameter('user_comment'); - + $values['id_source_event'] = get_parameter('id_source_event'); $exists = (bool) db_get_value_filter( 'id_filter', 'tevent_filter', @@ -300,6 +300,7 @@ if ($update_event_filter) { $values['source'] = get_parameter('source'); $values['id_extra'] = get_parameter('id_extra'); $values['user_comment'] = get_parameter('user_comment'); + $values['id_source_event'] = get_parameter('id_source_event'); if (io_safe_output($values['tag_with']) == '["0"]') { $values['tag_with'] = '[]'; @@ -465,6 +466,8 @@ function load_form_filter() { $("#text-id_extra").val(val); if (i == 'user_comment') $("#text-user_comment").val(val); + if (i == 'id_source_event') + $("#text-id_source_event").val(val); }); reorder_tags_inputs(); // Update the info with the loaded filter @@ -685,7 +688,8 @@ function save_new_filter() { "date_to": $("#text-date_to").val(), "source": $("#text-source").val(), "id_extra": $("#text-id_extra").val(), - "user_comment": $("#text-user_comment").val() + "user_comment": $("#text-user_comment").val(), + "id_source_event": $("#text-id_source_event").val() }, function (data) { $("#info_box").hide(); @@ -754,7 +758,9 @@ function save_update_filter() { "date_to": $("#text-date_to").val(), "source": $("#text-source").val(), "id_extra": $("#text-id_extra").val(), - "user_comment": $("#text-user_comment").val() + "user_comment": $("#text-user_comment").val(), + "id_source_event": $("#text-id_source_event").val() + }, function (data) { $(".info_box").hide(); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index fab79f95cb..78770840f1 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -928,6 +928,16 @@ function events_get_all( ); } + if (is_metaconsole()) { + // Id source event. + if (!empty($filter['id_source_event'])) { + $sql_filters[] = sprintf( + ' AND lower(te.id_source_event) like lower("%%%s%%") ', + $filter['id_source_event'] + ); + } + } + // User comment. if (!empty($filter['user_comment'])) { $sql_filters[] = sprintf( diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index da7451ff4c..b1b4051e7f 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -50,12 +50,6 @@ if (!isset($date_to)) { $date_to = ''; } -if ($id_source_event != 0 || $id_source_event != '') { - $filter_resume['id_source_event'] = $id_source_event; -} else { - $id_source_event = ''; -} - if (($date_from === '') && ($date_to === '')) { if ($event_view_hr > 0) { $filter_resume['hours_max'] = $event_view_hr; @@ -237,6 +231,13 @@ if ($source != '') { $sql_post .= " AND source LIKE '%$source%'"; } +if (is_metaconsole()) { + if ($id_source_event != '') { + $sql_post .= " AND id_source_event LIKE '%$id_source_event%'"; + } +} + + // In metaconsole mode the agent search is performed by name. if ($meta) { $text_agent = get_parameter('text_agent', ''); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 527cef8ec5..ea72a6d914 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -197,6 +197,10 @@ $history = get_parameter( ); $section = get_parameter('section', false); +$id_source_event = get_parameter( + 'filter[id_source_event]', + $filter['id_source_event'] +); // Ajax responses. if (is_ajax()) { $get_events = get_parameter('get_events', 0); @@ -396,6 +400,7 @@ if ($user_filter !== false) { $source = $filter['source']; $id_extra = $filter['id_extra']; $user_comment = $filter['user_comment']; + $id_source_event = $filter['id_source_event']; } } @@ -1051,6 +1056,20 @@ $in = '
    '; $in .= $data.'
    '; $adv_inputs[] = $in; +if (is_metaconsole()) { + $data = html_print_input_text( + 'id_source_event', + $id_source_event, + '', + 5, + 255, + true + ); + $in = '
    '; + $in .= $data.'
    '; + $adv_inputs[] = $in; +} + // Gap. $adv_inputs[] = '
    '; diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 13015fabdf..ae39dabf3b 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -258,11 +258,6 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) { $id_extra = $user_default_filter['id_extra']; $user_comment = $user_default_filter['user_comment']; $source = $user_default_filter['source']; - $id_source_event = $user_default_filter['id_source_event']; - - if (is_metaconsole()) { - $id_source_event = $user_default_filter['id_source_event']; - } if ($user_default_filter['search'] != '') { $search = $user_default_filter['search']; @@ -1143,7 +1138,7 @@ if ($group_rep == 0) { $sql = "SELECT DISTINCT te.*, 1 event_rep, (SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name FROM $event_table te $event_lj - WHERE 1=1 ".$sql_post." + WHERE 1=1 '.$sql_post.' $order_sql LIMIT ".$offset.','.$pagination; // Extract the events by filter (or not) from db. @@ -1216,10 +1211,10 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) { } if ($group_rep == 0) { - $sql = "SELECT COUNT(DISTINCT id_evento) + $sql = 'SELECT COUNT(DISTINCT id_evento) FROM $event_table te $event_lj - WHERE 1=1 $sql_post"; + WHERE 1=1 $sql_post'; $total_events = (int) db_get_sql($sql); } else if ($group_rep == 1) { $total_events = events_get_events_grouped( @@ -1232,10 +1227,10 @@ if ($group_rep == 0) { false ); } else if ($group_rep == 2) { - $sql = "SELECT COUNT(*) FROM (select id_agente as total from $event_table te + $sql = 'SELECT COUNT(*) FROM (select id_agente as total from $event_table te $event_lj WHERE id_agente > 0 - $sql_post GROUP BY id_agente ORDER BY id_agente ) AS t"; + $sql_post GROUP BY id_agente ORDER BY id_agente ) AS t'; $total_events = (int) db_get_sql($sql); } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c4854443f3..8c07369228 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1116,7 +1116,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `source` tinytext NOT NULL, `id_extra` tinytext NOT NULL, `user_comment` text NOT NULL, - `id_source_event` int(10) default NULL, + `id_source_event` int(10) NULL default 0, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 337e3357db7a339260b78608436da4e1e7ebbade Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 22 Nov 2019 13:59:22 +0100 Subject: [PATCH 137/306] Non-intensive modules do not need to check a timestamp. Ref pandora_enterprise#4660. --- .../win32/modules/pandora_module.cc | 14 ++++++ pandora_agents/win32/modules/pandora_module.h | 1 + .../win32/pandora_windows_service.cc | 46 +++++++++++-------- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index 7cbde21ca7..59e8af0a5b 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -1708,3 +1708,17 @@ void Pandora_Module::setExecutions (long executions) { this->executions = executions; } + +/** + * Checks if the module has intensive conditions. + * + * @return true if the module's intensive condition list is not empty, false if it is. + */ +bool +Pandora_Module::isIntensive () { + if (this->intensive_condition_list == NULL || this->intensive_condition_list->size () <= 0) { + return false; + } + + return true; +} diff --git a/pandora_agents/win32/modules/pandora_module.h b/pandora_agents/win32/modules/pandora_module.h index 3b9d6c15a4..f38cac5f80 100644 --- a/pandora_agents/win32/modules/pandora_module.h +++ b/pandora_agents/win32/modules/pandora_module.h @@ -303,6 +303,7 @@ namespace Pandora_Modules { time_t getTimestamp (); void setIntensiveMatch (unsigned char intensive_match); unsigned char getIntensiveMatch (); + bool isIntensive (); }; } diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index b62fc1f70d..73d0a5d482 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -1918,16 +1918,19 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) { } /* Evaluate intensive conditions */ - intensive_match = module->evaluateIntensiveConditions (); - if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { - module->setNoOutput (); - this->broker_modules->goNext (); - continue; - } - module->setIntensiveMatch (intensive_match); - - if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { - module->setTimestamp (this->run_time); + if (module->isIntensive()) { + intensive_match = module->evaluateIntensiveConditions (); + if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { + module->setNoOutput (); + this->broker_modules->goNext (); + continue; + } + + if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { + module->setTimestamp (this->run_time); + } + + module->setIntensiveMatch (intensive_match); } /* Evaluate module conditions */ @@ -2038,16 +2041,19 @@ Pandora_Windows_Service::pandora_run (int forced_run) { } /* Evaluate intensive conditions */ - intensive_match = module->evaluateIntensiveConditions (); - if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { - module->setNoOutput (); - this->modules->goNext (); - continue; - } - module->setIntensiveMatch (intensive_match); - - if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { - module->setTimestamp (this->run_time); + if (module->isIntensive()) { + intensive_match = module->evaluateIntensiveConditions (); + if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { + module->setNoOutput (); + this->modules->goNext (); + continue; + } + + if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { + module->setTimestamp (this->run_time); + } + + module->setIntensiveMatch (intensive_match); } /* Evaluate module conditions */ From e8812cba953017dd4988360b018b660c3b0dac06 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Fri, 22 Nov 2019 14:50:23 +0100 Subject: [PATCH 138/306] add img --- pandora_console/images/sortable.png | Bin 0 -> 344 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/sortable.png diff --git a/pandora_console/images/sortable.png b/pandora_console/images/sortable.png new file mode 100644 index 0000000000000000000000000000000000000000..9b6f09ec346f84234dfa16276d6a280a39470d81 GIT binary patch literal 344 zcmV-e0jK_nP)P0015c1^@s6+3dC30000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUy`bk7VRCwBAU>Gidkrc%yCME(v$^eKj zoH=vm163>m8ma)K9DrCKN*f?aKLFwbKztBt=>?)J0UBxmHOwArpaK>{9|EyFR36#V z4``MiK(Pd9_u0?@n( zFiZYpsb(*NXnb`ymbQRB%y8t?#YjYh;RBkb2hiFA=+!oI0|TV~0V4tL8Xy^j3tT`m q^aI)LE~L6!AK6!<$(rf_Aix0DHe Date: Fri, 22 Nov 2019 15:26:30 +0100 Subject: [PATCH 139/306] fixed errors Alert correlation --- pandora_console/include/styles/alert.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 5a01300dfa..14dc0c946d 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -160,3 +160,16 @@ div.target { .info-container table.no-class tbody tr td { padding: 10px; } + +.mode_table_firing { + margin-top: 20px; +} + +.mode_table_firing table.info_table thead tr th { + font-weight: bolder; +} + +.mode_table_firing table.info_table thead tr th img { + padding: 10px; + vertical-align: middle; +} From 8001ba0d4140c687645ffe0e662fa95189574e04 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 15:37:32 +0100 Subject: [PATCH 140/306] minor fix --- pandora_console/include/styles/pandora.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 1ecd197ece..866958796c 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -4989,6 +4989,7 @@ input:checked + .p-slider:before { .action_buttons a, .action_buttons input[type="image"] { margin-right: 5px; + display: inline-block; } .action_buttons a:last-child, @@ -4998,7 +4999,6 @@ input:checked + .p-slider:before { .action_buttons a:hover { background-color: #fff; - display: inline-block; border-radius: 4px; } From 4e2bd7ed55b18da8606842c72d3ff8fe244f0bbf Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 20:49:46 +0100 Subject: [PATCH 141/306] minor fixes --- pandora_console/include/functions_html.php | 72 ++++++++++++++++------ pandora_server/lib/PandoraFMS/Core.pm | 2 +- 2 files changed, 53 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index c66924d27a..9bf4ae2be3 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2480,19 +2480,27 @@ function html_print_radio_button($name, $value, $label='', $checkedvalue='', $re /** * Render a checkbox button input. Extended version, use html_print_checkbox() to simplify. * - * @param string Input name. - * @param string Input value. - * @param string Set the button to be marked (optional, unmarked by default). - * @param bool Disable the button (optional, button enabled by default). - * @param string Script to execute when onClick event is triggered (optional). - * @param string Optional HTML attributes. It's a free string which will be - inserted into the HTML tag, use it carefully (optional). - * @param bool Whether to return an output string or echo now (optional, echo by default). + * @param string $name Input name. + * @param string $value Input value. + * @param string $checked Set the button to be marked (optional, unmarked by default). + * @param boolean $disabled Disable the button (optional, button enabled by default). + * @param string $script Script to execute when onClick event is triggered (optional). + * @param string $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional). + * @param boolean $return Whether to return an output string or echo now (optional, echo by default). + * @param string $id Custom id. * * @return string HTML code if return parameter is true. */ -function html_print_checkbox_extended($name, $value, $checked, $disabled, $script, $attributes, $return=false, $id='') -{ +function html_print_checkbox_extended( + $name, + $value, + $checked, + $disabled, + $script, + $attributes, + $return=false, + $id='' +) { static $idcounter = []; // If duplicate names exist, it will start numbering. Otherwise it won't @@ -2508,7 +2516,7 @@ function html_print_checkbox_extended($name, $value, $checked, $disabled, $scrip if ($id == '') { $output .= ' id="checkbox-'.$id_aux.'"'; } else { - $output .= ' '.$id.'"'; + $output .= ' id="'.$id.'"'; } if ($script != '') { @@ -2534,17 +2542,39 @@ function html_print_checkbox_extended($name, $value, $checked, $disabled, $scrip /** * Render a checkbox button input. * - * @param string Input name. - * @param string Input value. - * @param string Set the button to be marked (optional, unmarked by default). - * @param bool Whether to return an output string or echo now (optional, echo by default). - * @param boolean $disabled Disable the button (optional, button enabled by default). + * @param string $name Input name. + * @param string $value Input value. + * @param string $checked Set the button to be marked (optional, unmarked by default). + * @param boolean $return Whether to return an output string or echo now (optional, echo by default). + * @param boolean $disabled Disable the button (optional, button enabled by default). + * @param string $script Script. + * @param string $disabled_hidden Disabled_hidden. + * @param string $attributes Extra attributes. + * @param string $id Custom ID. * * @return string HTML code if return parameter is true. */ -function html_print_checkbox($name, $value, $checked=false, $return=false, $disabled=false, $script='', $disabled_hidden=false) -{ - $output = html_print_checkbox_extended($name, $value, (bool) $checked, $disabled, $script, '', true); +function html_print_checkbox( + $name, + $value, + $checked=false, + $return=false, + $disabled=false, + $script='', + $disabled_hidden=false, + $attributes='', + $id='' +) { + $output = html_print_checkbox_extended( + $name, + $value, + (bool) $checked, + $disabled, + $script, + $attributes, + true, + $id + ); if (!$disabled_hidden) { $output .= html_print_input_hidden($name.'_sent', 1, true); } @@ -3535,7 +3565,9 @@ function html_print_input($data, $wrapper='div', $input_only=false) ((isset($data['return']) === true) ? $data['return'] : false), ((isset($data['disabled']) === true) ? $data['disabled'] : false), ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false) + ((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false), + ((isset($data['attributes']) === true) ? $data['attributes'] : ''), + ((isset($data['id']) === true) ? $data['id'] : '') ); break; diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 48a6cbe4d9..ee005b0622 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1215,7 +1215,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { my $cid_data = "CID_IMAGE"; my $dataname = "CID_IMAGE.png"; - if ($data =~ /^data:image\/png;base64, /) { + if (defined($data) && $data =~ /^data:image\/png;base64, /) { # macro _data_ substitution in case is image. $attach_data_as_image = 1; my $_cid = ''; From 09e66156115d6dd12020b4b8820bcf7776d55dd0 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 23 Nov 2019 00:01:09 +0100 Subject: [PATCH 142/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b87a17fb14..df8b2ebfaa 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741 +Version: 7.0NG.741-191123 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 80d11ebec7..cdfc1fa1f4 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741" +pandora_version="7.0NG.741-191123" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 21e85f888c..1576d2c4a1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191122'; +use constant AGENT_BUILD => '191123'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 76d1c8f828..99266db31d 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 1 +%define release 191123 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index f3ec603d95..5a158e2de9 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 1 +%define release 191123 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 3563200937..d3d3d068b9 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191122" +PI_BUILD="191123" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c69f34ab63..c5d227f69d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191122} +{191123} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-Setup<%Ext%>} +{<%AppName%>-<%Version%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9553546fc7..bad09b10b7 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191122)") +#define PANDORA_VERSION ("7.0NG.741(Build 191123)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1dec86fe84..a83469b51f 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191122))" + VALUE "ProductVersion", "(7.0NG.741(Build 191123))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a2c7e362e4..0fadb3c407 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741 +Version: 7.0NG.741-191123 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 0df64d8d55..e9b84000c0 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741" +pandora_version="7.0NG.741-191123" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6332a29284..61c4c7c53f 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191122'; +$build_version = 'PC191123'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 81338cc8e8..b852862fef 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index aa7062cdec..bfa2f7302a 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 1 +%define release 191123 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index baa899801f..f88b164778 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 1 +%define release 191123 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 41877b1656..7a27cab255 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191122" +PI_BUILD="191123" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b5b8fa58fb..c7ac49746d 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191122"; +my $version = "7.0NG.741 PS191123"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 738db6bde8..ba45c23582 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191122"; +my $version = "7.0NG.741 PS191123"; # save program name for logging my $progname = basename($0); From 64e481187f298a2ef02b923da6f971e5ac98e093 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Sat, 23 Nov 2019 12:48:47 +0100 Subject: [PATCH 143/306] RuleBuilder Style updates --- pandora_console/include/styles/alert.css | 69 +++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 14dc0c946d..810050c301 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -2,6 +2,43 @@ li#li-buttons-alert-list > div { margin-left: 10px; } +#rule-builder .rule-builder-actions li { + display: inline; + width: auto; +} + +#rule-builder .rule-builder-actions li label { + width: 0; +} + +div.white_box { + min-width: 800px; +} + +#rules, +ul.sample { + margin-bottom: 2em; + flex: 1 1 300px; +} + +.flex-row label { + flex: 1 1 70px; +} + +.flex-row div { + flex: 10 1 200px; +} + +span.rule-title { + font-family: "lato-lighter", "Open Sans", sans-serif; + font-weight: normal; + font-size: 2em; + text-align: center; + display: block; + margin-bottom: 0.8em; + width: 100%; +} + li#li-filters_show_action_alerts > label, li#li-buttons-alert-list > label, li#li-filters-alert-list > label { @@ -80,10 +117,40 @@ ul.sample li:last-child { } div.target { flex-grow: 1; + flex-basis: auto; margin-left: 3em; - border: 1px solid #ddd; + display: flex; + flex-direction: column; +} +div.target.flex { + display: block; + border: 2px dashed #ddd; + margin-left: 0em; + margin-top: 10px; + padding-top: 1em; } +.fields, +.operators, +.variables, +.modifiers, +.nexos, +.blocks { + cursor: move; +} +div#rules.show::after { + content: "Drop here"; + position: relative; + top: 30%; + display: block; + left: 38%; + font-size: 3em; + color: #aaa; +} +div#rules.show { + box-shadow: 0 0 15px -5px #424242; + border: 1px solid #ddd; +} .field { display: inline-block; border-radius: 10px; From 2f0b2c17666d312c09d0e97aeb571354f6d4c60f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Sat, 23 Nov 2019 13:06:58 +0100 Subject: [PATCH 144/306] minor fix css --- pandora_console/include/styles/alert.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 810050c301..0871853962 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -21,11 +21,11 @@ ul.sample { flex: 1 1 300px; } -.flex-row label { +#rules.flex-row label { flex: 1 1 70px; } -.flex-row div { +#rules.flex-row div { flex: 10 1 200px; } From d3b5e7a2b0cf1f37a106f95e0da7ffd5cc678e71 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Sat, 23 Nov 2019 13:13:24 +0100 Subject: [PATCH 145/306] minor style fix rulebuilder --- pandora_console/include/styles/alert.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 0871853962..8952f98c46 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -141,11 +141,16 @@ div.target.flex { div#rules.show::after { content: "Drop here"; position: relative; - top: 30%; + top: 25%; display: block; - left: 38%; + left: 37%; font-size: 3em; color: #aaa; + overflow: hidden; + width: 6em; + background: #fff; + text-align: center; + z-index: 2; } div#rules.show { box-shadow: 0 0 15px -5px #424242; From 9bfe3f3152af6c5928957185e46b7fb2496954c8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Sat, 23 Nov 2019 13:16:30 +0100 Subject: [PATCH 146/306] minor style fix rulebuilder --- pandora_console/include/styles/alert.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 8952f98c46..9854ffd09e 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -127,7 +127,7 @@ div.target.flex { border: 2px dashed #ddd; margin-left: 0em; margin-top: 10px; - padding-top: 1em; + padding: 1em; } .fields, @@ -160,13 +160,16 @@ div#rules.show { display: inline-block; border-radius: 10px; padding: 5px; - padding-left: 8px; - padding-right: 8px; + font-size: 1.2em; + padding-left: 1em; + padding-right: 1em; margin: 3px; color: #fff; font-family: "lato-lighter", "Open Sans", sans-serif; font-weight: 600; background-color: #333; + word-break: break-all; + break-after: all; } .field.opacityElements { From ae5d7b89443782a35101258d9a4862b31df2ee94 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Sat, 23 Nov 2019 13:20:19 +0100 Subject: [PATCH 147/306] minor style fix rulebuilder --- pandora_console/include/styles/alert.css | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 9854ffd09e..2e6ba6d0ea 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -100,8 +100,6 @@ img.handle-alerts { .content { width: 80%; min-height: 4em; - border: 1px solid #ddd; - padding-top: 1em; padding-bottom: 1em; } ul.sample { @@ -163,13 +161,12 @@ div#rules.show { font-size: 1.2em; padding-left: 1em; padding-right: 1em; - margin: 3px; + margin: 0 0.5em 0.5em 0px; color: #fff; font-family: "lato-lighter", "Open Sans", sans-serif; font-weight: 600; background-color: #333; word-break: break-all; - break-after: all; } .field.opacityElements { From 44311c0438e0762e258dee499575eadff97c5ece Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 24 Nov 2019 00:01:07 +0100 Subject: [PATCH 148/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index df8b2ebfaa..cf84d428f6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191123 +Version: 7.0NG.741-191124 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index cdfc1fa1f4..c455bb3eee 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191123" +pandora_version="7.0NG.741-191124" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1576d2c4a1..d9b4605482 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191123'; +use constant AGENT_BUILD => '191124'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 99266db31d..442e8e00fe 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191123 +%define release 191124 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 5a158e2de9..5a7b592202 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191123 +%define release 191124 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index d3d3d068b9..3d7bc459e1 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191123" +PI_BUILD="191124" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c5d227f69d..54fa704917 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191123} +{191124} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index bad09b10b7..ccb8fc5742 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191123)") +#define PANDORA_VERSION ("7.0NG.741(Build 191124)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a83469b51f..7b54910fb7 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191123))" + VALUE "ProductVersion", "(7.0NG.741(Build 191124))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 0fadb3c407..92820f513b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191123 +Version: 7.0NG.741-191124 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index e9b84000c0..1d5ca8d00e 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191123" +pandora_version="7.0NG.741-191124" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 61c4c7c53f..1b3ba3e035 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191123'; +$build_version = 'PC191124'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b852862fef..1da8f65e18 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index bfa2f7302a..d2b0b1b5ec 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191123 +%define release 191124 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index f88b164778..7f510efbab 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191123 +%define release 191124 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7a27cab255..a5bf870331 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191123" +PI_BUILD="191124" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index c7ac49746d..1cfa3a54b1 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191123"; +my $version = "7.0NG.741 PS191124"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ba45c23582..5dd6a6617a 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191123"; +my $version = "7.0NG.741 PS191124"; # save program name for logging my $progname = basename($0); From 1592773b46bf88e6700b8d99594e078666fb02fc Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 25 Nov 2019 00:01:07 +0100 Subject: [PATCH 149/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cf84d428f6..31550518ba 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191124 +Version: 7.0NG.741-191125 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c455bb3eee..b8585d68ec 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191124" +pandora_version="7.0NG.741-191125" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d9b4605482..37a273d08e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191124'; +use constant AGENT_BUILD => '191125'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 442e8e00fe..89b69dda71 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191124 +%define release 191125 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 5a7b592202..0444cbff87 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191124 +%define release 191125 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 3d7bc459e1..044b3d1be0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191124" +PI_BUILD="191125" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 54fa704917..c0acfd3486 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191124} +{191125} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ccb8fc5742..b039dc6da0 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191124)") +#define PANDORA_VERSION ("7.0NG.741(Build 191125)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7b54910fb7..eeb912db75 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191124))" + VALUE "ProductVersion", "(7.0NG.741(Build 191125))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 92820f513b..a06e3c1937 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191124 +Version: 7.0NG.741-191125 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 1d5ca8d00e..0244e026f3 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191124" +pandora_version="7.0NG.741-191125" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1b3ba3e035..a014bcce63 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191124'; +$build_version = 'PC191125'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 1da8f65e18..6a87572085 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d2b0b1b5ec..74acddc5f2 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191124 +%define release 191125 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7f510efbab..d60b1a784a 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191124 +%define release 191125 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a5bf870331..fe9bed1a40 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191124" +PI_BUILD="191125" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1cfa3a54b1..4c6ccf05dc 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191124"; +my $version = "7.0NG.741 PS191125"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5dd6a6617a..35c7533910 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191124"; +my $version = "7.0NG.741 PS191125"; # save program name for logging my $progname = basename($0); From f24034e729233572889fddca4f3926fc842f0e61 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Mon, 25 Nov 2019 09:09:59 +0100 Subject: [PATCH 150/306] Add styles Rules --- pandora_console/include/styles/alert.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index 2e6ba6d0ea..f8d8f9c253 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -245,3 +245,16 @@ div#rules.show { padding: 10px; vertical-align: middle; } + +#rules select { + border-radius: 0px; + background-color: #424242; + border: 0px; + color: #fff; + font-family: "lato-lighter", "Open Sans", sans-serif; + font-weight: 600; +} + +#rules select:focus { + outline-color: transparent; +} From 1b57b279fb131516b5f53aa109852b2d1c331ac9 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 25 Nov 2019 13:03:55 +0100 Subject: [PATCH 151/306] minor changes --- pandora_console/include/functions_ui.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index dd1cc5443e..a4edeebda9 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1533,6 +1533,9 @@ function ui_require_javascript_file($name, $path='include/javascript/', $echo_ta /** * Add a enteprise javascript file to the HTML head tag. * + * * THIS FUNCTION COULD PRODUCE ISSUES WHILE INCLUDING JS FILES. + * * USE ui_require_javascript_file('file', ENTERPRISE_DIR.'/location') INSTEAD. + * * To make a javascript file available just put it in /include/javascript. The * file name should be like "name.js". The "name" would be the value * needed to pass to this function. From 1b4b59d1c2d0c34407746c5b60a9e6347fe8e9f7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 25 Nov 2019 13:36:43 +0100 Subject: [PATCH 152/306] Rules migration DB --- pandora_console/extras/mr/33.sql | 14 ++++++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 3f540c3b02..9034e54154 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -39,6 +39,20 @@ ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operat ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; +UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != ''; +UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != ''; +UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0; +UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != ''; +UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != ''; +UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != ''; +UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != ''; +UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99'; +UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != ''; +UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0; +UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != ''; +UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != ''; +UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != ''; + ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 69dbdecb84..58536b19de 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -599,6 +599,20 @@ ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fi ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; +UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != ''; +UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != ''; +UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0; +UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != ''; +UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != ''; +UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != ''; +UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != ''; +UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99'; +UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != ''; +UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0; +UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != ''; +UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != ''; +UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != ''; + -- ----------------------------------------------------- -- Table `tevent_alert` -- ----------------------------------------------------- From 6f8bf104b44377a7d3a0497eea00e3728042a367 Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 25 Nov 2019 13:50:26 +0100 Subject: [PATCH 153/306] update sap view --- .../operation/agentes/ver_agente.php | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index aa91a09ee6..9c8ca5748b 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1532,25 +1532,28 @@ switch ($tab) { break; } -ui_print_page_header( - agents_get_alias($id_agente), - $icon, - false, - $help_header, - false, - $onheader, - false, - '', - $config['item_title_size_text'], - '', - ui_print_breadcrums( - [ - __('Monitoring'), - __('View'), - ''.$tab_name.'', - ] - ) -); +if (!$config['pure']) { + ui_print_page_header( + agents_get_alias($id_agente), + $icon, + false, + $help_header, + false, + $onheader, + false, + '', + $config['item_title_size_text'], + '', + ui_print_breadcrums( + [ + __('Monitoring'), + __('View'), + ''.$tab_name.'', + ] + ) + ); +} + switch ($tab) { From 0490024abc0b21cab1f4f73e86524057d3e74dcd Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 25 Nov 2019 15:01:27 +0100 Subject: [PATCH 154/306] add sap view to autorefresh edit my user --- pandora_console/operation/users/user_edit.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index fcc719dfaa..7aa3c5f839 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -469,6 +469,9 @@ $autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map'; $autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console'; $autorefresh_list_out['operation/events/events'] = 'Events'; $autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = 'Cluster view'; +if (enterprise_installed()) { + $autorefresh_list_out['general/sap_view'] = 'SAP view'; +} if (!isset($autorefresh_list)) { $select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$config['id_user']."'"); From d0aab40fa8bc74112868f8e074e5eb1e626b9724 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Mon, 25 Nov 2019 16:56:59 +0100 Subject: [PATCH 155/306] Update 29.sql --- pandora_console/extras/mr/29.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql index 57db2d80c3..2bc8b9a8c9 100644 --- a/pandora_console/extras/mr/29.sql +++ b/pandora_console/extras/mr/29.sql @@ -4,7 +4,6 @@ ALTER TABLE `tmetaconsole_agent` ADD INDEX `id_tagente_idx` (`id_tagente`); DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x'; -ALTER TABLE tevent_filter ADD column id_source_event int(10); CREATE TABLE IF NOT EXISTS `tcredential_store` ( `identifier` varchar(100) NOT NULL, `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, From d89ec20c52dbaf163d0a5e0562b058082bdeacee Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 25 Nov 2019 17:24:28 +0100 Subject: [PATCH 156/306] Fixed snmp input --- .../godmode/agentes/module_manager_editor_network.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index a5763e101a..40fd28b29f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -541,14 +541,12 @@ $(document).ready (function () { $("#simple-field_snmpv3_row2").attr("style", ""); $("#simple-field_snmpv3_row3").attr("style", ""); $("input[name=active_snmp_v3]").val(1); - $("input[name=snmp_community]").attr("disabled", true); } else { $("#simple-field_snmpv3_row1").css("display", "none"); $("#simple-field_snmpv3_row2").css("display", "none"); $("#simple-field_snmpv3_row3").css("display", "none"); $("input[name=active_snmp_v3]").val(0); - $("input[name=snmp_community]").removeAttr('disabled'); } }); From 867f0cfbe9b8c9098dbce94f7dca00bb9f467c00 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Mon, 25 Nov 2019 20:06:42 +0100 Subject: [PATCH 157/306] WIP Rules alert correlation --- pandora_console/include/styles/alert.css | 10 ++++++++-- pandora_console/include/styles/pandora.css | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/alert.css b/pandora_console/include/styles/alert.css index f8d8f9c253..b466bca463 100644 --- a/pandora_console/include/styles/alert.css +++ b/pandora_console/include/styles/alert.css @@ -246,7 +246,7 @@ div#rules.show { vertical-align: middle; } -#rules select { +#rules select.click-list-elements { border-radius: 0px; background-color: #424242; border: 0px; @@ -254,7 +254,13 @@ div#rules.show { font-family: "lato-lighter", "Open Sans", sans-serif; font-weight: 600; } +#rules select.click-list-elements.fields-elements-log { + background-color: #638460; +} +#rules select.click-list-elements.fields-elements-event { + background-color: #587cff; +} -#rules select:focus { +#rules select.click-list-elements:focus { outline-color: transparent; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 866958796c..6d4deea60d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -515,6 +515,14 @@ select:-internal-list-box { .no-text-imp { font-size: 0 !important; } +.noselect { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */ +} .flex-content-right { display: flex; flex-direction: row; From b3fa4b7b7d94985ca69b9f29480eb01f48a4bce9 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 26 Nov 2019 00:01:08 +0100 Subject: [PATCH 158/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 31550518ba..ff76eb4191 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191125 +Version: 7.0NG.741-191126 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index b8585d68ec..88624df536 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191125" +pandora_version="7.0NG.741-191126" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 37a273d08e..21c63e5fd6 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191125'; +use constant AGENT_BUILD => '191126'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 89b69dda71..8075ff6a08 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191125 +%define release 191126 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0444cbff87..9726a4815f 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191125 +%define release 191126 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 044b3d1be0..c6b7d8c95f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191125" +PI_BUILD="191126" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c0acfd3486..0122162984 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191125} +{191126} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b039dc6da0..d7cfe70c92 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191125)") +#define PANDORA_VERSION ("7.0NG.741(Build 191126)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index eeb912db75..930c01cc13 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191125))" + VALUE "ProductVersion", "(7.0NG.741(Build 191126))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a06e3c1937..8bfe081748 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191125 +Version: 7.0NG.741-191126 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 0244e026f3..9b564dfa41 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191125" +pandora_version="7.0NG.741-191126" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a014bcce63..ef55347cc4 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191125'; +$build_version = 'PC191126'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 6a87572085..994b63cc4f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 74acddc5f2..739dc5b239 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191125 +%define release 191126 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index d60b1a784a..b43be82441 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191125 +%define release 191126 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index fe9bed1a40..57b7deb1af 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191125" +PI_BUILD="191126" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4c6ccf05dc..e0cf7766b8 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191125"; +my $version = "7.0NG.741 PS191126"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 35c7533910..8662538f40 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191125"; +my $version = "7.0NG.741 PS191126"; # save program name for logging my $progname = basename($0); From cf8bae66d119e83c3c40acb4b5472b3e462ce911 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 26 Nov 2019 10:31:57 +0100 Subject: [PATCH 159/306] Added index in MR --- pandora_console/extras/mr/33.sql | 3 +++ pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ pandora_console/pandoradb.sql | 2 ++ 3 files changed, 7 insertions(+) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index bfe1777e63..b3092d6423 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -50,4 +50,7 @@ INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; +ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`); +ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`); + COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 9d182b0a54..29dcdac099 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -931,6 +931,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0'; +ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`); -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -1906,6 +1907,7 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tusuario_perfil ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL default '0'; +ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`); -- --------------------------------------------------------------------- -- Table `tautoconfig` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 28bb83d287..9b9301e8e5 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3109,6 +3109,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), + KEY `server_id` (`server_id`), KEY `idx_utimestamp` USING BTREE (`utimestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Criticity: 0 - Maintance (grey) @@ -3421,6 +3422,7 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( `id_tmetaconsole_setup` int(10) NOT NULL, `id_group` mediumint(4) unsigned NOT NULL, PRIMARY KEY(`id`), + KEY `id_tagente` (`id_tagente`), FOREIGN KEY(`id_agent`) REFERENCES tmetaconsole_agent(`id_agente`) ON DELETE CASCADE, FOREIGN KEY(`id_group`) REFERENCES tgrupo(`id_grupo`) From 12230c83c9343cf0bf8aaa9ef5c67524c27d71cd Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 26 Nov 2019 11:55:41 +0100 Subject: [PATCH 160/306] Added datetime in availability graph --- pandora_console/include/graphs/flot/pandora.flot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 6387bf5442..c9d7524271 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -852,7 +852,7 @@ function pandoraFlotSlicebar( }, xaxes: [ { - show: show_date, + show: true, tickFormatter: xFormatter, color: "", tickSize: intervaltick, From d4b99a03bb7b1aa3aa1dd2a5db494b9a46480502 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Nov 2019 15:46:44 +0100 Subject: [PATCH 161/306] perl-YAML-Tiny RPM spec (agents) --- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 8075ff6a08..e7c21a73e4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: fileutils textutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk -Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) +Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny) # Required by plugins #Requires: sh-utils sed passwd net-tools rpm AutoReq: 0 diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 9726a4815f..8567fbc443 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -19,7 +19,7 @@ Prefix: /usr/share BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildArch: noarch PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd -Requires: coreutils unzip perl +Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny) AutoReq: 0 Provides: %{name}-%{version} From a4db8483d11813cf2439130a37e518b1b1931509 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Nov 2019 15:47:04 +0100 Subject: [PATCH 162/306] Discovery Applications minor fixes - SAP backend --- pandora_server/lib/PandoraFMS/Config.pm | 6 ++++++ pandora_server/lib/PandoraFMS/Recon/Base.pm | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 5b502cd82f..d22cb53edd 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -356,6 +356,9 @@ sub pandora_load_config { # Discovery SAP utils $pa_config->{"sap_utils"} = "/usr/share/pandora_server/util/recon_scripts/SAP"; + + # Discovery SAP Artica environment + $pa_config->{"sap_artica_test"} = 0; # braa for enterprise snmp server $pa_config->{"braa"} = "/usr/bin/braa"; @@ -855,6 +858,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^sap_utils\s(.*)/i) { $pa_config->{'sap_utils'}= clean_blank($1); } + elsif ($parametro =~ m/^sap_artica_test\s(.*)/i) { + $pa_config->{'sap_artica_test'}= clean_blank($1); + } elsif ($parametro =~ m/^nmap_timing_template\s+([0-9]*)/i) { $pa_config->{'nmap_timing_template'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 9b2a725ae2..0315634843 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1556,8 +1556,8 @@ sub database_scan($$$) { } return { - 'modules' => @modules, - 'data' => @data + 'modules' => \@modules, + 'data' => \@data }; } @@ -1671,14 +1671,16 @@ sub app_scan($) { } + print Dumper($results); + # Add results. if (ref($results) eq 'HASH') { if (defined($results->{'modules'})) { - push @modules, $results->{'modules'}; + push @modules, @{$results->{'modules'}}; } if (defined($results->{'data'})) { - push @data, $results->{'data'}; + push @data, @{$results->{'data'}}; } } } From 69b813390d53ba1d01f3af3273d9e4d48da5790f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Nov 2019 15:49:28 +0100 Subject: [PATCH 163/306] minor fix - removed trace --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 0315634843..fc8148cd30 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1671,8 +1671,6 @@ sub app_scan($) { } - print Dumper($results); - # Add results. if (ref($results) eq 'HASH') { if (defined($results->{'modules'})) { From d8e178683022ab291efbcee0176467f271de055b Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 26 Nov 2019 16:44:53 +0100 Subject: [PATCH 164/306] Added Save Operation Mode option in agents bulk operations --- .../godmode/massive/massive_edit_agents.php | 102 +++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 83001be810..71c8bbaabd 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -117,6 +117,14 @@ if ($update_agents) { $values['quiet'] = get_parameter('quiet_select'); } + if (get_parameter('safe_mode_change', -1) == 1 && get_parameter('safe_mode_module', '') != '') { + // Get the module name. + $values['safe_mode_module'] = get_parameter('safe_mode_module'); + } else if (get_parameter('safe_mode_change', -1) == 0) { + // Disabled Safe Operation Mode. + $values['safe_mode_module'] = '0'; + } + $fields = db_get_all_fields_in_table('tagent_custom_fields'); if ($fields === false) { @@ -134,6 +142,20 @@ if ($update_agents) { } } + // Get the id_agente_modulo to update the 'safe_operation_mode' field. + if (isset($values['safe_mode_module']) && ($values['safe_mode_module'] != '0')) { + foreach ($id_agents as $id_agent) { + $id_module_safe[$id_agent] = db_get_value_filter( + 'id_agente_modulo', + 'tagente_modulo', + [ + 'id_agente' => $id_agent, + 'nombre' => $values['safe_mode_module'], + ] + ); + } + } + // CONF FILE DELETION if (isset($values['delete_conf'])) { unset($values['delete_conf']); @@ -188,6 +210,11 @@ if ($update_agents) { } } + // Get the id_agent_module for this agent to update the 'safe_operation_mode' field. + if (isset($values['safe_mode_module']) && ($values['safe_mode_module'] != '0')) { + $values['safe_mode_module'] = $id_module_safe[$id_agent]; + } + $result = db_process_sql_update( 'tagente', $values, @@ -677,6 +704,27 @@ $table->data[6][1] = html_print_select( true ); +$table->data[7][0] = __('Safe operation mode').': '.ui_print_help_tip( + __( + 'This mode allow %s to disable all modules +of this agent while the selected module is on CRITICAL status', + get_product_name() + ), + true +); +$table->data[7][1] .= html_print_select( + [ + 1 => __('Enabled'), + 0 => __('Disabled'), + ], + 'safe_mode_change', + -1, + '', + __('No change'), + -1, + true +).' '; +$table->data[7][1] .= __('Module').' '.html_print_select('', 'safe_mode_module', '', '', __('Any'), -1, true).'
    '; ui_toggle(html_print_table($table, true), __('Advanced options')); unset($table); @@ -810,6 +858,54 @@ $(document).ready (function () { } }); + + // Enable Safe Operation Mode if 'Enabled' is selected. + $("#safe_mode_module").attr("disabled", "disabled"); + $("#safe_mode_change").on('change', function() { + if ($("#safe_mode_change").val() == 1) { + $("#safe_mode_module").removeAttr("disabled"); + refreshSafeModules(); + } + else { + $("#safe_mode_module").attr("disabled", "disabled"); + $('#safe_mode_module').empty(); + $("#safe_mode_module").append($("").attr("value", 'Any').html('Any')); + } + }); + + // Fill modules in Safe Operation Mode. + function refreshSafeModules(){ + var idAgents = Array(); + jQuery.each ($("#id_agents option:selected"), function (i, val) { + idAgents.push($(val).val()); + }); + + var params = { + "page" : "operation/agentes/ver_agente", + "get_agent_modules_json_for_multiple_agents" : 1, + "id_agent" : idAgents, + "selection_mode": "common" + }; + + jQuery.post ("ajax.php", + params, + function (data, status) { + $('#safe_mode_module').empty(); + if($.type(data) === "object"){ + jQuery.each (data, function (id, value) { + option = $("").attr("value", value).html(value); + $("#safe_mode_module").append(option); + }); + } else { + option = $("").attr("value", 'None').html('None'); + $("#safe_mode_module").append(option); + } + }, + "json" + ); + } + + $("#form_agent").submit(function() { var get_parameters_count = window.location.href.slice( window.location.href.indexOf('?') + 1).split('&').length; @@ -833,7 +929,7 @@ $(document).ready (function () { $("#id_group").trigger("change"); }); - $("#id_agents").change (function () { + $('#id_agents').on('change', function() { var idAgents = Array(); jQuery.each ($("#id_agents option:selected"), function (i, val) { idAgents.push($(val).val()); @@ -858,6 +954,10 @@ $(document).ready (function () { ); $("#form_agents").attr("style", ""); + + if($("#safe_mode_change").val() == 1) { + refreshSafeModules(); + } }); $("#id_group").change (function () { From bf22ff7a502b7a93c2f5a183fb9926ec58c7e48e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Nov 2019 17:08:18 +0100 Subject: [PATCH 165/306] minor fixes --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index fc8148cd30..056495238c 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1767,8 +1767,8 @@ sub scan($) { if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL || $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE || $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) { - # Application scan. + $self->call('message', "Scanning application ...", 6); return $self->app_scan(); } From d2fdc0cf9d567de2161d59b266b8c2cf2b36d325 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 27 Nov 2019 00:01:08 +0100 Subject: [PATCH 166/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ff76eb4191..c70ff11f92 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191126 +Version: 7.0NG.741-191127 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 88624df536..9beb6c82e2 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191126" +pandora_version="7.0NG.741-191127" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 21c63e5fd6..4b3e3798a5 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191126'; +use constant AGENT_BUILD => '191127'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e7c21a73e4..00709f13c6 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191126 +%define release 191127 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 8567fbc443..014c8e56c3 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191126 +%define release 191127 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index c6b7d8c95f..fd1890a487 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191126" +PI_BUILD="191127" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0122162984..4469057ce4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191126} +{191127} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d7cfe70c92..f1b8e2b205 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191126)") +#define PANDORA_VERSION ("7.0NG.741(Build 191127)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 930c01cc13..cc52cfb343 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191126))" + VALUE "ProductVersion", "(7.0NG.741(Build 191127))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8bfe081748..c2385b21f0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191126 +Version: 7.0NG.741-191127 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 9b564dfa41..86499e572c 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191126" +pandora_version="7.0NG.741-191127" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ef55347cc4..f648d15a85 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191126'; +$build_version = 'PC191127'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 994b63cc4f..4272cf305e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 739dc5b239..3a5fbb170b 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191126 +%define release 191127 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index b43be82441..27cf3b8c1c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191126 +%define release 191127 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 57b7deb1af..950ebf4f16 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191126" +PI_BUILD="191127" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index e0cf7766b8..6f93f2df0f 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191126"; +my $version = "7.0NG.741 PS191127"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8662538f40..bb7f537580 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191126"; +my $version = "7.0NG.741 PS191127"; # save program name for logging my $progname = basename($0); From ea2c5bc8c930e1d027e41478ca502feee8e85a23 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 27 Nov 2019 11:49:20 +0100 Subject: [PATCH 167/306] Fixed translate --- pandora_console/include/functions_agents.php | 12 ++++++------ pandora_console/include/functions_config.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index e15a0a0f97..3419fbf8da 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -3525,18 +3525,18 @@ function agents_get_sap_agents($id_agent) $sap_modules = [ 160 => __('SAP Login OK'), 109 => __('SAP Dumps'), - 111 => __('SAP List lock'), - 113 => __('SAP Cancel Jobs'), - 121 => __('SAP Batch input erroneus'), - 104 => __('SAP Idoc erroneus'), + 111 => __('SAP lock entry list'), + 113 => __('SAP canceled Jobs'), + 121 => __('SAP Batch inputs erroneous'), + 104 => __('SAP IDOC erroneous'), 105 => __('SAP IDOC OK'), 150 => __('SAP WP without active restart'), 151 => __('SAP WP stopped'), 102 => __('Average time of SAPGUI response '), 180 => __('Dialog response time'), 103 => __('Dialog Logged users '), - 192 => __('SYSFAIL, delivery attempts tRFC wrong entries number'), - 195 => __('SYSFAIL, queue qRFC INPUT, wrong entries number '), + 192 => __('TRFC in error'), + 195 => __('QRFC in error SMQ2'), 116 => __('Number of Update WPs in error'), ]; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 4ee9e682b8..429c740dfd 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -456,7 +456,7 @@ function config_update_config() } if (!config_update_value('sap_license', get_parameter('sap_license'))) { - $error_update[] = __('Deset SAP license'); + $error_update[] = __('SAP/R3 Plugin Licence'); } $inventory_changes_blacklist = get_parameter('inventory_changes_blacklist', []); From b0d5b7223e87f9abf8c5f199bac542ab3cfdb0d0 Mon Sep 17 00:00:00 2001 From: Luis Date: Wed, 27 Nov 2019 13:21:05 +0100 Subject: [PATCH 168/306] Added report template regex to MR --- pandora_console/extras/mr/33.sql | 1 + .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ pandora_console/include/functions_agents.php | 21 +++++++++++++++++++ pandora_console/pandoradb.sql | 1 + 4 files changed, 25 insertions(+) diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index 09054044a0..3a25268e6d 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -1,5 +1,6 @@ START TRANSACTION; +ALTER TABLE `treport_template` ADD COLUMN `agent_regex` varchar(600) NOT NULL default ''; ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0; INSERT INTO `ttipo_modulo` VALUES diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index ae080bbefc..e7f00559f9 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -764,6 +764,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` ( `footer` MEDIUMTEXT default NULL, `custom_font` varchar(200) default NULL, `metaconsole` tinyint(1) DEFAULT 0, + `agent_regex` varchar(600) NOT NULL default '', + PRIMARY KEY(`id_report`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 3419fbf8da..732bee643e 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -3509,6 +3509,27 @@ function agents_get_status_animation($up=true) } +function agents_get_agent_id_by_alias_regex($alias_regex, $flag='i', $limit=0) +{ + $agents_id = []; + $all_agents = agents_get_agents(false, ['id_agente', 'alias']); + $agent_match = '/'.$alias_regex.'/'.$flag; + + foreach ($all_agents as $agent) { + $result_agent_match = preg_match($agent_match, $agent['alias']); + if ($result_agent_match) { + $agents_id[] = $agent['id_agente']; + $i++; + if ($i === $limit) { + break; + } + } + } + + return $agents_id; +} + + /** * Return if an agent is SAP or or an a agent SAP list. * If function receive false, you will return all SAP agents, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 312eb937ec..1a163d7699 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2952,6 +2952,7 @@ CREATE TABLE IF NOT EXISTS `treport_template` ( `footer` MEDIUMTEXT default NULL, `custom_font` varchar(200) default NULL, `metaconsole` tinyint(1) DEFAULT 0, + `agent_regex` varchar(600) BINARY NOT NULL default '', PRIMARY KEY(`id_report`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; From a799b22a5c0916b9181a25156cbf44c846c679e4 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 27 Nov 2019 14:06:52 +0100 Subject: [PATCH 169/306] Fixed bug in network tools --- pandora_console/extensions/net_tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index ba66cae68e..3896a10155 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -312,7 +312,7 @@ function main_net_tools() $ips = db_get_all_rows_sql( sprintf( 'SELECT ip FROM taddress WHERE id_a IN (%s)', - join($ids) + join(',', $ids) ) ); From e6afe84940f4f639ead2066def5c7e8a9cdc7401 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 27 Nov 2019 15:22:39 +0100 Subject: [PATCH 170/306] Fixed pdf --- pandora_console/include/class/Diagnostics.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index ee61ec743d..179cf6ffd1 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -2092,9 +2092,9 @@ class Diagnostics extends Wizard * * @param string|null $filename Filename. * - * @return void + * @return mixed */ - public function exportPDF(?string $filename=null):void + public function exportPDF(?string $filename=null) { global $config; @@ -2141,7 +2141,7 @@ class Diagnostics extends Wizard // Write html filename. $mpdf->writePDFfile($filename); - exit; + return; } From ec6d317bd45cd46bed0de1a61cb63c5d2b7255e1 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 28 Nov 2019 00:01:09 +0100 Subject: [PATCH 171/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c70ff11f92..4ec519cade 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191127 +Version: 7.0NG.741-191128 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 9beb6c82e2..171c835a59 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191127" +pandora_version="7.0NG.741-191128" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 4b3e3798a5..a5274dd014 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191127'; +use constant AGENT_BUILD => '191128'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 00709f13c6..cd718d806d 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191127 +%define release 191128 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 014c8e56c3..724fe6fbc7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191127 +%define release 191128 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index fd1890a487..de7be0c1b6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191127" +PI_BUILD="191128" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4469057ce4..cdb1daa086 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191127} +{191128} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f1b8e2b205..da7f9892be 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191127)") +#define PANDORA_VERSION ("7.0NG.741(Build 191128)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index cc52cfb343..f1cd333d90 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191127))" + VALUE "ProductVersion", "(7.0NG.741(Build 191128))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c2385b21f0..a98736f458 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191127 +Version: 7.0NG.741-191128 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 86499e572c..ed57ff1015 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191127" +pandora_version="7.0NG.741-191128" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f648d15a85..00ed9e9093 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191127'; +$build_version = 'PC191128'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4272cf305e..af9466509f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 3a5fbb170b..988311f919 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191127 +%define release 191128 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 27cf3b8c1c..2a9676531d 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191127 +%define release 191128 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 950ebf4f16..4a025f7e7a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191127" +PI_BUILD="191128" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6f93f2df0f..177e655997 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191127"; +my $version = "7.0NG.741 PS191128"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index bb7f537580..c6624705d4 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191127"; +my $version = "7.0NG.741 PS191128"; # save program name for logging my $progname = basename($0); From 0420a439d1fe8abfa47eae7e30346f83b87a5d93 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 28 Nov 2019 11:51:32 +0100 Subject: [PATCH 172/306] Send params to copy and delete action alert by post --- .../godmode/alerts/alert_actions.php | 132 +++++++++--------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index b0a88eeec0..793156457d 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -32,19 +32,6 @@ if (! check_acl($config['id_user'], 0, 'LM')) { exit; } -if (is_ajax()) { - $get_alert_action = (bool) get_parameter('get_alert_action'); - if ($get_alert_action) { - $id = (int) get_parameter('id'); - $action = alerts_get_alert_action($id); - $action['command'] = alerts_get_alert_action_alert_command($action['id']); - - echo json_encode($action); - } - - return; -} - $update_action = (bool) get_parameter('update_action'); $create_action = (bool) get_parameter('create_action'); $delete_action = (bool) get_parameter('delete_action'); @@ -57,15 +44,22 @@ if (defined('METACONSOLE')) { $sec = 'galertas'; } -if ((!$copy_action) && (!$delete_action)) { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_action', true); - } -} +// Header. +if (defined('METACONSOLE')) { + alerts_meta_print_header(); +} else { + $header_help = 'alerts_action'; + if ($copy_action) { + $header_help = 'alerts_config'; + } + + if ($delete_action) { + $header_help = 'alerts_action'; + } + + ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, $header_help, true); +} if ($copy_action) { $id = get_parameter('id'); @@ -83,13 +77,6 @@ if ($copy_action) { ); include 'general/noaccess.php'; exit; - } else { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true); - } } } //end if else { @@ -102,14 +89,7 @@ if ($copy_action) { $is_in_group = in_array($al_action['id_group'], $own_groups); // Then action group have to be in his own groups - if ($is_in_group) { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true); - } - } else { + if (!$is_in_group) { db_pandora_audit( 'ACL Violation', 'Trying to access Alert Management' @@ -118,13 +98,6 @@ if ($copy_action) { exit; } } - } else { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true); - } } $result = alerts_clone_alert_action($id); @@ -162,13 +135,6 @@ if ($delete_action) { ); include 'general/noaccess.php'; exit; - } else { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true); - } } // If user tries to delete an action of others groups @@ -182,14 +148,7 @@ if ($delete_action) { $is_in_group = in_array($al_action['id_group'], $own_groups); // Then action group have to be in his own groups - if ($is_in_group) { - // Header - if (defined('METACONSOLE')) { - alerts_meta_print_header(); - } else { - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true); - } - } else { + if (!$is_in_group) { db_pandora_audit( 'ACL Violation', 'Trying to access Alert Management' @@ -198,9 +157,6 @@ if ($delete_action) { exit; } } - } else { - // Header - ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, '', true); } @@ -285,10 +241,14 @@ foreach ($actions as $action) { 2 => 'action_buttons', 3 => 'action_buttons', ]; - $data[2] = ''.html_print_image('images/copy.png', true).''; - $data[3] = ''.html_print_image('images/cross.png', true).''; + + $id_action = $action['id']; + $text_confirm = __('Are you sure?'); + + $data[2] = ''.html_print_image('images/copy.png', true).''; + $data[3] = ''.html_print_image('images/cross.png', true).''; } array_push($table->data, $data); @@ -308,3 +268,45 @@ echo ''; echo '
    '; enterprise_hook('close_meta_frame'); +?> + + + From 14999b7b843187e233e3c869f96c43422e1ed9d6 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 29 Nov 2019 00:01:08 +0100 Subject: [PATCH 173/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4ec519cade..3821dc4ece 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191128 +Version: 7.0NG.741-191129 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 171c835a59..faf85cf044 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191128" +pandora_version="7.0NG.741-191129" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a5274dd014..3c797fd264 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191128'; +use constant AGENT_BUILD => '191129'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index cd718d806d..5511134b4d 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191128 +%define release 191129 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 724fe6fbc7..4eb9ce53c7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191128 +%define release 191129 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index de7be0c1b6..4bed142778 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191128" +PI_BUILD="191129" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cdb1daa086..fd06dc626f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191128} +{191129} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index da7f9892be..97b058ea8a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191128)") +#define PANDORA_VERSION ("7.0NG.741(Build 191129)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f1cd333d90..3247a4bb14 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191128))" + VALUE "ProductVersion", "(7.0NG.741(Build 191129))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a98736f458..2f65216ec6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191128 +Version: 7.0NG.741-191129 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ed57ff1015..4a87305b6b 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191128" +pandora_version="7.0NG.741-191129" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 00ed9e9093..2f36d28b38 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191128'; +$build_version = 'PC191129'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index af9466509f..8cef99197b 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 988311f919..71cdcbad1a 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191128 +%define release 191129 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 2a9676531d..3cf817cc07 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191128 +%define release 191129 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 4a025f7e7a..1a432c52cf 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191128" +PI_BUILD="191129" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 177e655997..47a486f334 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191128"; +my $version = "7.0NG.741 PS191129"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c6624705d4..098a3a564f 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191128"; +my $version = "7.0NG.741 PS191129"; # save program name for logging my $progname = basename($0); From a6f881c6fad68d3a18feb88cf9d5a48de237e6bd Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 30 Nov 2019 00:01:08 +0100 Subject: [PATCH 174/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 3821dc4ece..92298d5808 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191129 +Version: 7.0NG.741-191130 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index faf85cf044..ba72aecfa7 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191129" +pandora_version="7.0NG.741-191130" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 3c797fd264..c7a6eee20e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191129'; +use constant AGENT_BUILD => '191130'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 5511134b4d..afe490bde5 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191129 +%define release 191130 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4eb9ce53c7..0efd012296 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191129 +%define release 191130 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 4bed142778..b67a1e367f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191129" +PI_BUILD="191130" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index fd06dc626f..1bb2c51e63 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191129} +{191130} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 97b058ea8a..a5d5e48310 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191129)") +#define PANDORA_VERSION ("7.0NG.741(Build 191130)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3247a4bb14..5d387667e5 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191129))" + VALUE "ProductVersion", "(7.0NG.741(Build 191130))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2f65216ec6..992fef5a5b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191129 +Version: 7.0NG.741-191130 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 4a87305b6b..93f72c9d70 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191129" +pandora_version="7.0NG.741-191130" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2f36d28b38..cb86e88af5 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191129'; +$build_version = 'PC191130'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 8cef99197b..0636e9c0ee 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 71cdcbad1a..9fda6d6a22 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191129 +%define release 191130 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3cf817cc07..04251746b3 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191129 +%define release 191130 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1a432c52cf..04c07e4c39 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191129" +PI_BUILD="191130" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 47a486f334..463bc89f2e 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191129"; +my $version = "7.0NG.741 PS191130"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 098a3a564f..2af69d7e83 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191129"; +my $version = "7.0NG.741 PS191130"; # save program name for logging my $progname = basename($0); From 882198798a4ac6d6ad27b6b8d65a243da1e94bed Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 1 Dec 2019 00:01:06 +0100 Subject: [PATCH 175/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 92298d5808..8d910d1ea0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191130 +Version: 7.0NG.741-191201 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index ba72aecfa7..5381715f2e 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191130" +pandora_version="7.0NG.741-191201" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c7a6eee20e..b5e25e0c5b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191130'; +use constant AGENT_BUILD => '191201'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index afe490bde5..969793b62e 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191130 +%define release 191201 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0efd012296..42a830e3a7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191130 +%define release 191201 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index b67a1e367f..833da08101 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191130" +PI_BUILD="191201" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1bb2c51e63..026c3a6ae4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191130} +{191201} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a5d5e48310..44d809fc49 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191130)") +#define PANDORA_VERSION ("7.0NG.741(Build 191201)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5d387667e5..bcb12702a8 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191130))" + VALUE "ProductVersion", "(7.0NG.741(Build 191201))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 992fef5a5b..8b00027d35 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191130 +Version: 7.0NG.741-191201 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 93f72c9d70..ad3c7a9993 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191130" +pandora_version="7.0NG.741-191201" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index cb86e88af5..e9b9f09b58 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191130'; +$build_version = 'PC191201'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0636e9c0ee..168440b8e1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 9fda6d6a22..53c5be4624 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191130 +%define release 191201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 04251746b3..3d0f59dad9 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191130 +%define release 191201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 04c07e4c39..b54c121b81 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191130" +PI_BUILD="191201" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 463bc89f2e..c2b7bf28dd 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191130"; +my $version = "7.0NG.741 PS191201"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2af69d7e83..9a39bd005c 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191130"; +my $version = "7.0NG.741 PS191201"; # save program name for logging my $progname = basename($0); From 80d5eea467f6480882b3343a0b9723e8449d521c Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 2 Dec 2019 00:01:08 +0100 Subject: [PATCH 176/306] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8d910d1ea0..27c930a07e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.741-191201 +Version: 7.0NG.741-191202 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 5381715f2e..615abbf4b1 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191201" +pandora_version="7.0NG.741-191202" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index b5e25e0c5b..1c67a8d80d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.741'; -use constant AGENT_BUILD => '191201'; +use constant AGENT_BUILD => '191202'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 969793b62e..91acb64b0c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191201 +%define release 191202 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 42a830e3a7..b870959d19 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.741 -%define release 191201 +%define release 191202 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 833da08101..d6d18be440 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191201" +PI_BUILD="191202" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 026c3a6ae4..148ffae35c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191201} +{191202} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 44d809fc49..db1095ee19 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.741(Build 191201)") +#define PANDORA_VERSION ("7.0NG.741(Build 191202)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bcb12702a8..db5e5e28f1 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.741(Build 191201))" + VALUE "ProductVersion", "(7.0NG.741(Build 191202))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8b00027d35..52d922722b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.741-191201 +Version: 7.0NG.741-191202 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ad3c7a9993..bbcb9ac2f1 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.741-191201" +pandora_version="7.0NG.741-191202" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e9b9f09b58..40b996dd0e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191201'; +$build_version = 'PC191202'; $pandora_version = 'v7.0NG.741'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 168440b8e1..a0b44a9dae 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 53c5be4624..23e21f88c0 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191201 +%define release 191202 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3d0f59dad9..73c13a62fe 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.741 -%define release 191201 +%define release 191202 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b54c121b81..530274ffa7 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.741" -PI_BUILD="191201" +PI_BUILD="191202" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index c2b7bf28dd..3d11ff98eb 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.741 PS191201"; +my $version = "7.0NG.741 PS191202"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9a39bd005c..8315a4b8d0 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.741 PS191201"; +my $version = "7.0NG.741 PS191202"; # save program name for logging my $progname = basename($0); From 68832409315a1bda3050dc18aead95520297de6f Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 2 Dec 2019 11:54:39 +0100 Subject: [PATCH 177/306] Added control for int values --- pandora_console/include/functions_config.php | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 4ee9e682b8..ce1ef90898 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1403,19 +1403,35 @@ function config_update_config() $error_update[] = __('Database password'); } - if (!config_update_value('history_db_days', get_parameter('history_db_days'))) { + $history_db_days = get_parameter('history_db_days'); + if (!is_numeric($history_db_days) + || $history_db_days <= 0 + || !config_update_value('history_db_days', $history_db_days) + ) { $error_update[] = __('Days'); } - if (!config_update_value('history_event_days', get_parameter('history_event_days'))) { + $history_event_days = get_parameter('history_event_days'); + if (!is_numeric($history_event_days) + || $history_event_days <= 0 + || !config_update_value('history_event_days', $history_event_days) + ) { $error_update[] = __('Event Days'); } - if (!config_update_value('history_db_step', get_parameter('history_db_step'))) { + $history_db_step = get_parameter('history_db_step'); + if (!is_numeric($history_db_step) + || $history_db_step <= 0 + || !config_update_value('history_db_step', $history_db_step) + ) { $error_update[] = __('Step'); } - if (!config_update_value('history_db_delay', get_parameter('history_db_delay'))) { + $history_db_delay = get_parameter('history_db_delay'); + if (!is_numeric($history_db_delay) + || $history_db_delay <= 0 + || !config_update_value('history_db_delay', $history_db_delay) + ) { $error_update[] = __('Delay'); } break; From 2d629550204f65bed065fb7c62aee48560285c81 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 2 Dec 2019 16:11:17 +0100 Subject: [PATCH 178/306] Changed filters styles in netflow live view --- .../operation/netflow/nf_live_view.php | 130 ++++++++---------- 1 file changed, 58 insertions(+), 72 deletions(-) diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index a9f742d779..ff942ddc3c 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -373,93 +373,80 @@ if (is_metaconsole()) { echo "
    '; echo ''; - echo ''; - echo ''; - echo ''; + $advanced_toggle = '
    '.__('Sort').'
    ".html_print_select_groups( true ).'
    ".__('Agents').'".__('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true).'".__('Modules').'
    ".html_print_select_groups($config['id_user'], 'IW', $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false).'
    '; - html_print_image( - 'images/darrowdown.png', - false, - [ - 'onclick' => 'toggleFilters(event)', - 'style' => 'cursor: pointer;', - 'id' => 'nf-toggle-button', - ] - ); - echo __('Advanced'); - echo '
    '; - echo ''; + $advanced_toggle .= ''; if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } - echo ''; + $advanced_toggle .= ''; $user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true); $user_groups[0] = 0; // Add all groups. $sql = 'SELECT * FROM tnetflow_filter WHERE id_group IN ('.implode(',', array_keys($user_groups)).')'; - echo "'; - echo ''; + $advanced_toggle .= "'; + $advanced_toggle .= ''; - echo ""; + $advanced_toggle .= ""; if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo "'; - echo ''; + $advanced_toggle .= "'; + $advanced_toggle .= ''; } if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo "'; - echo ''; + $advanced_toggle .= "'; + $advanced_toggle .= ''; } - echo ''; + $advanced_toggle .= ''; - echo ""; + $advanced_toggle .= ""; if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo "'; - echo ''; + $advanced_toggle .= "'; + $advanced_toggle .= ''; } if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo "'; - echo ''; + $advanced_toggle .= "'; + $advanced_toggle .= ''; } - echo ''; + $advanced_toggle .= ''; - echo ""; + $advanced_toggle .= ""; if ($netflow_disable_custom_lvfilters) { - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; } else { - echo ''; - echo "'; + $advanced_toggle .= ''; + $advanced_toggle .= "'; } - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; $onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;"; $radio_buttons = __('Yes').'  '.html_print_radio_button_extended( @@ -479,14 +466,28 @@ if (is_metaconsole()) { $address_resolution, true ); - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; - echo ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= ''; - echo ''; + $advanced_toggle .= ''; + $advanced_toggle .= '
    '.__('Filter').''.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).''.__('Filter').''.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).''.__('Load filter').''.__('Load filter').'".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true); - html_print_input_hidden('filter_selected', $filter_selected, false); - echo '
    ".html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true); + $advanced_toggle .= html_print_input_hidden('filter_selected', $filter_selected, false); + $advanced_toggle .= '
    ".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:
    25.46.157.214,160.253.135.249'), true).'
    '.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:
    25.46.157.214,160.253.135.249'), true).'
    '.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).'".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:
    25.46.157.214,160.253.135.249'), true).'
    '.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:
    25.46.157.214,160.253.135.249'), true).'
    '.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).'
    ".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
    80,22'), true).'
    '.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
    80,22'), true).'
    '.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).'".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
    80,22'), true).'
    '.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:
    80,22'), true).'
    '.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).'
    '.__('IP address resolution').''.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).''.$radio_buttons.''.__('IP address resolution').''.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true).''.$radio_buttons.''.__('Source ip').''.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).''.__('Source ip').''.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'
    '; + + echo ''; + echo ui_toggle( + $advanced_toggle, + __('Advanced'), + '', + '', + true, + true, + 'white_box white_box_opened', + 'no-border flex-row' + ); + echo ''; echo ''; echo "'; $single_table .= ''; $single_table .= '
    "; @@ -601,21 +602,6 @@ if (is_metaconsole()) { return true; }; - function toggleFilters (event) { - // Display or show the items. - var is_advanced = $("#radiobtn0001").is(':checked'); - var class_name = is_advanced ? ".filter_advance" : ".filter_normal"; - $(".nf_filter").not(class_name).toggle(); - - // Change the image. - $('#' + event.target.id).attr( - 'src', - $(".nf_filter").not(class_name).first().is(':visible') - ? 'images/darrowup.png' - : 'images/darrowdown.png' - ); - } - // Display the appropriate filter var filter_type = ; if (filter_type == 0) { @@ -768,7 +754,7 @@ if (is_metaconsole()) { } \ No newline at end of file From d7288114ad150a382544d16c7cf8a6a609b0b644 Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 2 Dec 2019 18:17:54 +0100 Subject: [PATCH 179/306] fixed minnor error --- .../agentes/agent_wizard.wmi_explorer.php | 428 +++++++++++++----- 1 file changed, 310 insertions(+), 118 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php index 47a5cc5a35..5d889178bb 100644 --- a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php @@ -1,16 +1,18 @@ $row) { - // First and second rows are Class and column names, ignore it + // First and second rows are Class and column names, ignore it. if ($index < 2) { continue; } @@ -81,60 +89,74 @@ if ($wmiexplore) { $row_exploded = explode('|', $row); if (!in_array($row_exploded[$processes_name_field], $processes)) { - $processes[$row_exploded[$processes_name_field]] = $row_exploded[$processes_name_field]; + if (preg_match('/ERROR/', $row_exploded[$processes_name_field])) { + $processes[$row_exploded[$prouycesses_name_field]] = __('None'); + } else { + $processes[$row_exploded[$prouycesses_name_field]] = $row_exploded[$processes_name_field]; + } } } unset($output); - // Services + // Services. $wmi_services = $wmi_command.' "select Name from Win32_Service"'; $services_name_field = 0; $services_check_field = 1; - if (enterprise_installed()) { - if ($server_to_exec != 0) { - $server_data = db_get_row('tserver', 'id_server', $server_to_exec); - exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_services."'", $output, $rc); - } else { - exec($wmi_services, $output); - } + if (enterprise_installed() && (int) $server_to_exec != 0) { + $server_data = db_get_row( + 'tserver', + 'id_server', + $server_to_exec + ); + exec( + 'ssh pandora_exec_proxy@'.$server_data['ip_address']." + '".$wmi_services."'", + $output, + $rc + ); } else { exec($wmi_services, $output); } foreach ($output as $index => $row) { - // First and second rows are Class and column names, ignore it + // First and second rows are Class and column names, ignore it. if ($index < 2) { continue; } - $row_exploded = explode('|', $row); + $row_exploded = explode('|', $row); if (!in_array($row_exploded[$services_name_field], $services)) { - $services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field]; + if (preg_match('/ERROR/', $row_exploded[$services_name_field])) { + $services[$row_exploded[$services_name_field]] = __('None'); + } else { + $services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field]; + } } } unset($output); - // Disks + // Disks. $wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"'; $disks_name_field = 0; - if (enterprise_installed()) { - if ($server_to_exec != 0) { - $server_data = db_get_row('tserver', 'id_server', $server_to_exec); - exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_disks."'", $output, $rc); - } else { - exec($wmi_disks, $output); - } + if (enterprise_installed() && (int) $server_to_exec != 0) { + $server_data = db_get_row('tserver', 'id_server', $server_to_exec); + exec( + 'ssh pandora_exec_proxy@'.$server_data['ip_address']." + '".$wmi_disks."'", + $output, + $rc + ); } else { exec($wmi_disks, $output); } foreach ($output as $index => $row) { - // First and second rows are Class and column names, ignore it + // First and second rows are Class and column names, ignore it. if ($index < 2) { continue; } @@ -142,14 +164,21 @@ if ($wmiexplore) { $row_exploded = explode('|', $row); if (!in_array($row_exploded[$disks_name_field], $services)) { - $disk_string = sprintf(__('Free space on %s'), $row_exploded[$disks_name_field]); - $disks[$row_exploded[$disks_name_field]] = $disk_string; + if (preg_match('/ERROR/', $row_exploded[$disks_name_field])) { + $disks[$row_exploded[$disks_name_field]] = __('None'); + } else { + $disk_string = sprintf( + __('Free space on %s'), + $row_exploded[$disks_name_field] + ); + $disks[$row_exploded[$disks_name_field]] = $disk_string; + } } } unset($output); - // WMI Components + // WMI Components. $network_component_groups = network_components_get_groups(MODULE_WMI); } } @@ -163,14 +192,14 @@ if ($create_modules) { $components = []; foreach ($modules as $module) { - // Split module data to get type + // Split module data to get type. $module_exploded = explode('_', $module); $type = $module_exploded[0]; - // Delete type from module data + // Delete type from module data. unset($module_exploded[0]); - // Rebuild module data + // Rebuild module data. $module = implode('_', $module_exploded); switch ($type) { @@ -189,10 +218,14 @@ if ($create_modules) { case 'component': $components[] = $module; break; + + default: + // Default. + break; } } - // Common values for WMI modules + // Common values for WMI modules. $values = [ 'ip_target' => $ip_target, 'tcp_send' => $tcp_send, @@ -202,7 +235,10 @@ if ($create_modules) { ]; if ($server_to_exec != 0) { - $sql = sprintf('SELECT server_type FROM tserver WHERE id_server = %d', $server_to_exec); + $sql = sprintf( + 'SELECT server_type FROM tserver WHERE id_server = %d', + $server_to_exec + ); $row = db_get_row_sql($sql); if ($row['server_type'] == 13) { @@ -210,89 +246,146 @@ if ($create_modules) { } } - // Create Service modules + // Create Service modules. $services_values = $values; $services_values['snmp_community'] = 'Running'; - // Key string + // Key string. $services_values['tcp_port'] = 1; - // Field number (Running/Stopped) + // Field number (Running/Stopped). $services_values['id_tipo_modulo'] = 2; - // Generic boolean - $services_result = wmi_create_wizard_modules($id_agent, $services, 'services', $services_values, 0, 0, $server_to_exec); + // Generic boolean. + $services_result = wmi_create_wizard_modules( + $id_agent, + $services, + 'services', + $services_values, + 0, + 0, + $server_to_exec + ); - // Create Process modules + // Create Process modules. $processes_values = $values; $processes_values['tcp_port'] = 0; - // Field number (OID) + // Field number (OID). $processes_values['id_tipo_modulo'] = 2; - // Generic boolean - $processes_result = wmi_create_wizard_modules($id_agent, $processes, 'processes', $processes_values, 0, 0, $server_to_exec); + // Generic boolean. + $processes_result = wmi_create_wizard_modules( + $id_agent, + $processes, + 'processes', + $processes_values, + 0, + 0, + $server_to_exec + ); - // Create Space on disk modules + // Create Space on disk modules. $disks_values = $values; $disks_values['tcp_port'] = 1; - // Free space in bytes + // Free space in bytes. $disks_values['id_tipo_modulo'] = 1; - // Generic numeric + // Generic numeric. $disks_values['unit'] = 'Bytes'; - // Unit - $disks_result = wmi_create_wizard_modules($id_agent, $disks, 'disks', $disks_values, 0, 0, $server_to_exec); + // Unit. + $disks_result = wmi_create_wizard_modules( + $id_agent, + $disks, + 'disks', + $disks_values, + 0, + 0, + $server_to_exec + ); - // Create modules from component + // Create modules from component. $components_values = $values; $components_values['id_agente'] = $id_agent; - $components_result = wmi_create_module_from_components($components, $components_values, 0, 0, $server_to_exec); + $components_result = wmi_create_module_from_components( + $components, + $components_values, + 0, + 0, + $server_to_exec + ); - // Errors/Success messages + // Errors/Success messages. $success_message = ''; $error_message = ''; if (!empty($services_result)) { if (count($services_result[NOERR]) > 0) { - $success_message .= sprintf(__('%s service modules created succesfully'), count($services_result[NOERR])).'
    '; + $success_message .= sprintf( + __('%s service modules created succesfully'), + count($services_result[NOERR]) + ).'
    '; } if (count($services_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf(__('Error creating %s service modules'), count($services_result[ERR_GENERIC])).'
    '; + $error_message .= sprintf( + __('Error creating %s service modules'), + count($services_result[ERR_GENERIC]) + ).'
    '; } } if (!empty($processes_result)) { if (count($processes_result[NOERR]) > 0) { - $success_message .= sprintf(__('%s process modules created succesfully'), count($processes_result[NOERR])).'
    '; + $success_message .= sprintf( + __('%s process modules created succesfully'), + count($processes_result[NOERR]) + ).'
    '; } if (count($processes_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf(__('Error creating %s process modules'), count($processes_result[ERR_GENERIC])).'
    '; + $error_message .= sprintf( + __('Error creating %s process modules'), + count($processes_result[ERR_GENERIC]) + ).'
    '; } } if (!empty($disks_result)) { if (count($disks_result[NOERR]) > 0) { - $success_message .= sprintf(__('%s disk space modules created succesfully'), count($disks_result[NOERR])).'
    '; + $success_message .= sprintf( + __('%s disk space modules created succesfully'), + count($disks_result[NOERR]) + ).'
    '; } if (count($disks_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf(__('Error creating %s disk space modules'), count($disks_result[ERR_GENERIC])).'
    '; + $error_message .= sprintf( + __('Error creating %s disk space modules'), + count($disks_result[ERR_GENERIC]) + ).'
    '; } } if (!empty($components_result)) { if (count($components_result[NOERR]) > 0) { - $success_message .= sprintf(__('%s modules created from components succesfully'), count($components_result[NOERR])).'
    '; + $success_message .= sprintf( + __('%s modules created from components succesfully'), + count($components_result[NOERR]) + ).'
    '; } if (count($components_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf(__('Error creating %s modules from components'), count($components_result[ERR_GENERIC])).'
    '; + $error_message .= sprintf( + __('Error creating %s modules from components'), + count($components_result[ERR_GENERIC]) + ).'
    '; } if (count($components_result[ERR_EXIST]) > 0) { - $error_message .= sprintf(__('%s modules already exist'), count($components_result[ERR_EXIST])).'
    '; + $error_message .= sprintf( + __('%s modules already exist'), + count($components_result[ERR_EXIST]) + ).'
    '; } } @@ -306,7 +399,9 @@ if ($create_modules) { } echo ''; -echo "
    "; +echo ""; $table->width = '100%'; $table->cellpadding = 0; @@ -314,18 +409,47 @@ $table->cellspacing = 0; $table->class = 'databox filters'; $table->data[0][0] = ''.__('Target IP').''; -$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); +$table->data[0][1] = html_print_input_text( + 'ip_target', + $ip_target, + '', + 15, + 60, + true +); $table->data[0][2] = ''.__('Namespace').''; -$table->data[0][3] = html_print_input_text('tcp_send', $tcp_send, '', 15, 60, true); +$table->data[0][3] = html_print_input_text( + 'tcp_send', + $tcp_send, + '', + 15, + 60, + true +); $table->data[1][0] = ''.__('Username').''; -$table->data[1][1] = html_print_input_text('plugin_user', $plugin_user, '', 15, 60, true); +$table->data[1][1] = html_print_input_text( + 'plugin_user', + $plugin_user, + '', + 15, + 60, + true +); $table->data[1][2] = ''.__('Password').''; -$table->data[1][3] = html_print_input_password('plugin_pass', $plugin_pass, '', 15, 60, true); +$table->data[1][3] = html_print_input_password( + 'plugin_pass', + $plugin_pass, + '', + 15, + 60, + true +); -$table->data[1][3] .= ''; +$table->data[1][3] .= ''; html_print_input_hidden('wmiexplore', 1); $servers_to_exec = []; @@ -346,13 +470,27 @@ if (enterprise_installed()) { } $table->data[2][0] = ''.__('Server to execute command').''; -$table->data[2][1] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true); +$table->data[2][1] = html_print_select( + $servers_to_exec, + 'server_to_exec', + $server_to_exec, + '', + '', + '', + true +); html_print_table($table); echo "
    "; -echo ''; -html_print_submit_button(__('WMI Explore'), 'wmi_explore', false, ['class' => 'sub next']); +echo ''; +html_print_submit_button( + __('WMI Explore'), + 'wmi_explore', + false, + ['class' => 'sub next'] +); echo '

    '; if ($wmiexplore && $fail) { @@ -365,23 +503,25 @@ echo '
    '; if ($wmiexplore && !$fail) { echo '
    '; - echo "
    "; + echo ""; echo ''; html_print_input_hidden('create_modules', 1); html_print_input_hidden('ip_target', $ip_target); - // Host + // Host. html_print_input_hidden('plugin_user', $plugin_user); - // User + // User. html_print_input_hidden('plugin_pass', $plugin_pass); - // Password + // Password. html_print_input_hidden('tcp_send', $tcp_send); - // Namespace + // Namespace. html_print_input_hidden('server_to_exec', $server_to_exec); $table->width = '100%'; - // Mode selector + // Mode selector. $modes = []; $modes['services'] = __('Services'); $modes['processes'] = __('Processes'); @@ -406,7 +546,7 @@ if ($wmiexplore && !$fail) { $table->data[1][2] = ''.__('Modules').''; $table->cellstyle[1][2] = 'text-align: center;'; - // Components list + // Components list. $table->data[2][0] = '
    '; $table->data[2][0] .= __('Filter by group').'
    '; $table->data[2][0] .= html_print_select( @@ -439,7 +579,7 @@ if ($wmiexplore && !$fail) { ); $table->data[2][0] .= '
    '; - // Services list + // Services list. $table->data[2][0] .= '
    '; $table->data[2][0] .= html_print_select( $services, @@ -456,8 +596,7 @@ if ($wmiexplore && !$fail) { 'width: 300px;' ); $table->data[2][0] .= '
    '; - - // Processes list + // Processes list. $table->data[2][0] .= '
    '; $table->data[2][0] .= html_print_select( $processes, @@ -474,11 +613,13 @@ if ($wmiexplore && !$fail) { 'width: 300px;' ); $table->data[2][0] .= '
    '; - $table->data[2][0] .= '
    '; From 35ca0bc247fee53f0b7b4e8789322d4dc41c792e Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 3 Dec 2019 13:05:33 +0100 Subject: [PATCH 182/306] Possible solution to avoid issues with JS and apostrophe of other languages strings --- pandora_console/include/functions_io.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_io.php b/pandora_console/include/functions_io.php index baddb18531..f0e2037cf2 100755 --- a/pandora_console/include/functions_io.php +++ b/pandora_console/include/functions_io.php @@ -455,7 +455,7 @@ function __($string /*, variable arguments */) return $string; } - return $l10n->translate($string); + return str_replace('\'', '`', $l10n->translate($string)); } $args = func_get_args(); @@ -465,7 +465,7 @@ function __($string /*, variable arguments */) return vsprintf($string, $args); } - return vsprintf($l10n->translate($string), $args); + return vsprintf(str_replace('\'', '`', $l10n->translate($string)), $args); } From 22cd129f7109922e4be2275a4f7f4a560b2a20a7 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 3 Dec 2019 13:58:14 +0100 Subject: [PATCH 183/306] Fixed netflow command injection vulnerability --- pandora_console/include/functions_netflow.php | 173 +++++++++--------- 1 file changed, 86 insertions(+), 87 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index f1febb5c41..9aa8a25d49 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -890,7 +890,7 @@ function netflow_get_command($filter) } // Filter options. - $command .= netflow_get_filter_arguments($filter); + $command .= ' '.netflow_get_filter_arguments($filter); return $command; } @@ -909,114 +909,113 @@ function netflow_get_filter_arguments($filter) $filter_args = ''; if ($filter['advanced_filter'] != '') { $filter_args = preg_replace('/["\r\n]/', '', io_safe_output($filter['advanced_filter'])); - return ' "('.$filter_args.')"'; - } + } else { + if ($filter['router_ip'] != '') { + $filter_args .= ' (router ip '.$filter['router_ip'].')'; + } - if ($filter['router_ip'] != '') { - $filter_args .= ' "(router ip '.$filter['router_ip'].')'; - } + // Normal filter. + if ($filter['ip_dst'] != '') { + $filter_args .= ' ('; + $val_ipdst = explode(',', io_safe_output($filter['ip_dst'])); + for ($i = 0; $i < count($val_ipdst); $i++) { + if ($i > 0) { + $filter_args .= ' or '; + } - // Normal filter. - if ($filter['ip_dst'] != '') { - $filter_args .= ' "('; - $val_ipdst = explode(',', io_safe_output($filter['ip_dst'])); - for ($i = 0; $i < count($val_ipdst); $i++) { - if ($i > 0) { - $filter_args .= ' or '; + if (netflow_is_net($val_ipdst[$i]) == 0) { + $filter_args .= 'dst ip '.$val_ipdst[$i]; + } else { + $filter_args .= 'dst net '.$val_ipdst[$i]; + } } - if (netflow_is_net($val_ipdst[$i]) == 0) { - $filter_args .= 'dst ip '.$val_ipdst[$i]; + $filter_args .= ')'; + } + + if ($filter['ip_src'] != '') { + if ($filter_args == '') { + $filter_args .= ' ('; } else { - $filter_args .= 'dst net '.$val_ipdst[$i]; - } - } - - $filter_args .= ')'; - } - - if ($filter['ip_src'] != '') { - if ($filter_args == '') { - $filter_args .= ' "('; - } else { - $filter_args .= ' and ('; - } - - $val_ipsrc = explode(',', io_safe_output($filter['ip_src'])); - for ($i = 0; $i < count($val_ipsrc); $i++) { - if ($i > 0) { - $filter_args .= ' or '; + $filter_args .= ' and ('; } - if (netflow_is_net($val_ipsrc[$i]) == 0) { - $filter_args .= 'src ip '.$val_ipsrc[$i]; + $val_ipsrc = explode(',', io_safe_output($filter['ip_src'])); + for ($i = 0; $i < count($val_ipsrc); $i++) { + if ($i > 0) { + $filter_args .= ' or '; + } + + if (netflow_is_net($val_ipsrc[$i]) == 0) { + $filter_args .= 'src ip '.$val_ipsrc[$i]; + } else { + $filter_args .= 'src net '.$val_ipsrc[$i]; + } + } + + $filter_args .= ')'; + } + + if ($filter['dst_port'] != '') { + if ($filter_args == '') { + $filter_args .= ' ('; } else { - $filter_args .= 'src net '.$val_ipsrc[$i]; - } - } - - $filter_args .= ')'; - } - - if ($filter['dst_port'] != '') { - if ($filter_args == '') { - $filter_args .= ' "('; - } else { - $filter_args .= ' and ('; - } - - $val_dstport = explode(',', io_safe_output($filter['dst_port'])); - for ($i = 0; $i < count($val_dstport); $i++) { - if ($i > 0) { - $filter_args .= ' or '; + $filter_args .= ' and ('; } - $filter_args .= 'dst port '.$val_dstport[$i]; - } + $val_dstport = explode(',', io_safe_output($filter['dst_port'])); + for ($i = 0; $i < count($val_dstport); $i++) { + if ($i > 0) { + $filter_args .= ' or '; + } - $filter_args .= ')'; - } - - if ($filter['src_port'] != '') { - if ($filter_args == '') { - $filter_args .= ' "('; - } else { - $filter_args .= ' and ('; - } - - $val_srcport = explode(',', io_safe_output($filter['src_port'])); - for ($i = 0; $i < count($val_srcport); $i++) { - if ($i > 0) { - $filter_args .= ' or '; + $filter_args .= 'dst port '.$val_dstport[$i]; } - $filter_args .= 'src port '.$val_srcport[$i]; + $filter_args .= ')'; } - $filter_args .= ')'; - } - - if (isset($filter['proto']) && $filter['proto'] != '') { - if ($filter_args == '') { - $filter_args .= ' "('; - } else { - $filter_args .= ' and ('; - } - - $val_proto = explode(',', io_safe_output($filter['proto'])); - for ($i = 0; $i < count($val_proto); $i++) { - if ($i > 0) { - $filter_args .= ' or '; + if ($filter['src_port'] != '') { + if ($filter_args == '') { + $filter_args .= ' ('; + } else { + $filter_args .= ' and ('; } - $filter_args .= 'proto '.$val_proto[$i]; + $val_srcport = explode(',', io_safe_output($filter['src_port'])); + for ($i = 0; $i < count($val_srcport); $i++) { + if ($i > 0) { + $filter_args .= ' or '; + } + + $filter_args .= 'src port '.$val_srcport[$i]; + } + + $filter_args .= ')'; } - $filter_args .= ')'; + if (isset($filter['proto']) && $filter['proto'] != '') { + if ($filter_args == '') { + $filter_args .= ' ('; + } else { + $filter_args .= ' and ('; + } + + $val_proto = explode(',', io_safe_output($filter['proto'])); + for ($i = 0; $i < count($val_proto); $i++) { + if ($i > 0) { + $filter_args .= ' or '; + } + + $filter_args .= 'proto '.$val_proto[$i]; + } + + $filter_args .= ')'; + } } if ($filter_args != '') { - $filter_args .= '"'; + $filter_args = escapeshellarg($filter_args); } return $filter_args; From d4720c2260d7c1918b818b42f8c558e3a6364149 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 3 Dec 2019 13:59:03 +0100 Subject: [PATCH 184/306] add firts changes --- pandora_console/general/header.php | 18 +- .../include/ajax/order_interpreter.php | 62 +++++++ .../include/class/OrderInterpreter.class.php | 157 ++++++++++++++++++ .../include/styles/order_interpreter.css | 29 ++++ 4 files changed, 264 insertions(+), 2 deletions(-) create mode 100644 pandora_console/include/ajax/order_interpreter.php create mode 100644 pandora_console/include/class/OrderInterpreter.class.php create mode 100644 pandora_console/include/styles/order_interpreter.css diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 368accd39b..b36785329c 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -13,6 +13,8 @@ require_once 'include/functions_messages.php'; require_once 'include/functions_servers.php'; require_once 'include/functions_notifications.php'; +require_once 'include/ajax/order_interpreter.php'; +ui_require_css_file('order_interpreter'); // Check permissions // Global errors/warnings checking. @@ -120,8 +122,13 @@ if ($config['menu_type'] == 'classic') { } $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" - onkeyup="javascript: fieldKeyWordEmpty = false;" class="search_input" />'; + onkeyup="showinterpreter()" class="search_input" />'; + $search_bar .= ''; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; $search_bar .= ""; $search_bar .= ''; @@ -630,7 +637,14 @@ if ($config['menu_type'] == 'classic') { var fixed_header = ; var new_chat = ; - + + function showinterpreter(){ + if( $('#keywords').val() === ''){ + $('#result_order').hide(); + }else { + $('#result_order').show(); + } + } /** * Loads modal from AJAX to add feedback. */ diff --git a/pandora_console/include/ajax/order_interpreter.php b/pandora_console/include/ajax/order_interpreter.php new file mode 100644 index 0000000000..5edc8913f3 --- /dev/null +++ b/pandora_console/include/ajax/order_interpreter.php @@ -0,0 +1,62 @@ +ajaxMethod($method) === true) { + $order_interpreter->{$method}(); + } else { + $order_interpreter->error('Unavailable method.'); + } +} else { + $order_interpreter->error('Method not found. ['.$method.']'); +} + + +// Stop any execution. +exit; diff --git a/pandora_console/include/class/OrderInterpreter.class.php b/pandora_console/include/class/OrderInterpreter.class.php new file mode 100644 index 0000000000..92474d617e --- /dev/null +++ b/pandora_console/include/class/OrderInterpreter.class.php @@ -0,0 +1,157 @@ + $msg] + ); + } + + + /** + * Checks if target method is available to be called using AJAX. + * + * @param string $method Target method. + * + * @return boolean True allowed, false not. + */ + public function ajaxMethod($method) + { + global $config; + + // Check access. + check_login(); + + return in_array($method, $this->AJAXMethods); + } + + + /** + * Constructor. + * + * @param boolean $must_run Must run or not. + * @param string $ajax_controller Controller. + * + * @return object + * @throws Exception On error. + */ + public function __construct( + $ajax_controller='include/ajax/order_interpreter' + ) { + $this->ajaxController = $ajax_controller; + $this->pages_name = [ + 0 => __('Agent view'), + 1 => __('Agent Management'), + 2 => __('Manage Agents'), + 3 => __('Manage Policies'), + ]; + $this->pages_url = [ + 0 => ui_get_full_url(), + 1 => ui_get_full_url(), + 2 => ui_get_full_url(), + 3 => ui_get_full_url(), + ]; + + } + + + /** + * Method to print order interpreted on header search input. + * + * @return void + */ + public function getResult() + { + // Take value from input search. + $text = get_parameter('text', ''); + + foreach ($this->pages_name as $key => $value) { + if (preg_match('/'.$text.'/', $value)) { + echo 'pene gordo'; + } + } + + return; + + } + + + /** + * Load JS content. + * function that enables the functions to the buttons when its action is + * completed. + * Assign the url of each button. + * + * @return string HTML code for javascript functionality. + */ + public function loadJS() + { + ob_start(); + ?> + + Date: Tue, 3 Dec 2019 14:26:31 +0100 Subject: [PATCH 185/306] resolv blank page --- pandora_console/include/ajax/order_interpreter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/order_interpreter.php b/pandora_console/include/ajax/order_interpreter.php index 5edc8913f3..8e4cc557b4 100644 --- a/pandora_console/include/ajax/order_interpreter.php +++ b/pandora_console/include/ajax/order_interpreter.php @@ -30,8 +30,9 @@ global $config; require_once $config['homedir'].'/include/class/OrderInterpreter.class.php'; + if (is_ajax() === false) { - exit; + return; } $ajaxPage = 'include/ajax/order_interpreter'; From 14b8379ccb84f660def22c5950499367ad8795f9 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 3 Dec 2019 15:11:16 +0100 Subject: [PATCH 186/306] ajax call, controller, class, match result, return array inputs(example to return) --- pandora_console/general/header.php | 16 ++++++++++++++++ .../include/class/OrderInterpreter.class.php | 12 ++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index b36785329c..ee741e62f2 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -642,6 +642,22 @@ if ($config['menu_type'] == 'classic') { if( $('#keywords').val() === ''){ $('#result_order').hide(); }else { + $.ajax({ + type: "POST", + url: "ajax.php", + dataType: "text", + data: { + page: 'include/ajax/order_interpreter', + method: 'getResult', + text: $('#keywords').val(), + }, + success: function (data) { + console.log(data); + }, + error: function (data) { + console.error("Fatal error in AJAX call to interpreter order", data) + } + }); $('#result_order').show(); } } diff --git a/pandora_console/include/class/OrderInterpreter.class.php b/pandora_console/include/class/OrderInterpreter.class.php index 92474d617e..bf253bebd8 100644 --- a/pandora_console/include/class/OrderInterpreter.class.php +++ b/pandora_console/include/class/OrderInterpreter.class.php @@ -117,20 +117,20 @@ class OrderInterpreter extends Wizard /** * Method to print order interpreted on header search input. * - * @return void + * @return array */ - public function getResult() + public function getResult():array { // Take value from input search. $text = get_parameter('text', ''); - + $array_found = []; foreach ($this->pages_name as $key => $value) { - if (preg_match('/'.$text.'/', $value)) { - echo 'pene gordo'; + if (preg_match('/.*'.$text.'.*/', $value)) { + $array_found[$key] = ''.$value.''; } } - return; + return $array_found; } From 810fe8f8605df44b1b5250925aeab6bd460d3b75 Mon Sep 17 00:00:00 2001 From: vgilc Date: Tue, 3 Dec 2019 15:59:08 +0100 Subject: [PATCH 187/306] Revert "Merge branch 'ent-4968-Comandos-de-alerta-con-saltos-de-linea' into 'develop'" This reverts merge request !2886 --- pandora_console/godmode/alerts/alert_commands.php | 2 +- pandora_console/godmode/alerts/configure_alert_action.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index caa47e3d02..7fa2b9a3f0 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -56,7 +56,7 @@ if (is_ajax()) { // If is setted a description, we change the carriage return by
    tags if (isset($command['description'])) { - $command['description'] = str_replace("\r\n", '
    ', io_safe_output($command['description'])); + $command['description'] = io_safe_input(str_replace("\r\n", '
    ', io_safe_output($command['description']))); } // Descriptions are stored in json. diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 21380d6738..8ea292445b 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -295,7 +295,7 @@ $(document).ready (function () { var origicommand_descriptionnal_command; if () { - original_command = "', addslashes(io_safe_output(alerts_get_alert_command_command($id_command)))); ?>"; + original_command = ""; render_command_preview(original_command); command_description = "', addslashes(io_safe_output(alerts_get_alert_command_description($id_command)))); ?>"; From 7eec91b9460a673c77be8fcc70773e6a9d387715 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 3 Dec 2019 18:19:32 +0100 Subject: [PATCH 188/306] Show result in normal window --- pandora_console/general/header.php | 14 +++---- .../include/class/OrderInterpreter.class.php | 30 ++++++++++----- .../include/styles/order_interpreter.css | 37 +++++-------------- 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index ee741e62f2..47696d8226 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -124,11 +124,8 @@ if ($config['menu_type'] == 'classic') { $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" onkeyup="showinterpreter()" class="search_input" />'; - $search_bar .= ''; + + $search_bar .= '
    '; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; $search_bar .= ""; $search_bar .= ''; @@ -629,7 +626,7 @@ if ($config['menu_type'] == 'classic') { }); } - // Resize event + // Resize event. window.addEventListener("resize", function() { attatch_to_image(); }); @@ -645,7 +642,7 @@ if ($config['menu_type'] == 'classic') { $.ajax({ type: "POST", url: "ajax.php", - dataType: "text", + dataType: "html", data: { page: 'include/ajax/order_interpreter', method: 'getResult', @@ -653,7 +650,8 @@ if ($config['menu_type'] == 'classic') { }, success: function (data) { console.log(data); - }, + $('#result_order').html(data); + }, error: function (data) { console.error("Fatal error in AJAX call to interpreter order", data) } diff --git a/pandora_console/include/class/OrderInterpreter.class.php b/pandora_console/include/class/OrderInterpreter.class.php index bf253bebd8..0e30df76ad 100644 --- a/pandora_console/include/class/OrderInterpreter.class.php +++ b/pandora_console/include/class/OrderInterpreter.class.php @@ -99,16 +99,24 @@ class OrderInterpreter extends Wizard ) { $this->ajaxController = $ajax_controller; $this->pages_name = [ - 0 => __('Agent view'), + 0 => __('Tactical View'), 1 => __('Agent Management'), - 2 => __('Manage Agents'), + 2 => __('List Alerts'), 3 => __('Manage Policies'), ]; $this->pages_url = [ - 0 => ui_get_full_url(), - 1 => ui_get_full_url(), - 2 => ui_get_full_url(), - 3 => ui_get_full_url(), + 0 => ui_get_full_url( + 'index.php?sec=view&sec2=operation/agentes/tactical' + ), + 1 => ui_get_full_url( + 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente' + ), + 2 => ui_get_full_url( + 'index.php?sec=galertas&sec2=godmode/alerts/alert_list' + ), + 3 => ui_get_full_url( + 'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies' + ), ]; } @@ -119,18 +127,22 @@ class OrderInterpreter extends Wizard * * @return array */ - public function getResult():array + public function getResult() { // Take value from input search. $text = get_parameter('text', ''); $array_found = []; + echo '
    '; + echo '
      '; foreach ($this->pages_name as $key => $value) { if (preg_match('/.*'.$text.'.*/', $value)) { - $array_found[$key] = ''.$value.''; + echo '
    • '; + echo ''; + echo 'GO TO '.$value.'
      '; } } - return $array_found; + echo '
    Date: Tue, 3 Dec 2019 18:31:13 +0100 Subject: [PATCH 189/306] update css and preg_match --- .../include/class/OrderInterpreter.class.php | 22 ++++++++++--------- .../include/styles/order_interpreter.css | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/class/OrderInterpreter.class.php b/pandora_console/include/class/OrderInterpreter.class.php index 0e30df76ad..0f673e25f6 100644 --- a/pandora_console/include/class/OrderInterpreter.class.php +++ b/pandora_console/include/class/OrderInterpreter.class.php @@ -125,24 +125,26 @@ class OrderInterpreter extends Wizard /** * Method to print order interpreted on header search input. * - * @return array + * @return void */ public function getResult() { // Take value from input search. $text = get_parameter('text', ''); $array_found = []; - echo '
    '; - echo '