From d44df2ea6b2650262737f53daaf3e0d0e88c0f2d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 27 Jul 2023 13:21:57 +0200 Subject: [PATCH 01/85] #11326 added top n agents with worst score --- .../reporting_builder.item_editor.php | 11 +++++++++- .../godmode/reporting/reporting_builder.php | 12 ++++++++++ .../include/functions_reporting.php | 7 ++++++ .../include/functions_reporting_html.php | 22 +++++++++++++++++++ pandora_console/include/functions_reports.php | 7 ++++++ 5 files changed, 58 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 397e533366..3eb6bc6d1c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1019,6 +1019,11 @@ switch ($action) { $idAgent = $item['id_agent']; break; + case 'top_n_agents_sh': + $group = $item['id_group']; + $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; + break; + default: // It's not possible. break; @@ -7411,7 +7416,11 @@ function chooseType() { case 'ncm': $("#row_agent").show(); break; - + + case 'top_n_agents_sh': + $("#row_group").show(); + $("#row_max_items").show(); + break; } switch (type) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 00bc80f234..242ee1156c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1987,6 +1987,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_agents_sh': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2863,6 +2869,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_agents_sh': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c01e44157a..d92b4ea38e 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -935,6 +935,13 @@ function reporting_make_reporting_data( ); break; + case 'top_n_agents_sh': + $report['contents'][] = reporting_top_n_agents_sh( + $report, + $content + ); + break; + default: // Default. break; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 91d8a9e5a5..ca36af48b8 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -463,6 +463,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) case 'ncm': reporting_html_ncm_config($table, $item); break; + + case 'top_n_agents_sh': + reporting_html_top_n_agents_sh($table, $item); + break; } if ($item['type'] == 'agent_module') { @@ -478,6 +482,24 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +function reporting_html_top_n_agents_sh($table, $item) +{ + global $config; + + $table->data[1][0] = ''.__('Agent').''; + $table->data[1][1] = ''.__('Last audit scan').''; + $table->data[1][2] = ''.__('Score').''; + + $row = 2; + foreach ($item['data'] as $key => $agent) { + $table->data[$row][0] = $agent['alias']; + $table->data[$row][1] = date($config['date_format'], $agent['utimestamp']); + $table->data[$row][2] = $agent['datos'].' %'; + $row++; + } +} + + /** * Function to print to HTML SLA report. * diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index f13e935b6a..5b2c00229f 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -963,6 +963,13 @@ function reports_get_report_types($template=false, $not_editor=false) 'name' => __('Network configuration changes'), ]; + if (enterprise_installed() === true) { + $types['top_n_agents_sh'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('Top-N agents with the worst score'), + ]; + } + return $types; } From a0fdb2a791dbcef9f8023965211680b506d3c209 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 28 Jul 2023 12:11:36 +0200 Subject: [PATCH 02/85] #11326 new report vulnerabilities --- pandora_console/extras/mr/66.sql | 5 ++ .../reporting_builder.item_editor.php | 35 ++++++++ .../godmode/reporting/reporting_builder.php | 12 +++ .../include/functions_reporting.php | 7 ++ .../include/functions_reporting_html.php | 12 +++ pandora_console/include/functions_reports.php | 5 ++ pandora_console/include/graphs/fgraph.php | 11 +++ .../phpchartjs/src/Options/Elements.php | 26 ++++++ .../src/Options/Elements/Center.php | 85 +++++++++++++++++++ 9 files changed, 198 insertions(+) create mode 100644 pandora_console/extras/mr/66.sql create mode 100644 pandora_console/vendor/artica/phpchartjs/src/Options/Elements/Center.php diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql new file mode 100644 index 0000000000..c563508f1a --- /dev/null +++ b/pandora_console/extras/mr/66.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL DEFAULT 0; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 3eb6bc6d1c..cc3fee9a2c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -200,6 +200,14 @@ $text_agent_module = ''; $only_data = false; +$categories_security_hardening = []; +if (security_hardening_installed() === true) { + $categories_security_hardening = categories_of_cis(); + foreach ($categories_security_hardening as $key => $cat) { + $categories_security_hardening[$key] = implode(' ', $cat); + } +} + // Users. $id_users = []; $users_groups = []; @@ -1024,6 +1032,11 @@ switch ($action) { $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; break; + case 'vul_by_cat': + $group = $item['id_group']; + $cat_selected = $item['cat_security_hardening']; + break; + default: // It's not possible. break; @@ -3690,6 +3703,22 @@ $class = 'databox filters'; ?> + + + + + + + + @@ -6562,6 +6591,7 @@ function chooseType() { $("#row_group_by").hide(); $("#row_type_show").hide(); $("#row_use_prefix_notation").hide(); + $("#row_cat_security_hardening").hide(); // SLA list default state. $("#sla_list").hide(); @@ -7421,6 +7451,11 @@ function chooseType() { $("#row_group").show(); $("#row_max_items").show(); break; + + case 'vul_by_cat': + $("#row_group").show(); + $("#row_cat_security_hardening").show(); + break; } switch (type) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 242ee1156c..697561a59f 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1993,6 +1993,12 @@ switch ($action) { $good_format = true; break; + case 'vul_by_cat': + $values['id_group'] = get_parameter('combo_group'); + $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2875,6 +2881,12 @@ switch ($action) { $good_format = true; break; + case 'vul_by_cat': + $values['id_group'] = get_parameter('combo_group'); + $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index d92b4ea38e..6561fe9389 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -942,6 +942,13 @@ function reporting_make_reporting_data( ); break; + case 'vul_by_cat': + $report['contents'][] = reporting_vul_by_categories( + $report, + $content + ); + break; + default: // Default. break; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index ca36af48b8..bf144cd518 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -467,6 +467,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) case 'top_n_agents_sh': reporting_html_top_n_agents_sh($table, $item); break; + + case 'vul_by_cat': + reporting_vul_by_cat_graph($table, $item); + break; } if ($item['type'] == 'agent_module') { @@ -482,6 +486,14 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +function reporting_vul_by_cat_graph($table, $item) +{ + $table->colspan['chart']['cell'] = 3; + $table->cellstyle['chart']['cell'] = 'text-align: center;'; + $table->data['chart']['cell'] = $item['chart']; +} + + function reporting_html_top_n_agents_sh($table, $item) { global $config; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 5b2c00229f..fca253153e 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -968,6 +968,11 @@ function reports_get_report_types($template=false, $not_editor=false) 'optgroup' => __('Security hardening'), 'name' => __('Top-N agents with the worst score'), ]; + + $types['vul_by_cat'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('Vulnerabilities by category'), + ]; } return $types; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 7da82a2ba8..40466decb5 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -691,6 +691,17 @@ function get_build_setup_charts($type, $options, $data) } $chart->options()->setMaintainAspectRatio($maintainAspectRatio); + if (isset($options['elements']) === true) { + if (isset($options['elements']['center']) === true) { + if (isset($options['elements']['center']['text']) === true) { + $chart->options()->getElements()->center()->setText($options['elements']['center']['text']); + } + + if (isset($options['elements']['center']['color']) === true) { + $chart->options()->getElements()->center()->setColor($options['elements']['center']['color']); + } + } + } // Set Responsive for responsive charts. $responsive = true; diff --git a/pandora_console/vendor/artica/phpchartjs/src/Options/Elements.php b/pandora_console/vendor/artica/phpchartjs/src/Options/Elements.php index 116fc46758..b63513bc23 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Options/Elements.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Options/Elements.php @@ -8,6 +8,7 @@ use Artica\PHPChartJS\Options\Elements\Arc; use Artica\PHPChartJS\Options\Elements\Line; use Artica\PHPChartJS\Options\Elements\Point; use Artica\PHPChartJS\Options\Elements\Rectangle; +use Artica\PHPChartJS\Options\Elements\Center; use JsonSerializable; /** @@ -39,6 +40,11 @@ class Elements implements ArraySerializableInterface, JsonSerializable */ private $arc; + /** + * @var Center + */ + private $center; + /** * @return Rectangle */ @@ -119,6 +125,26 @@ class Elements implements ArraySerializableInterface, JsonSerializable return $this->arc; } + /** + * @return Center + */ + public function center() + { + if (is_null($this->center)) { + $this->center = new Center(); + } + + return $this->center; + } + + /** + * @return Center + */ + public function getCenter() + { + return $this->center; + } + /** * @return array */ diff --git a/pandora_console/vendor/artica/phpchartjs/src/Options/Elements/Center.php b/pandora_console/vendor/artica/phpchartjs/src/Options/Elements/Center.php new file mode 100644 index 0000000000..d8b35b4e89 --- /dev/null +++ b/pandora_console/vendor/artica/phpchartjs/src/Options/Elements/Center.php @@ -0,0 +1,85 @@ +text; + } + + /** + * Set text center graph. + * + * @param string $text Text center graph. + * + * @return self + */ + public function setText(string $text) + { + $this->text = $text; + + return $this; + } + + /** + * Get color text. + * + * @return string + */ + public function getColor() + { + return $this->color; + } + + /** + * Set color text. + * + * @param string $color Color text. + * + * @return self + */ + public function setColor(string $color) + { + $this->color = $color; + + return $this; + } + + /** + * @return array + */ + public function jsonSerialize() + { + return $this->getArrayCopy(); + } +} From c92899573f9a0998ef0de4a70ae712c1699412a6 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 28 Jul 2023 12:12:29 +0200 Subject: [PATCH 03/85] #11326 new field in treport_content for reports --- pandora_console/pandoradb.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 87f6283152..dcb3e41220 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1641,6 +1641,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `macros_definition` TEXT, `render_definition` TEXT, `use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1, + `cat_security_hardening` INT NOT NULL DEFAULT 0, PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE From bc66f71e14e42f1204452d6faf28e0bc8807c13b Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 7 Aug 2023 12:42:05 +0200 Subject: [PATCH 04/85] #11807 added report vul_by_cat --- pandora_console/extras/mr/66.sql | 2 ++ .../reporting_builder.item_editor.php | 24 +++++++++++++++++++ pandora_console/pandoradb.sql | 1 + 3 files changed, 27 insertions(+) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index c563508f1a..291f25e2a3 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -2,4 +2,6 @@ START TRANSACTION; ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL DEFAULT 0; +ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0; + COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index cc3fee9a2c..ea1db7aac8 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1029,12 +1029,15 @@ switch ($action) { case 'top_n_agents_sh': $group = $item['id_group']; + $recursion = $item['recursion']; $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; break; case 'vul_by_cat': $group = $item['id_group']; + $recursion = $item['recursion']; $cat_selected = $item['cat_security_hardening']; + $ignore_skipped = ($item['ignore_skipped'] !== null) ? $item['ignore_skipped'] : true; break; default: @@ -3703,6 +3706,24 @@ $class = 'databox filters'; ?> + + + + + + + + + + + @@ -6592,6 +6614,7 @@ function chooseType() { $("#row_type_show").hide(); $("#row_use_prefix_notation").hide(); $("#row_cat_security_hardening").hide(); + $("#row_ignore_skipped").hide(); // SLA list default state. $("#sla_list").hide(); @@ -7455,6 +7478,7 @@ function chooseType() { case 'vul_by_cat': $("#row_group").show(); $("#row_cat_security_hardening").show(); + $("#row_ignore_skipped").show(); break; } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index d9d5a9f1cd..8b5ed12e91 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1657,6 +1657,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `render_definition` TEXT, `use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1, `cat_security_hardening` INT NOT NULL DEFAULT 0, + `ignore_skipped` INT NOT NULL DEFAULT 0, PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE From 3429e0d190bbdb38123b55bb2fe6d6ec65b65de7 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 7 Aug 2023 14:43:50 +0200 Subject: [PATCH 05/85] #10065 Added the option to create-edit a private event filter. --- pandora_console/extras/mr/66.sql | 5 ++++ .../godmode/events/event_edit_filter.php | 30 +++++++++++++++++-- .../godmode/events/event_filter.php | 12 ++++++++ pandora_console/include/ajax/events.php | 25 ++++++++++++++-- pandora_console/include/functions_events.php | 17 +++++++++-- pandora_console/operation/events/events.php | 24 +++++++++++++++ 6 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 pandora_console/extras/mr/66.sql diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql new file mode 100644 index 0000000000..cffa3707c1 --- /dev/null +++ b/pandora_console/extras/mr/66.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE tevent_filter ADD private_filter_user text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL; + +COMMIT; diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index e230055f1e..aaf5d00b9b 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -61,6 +61,9 @@ if ($id) { $filter = events_get_event_filter($id); $id_group_filter = $filter['id_group_filter']; $id_group = $filter['id_group']; + // Get owner user private filter. + $private_filter = ($filter['private_filter_user'] === null || $filter['private_filter_user'] === '') ? 0 : 1; + $private_filter_user = $filter['private_filter_user']; $id_name = $filter['id_name']; $event_type = $filter['event_type']; $severity = explode(',', $filter['severity']); @@ -113,6 +116,7 @@ if ($id) { $server_id = ($filter['server_id'] ?? ''); } else { $id_group = ''; + $private_filter = 0; $id_group_filter = ''; $id_name = ''; $event_type = ''; @@ -167,8 +171,8 @@ if ($update || $create) { $id_user_ack = get_parameter('id_user_ack', ''); $owner_user = get_parameter('owner_user', ''); $group_rep = get_parameter('group_rep', ''); - $date_from = get_parameter('date_from', ''); - $date_to = get_parameter('date_to', ''); + $date_from = get_parameter('date_from', '0000-00-00'); + $date_to = get_parameter('date_to', '0000-00-00'); $source = get_parameter('source'); $id_extra = get_parameter('id_extra'); $user_comment = get_parameter('user_comment'); @@ -192,6 +196,16 @@ if ($update || $create) { $server_id = implode(',', $servers_array); } + // Get private filter from user. + $private_filter = get_parameter_switch('private_filter_event', 0); + if ((int) $private_filter === 1 && $create) { + $private_filter_user = $_SESSION['id_usuario']; + } else if ((int) $private_filter === 1 && $update) { + $private_filter_user = ($private_filter_user === $_SESSION['id_usuario']) ? $private_filter_user : $_SESSION['id_usuario']; + } else if ((int) $private_filter === 0) { + $private_filter_user = null; + } + $values = [ 'id_name' => $id_name, 'id_group_filter' => $id_group_filter, @@ -222,6 +236,7 @@ if ($update || $create) { 'custom_data' => $custom_data, 'custom_data_filter_type' => $custom_data_filter_type, 'server_id' => $server_id, + 'private_filter_user' => $private_filter_user, ]; $severity = explode(',', $severity); @@ -293,6 +308,17 @@ $table->data[0][0] = html_print_label_input_block( false, '', 'w100p' + ).html_print_label_input_block( + __('Private event'), + html_print_checkbox_switch( + 'private_filter_event', + $private_filter, + $private_filter, + true, + false, + 'checked_slide_events(this);', + true + ) ) ); diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 533bfe1190..0be93fa4a4 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -133,6 +133,18 @@ $filters = db_get_all_rows_sql($sql); if ($filters === false) { $filters = []; +} else { + foreach ($filters as $key => $filter) { + $permission = check_acl($config['id_user'], 0, 'PM'); + // Validate permission and private filter user. + if ($permission || $filter['private_filter_user'] === $config['id_user']) { + if ($filter['private_filter_user'] !== null) { + $filters[$key]['id_name'] = $filter['id_name'].' (P)'; + } + } else if ($filter['private_filter_user'] !== null) { + unset($filters[$key]); + } + } } $table = new stdClass(); diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 571955fd25..b3a6be0670 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -337,6 +337,14 @@ if ($save_event_filter) { $values['custom_data'] = get_parameter('custom_data'); $values['custom_data_filter_type'] = get_parameter('custom_data_filter_type'); + // Get private filter from user. + $private_filter = get_parameter_switch('private_filter_user', 0); + if ((int) $private_filter === 1) { + $values['private_filter_user'] = $config['id_user']; + } else { + $values['private_filter_user'] = null; + } + if (is_metaconsole() === true) { $values['server_id'] = implode(',', get_parameter('server_id')); } @@ -397,6 +405,17 @@ if ($update_event_filter) { $values['custom_data'] = get_parameter('custom_data'); $values['custom_data_filter_type'] = get_parameter('custom_data_filter_type'); + // Get private filter from user. + $private_filter = get_parameter('private_filter_user', 0); + $user_private_filter = events_get_event_filter($id); + if ((int) $private_filter === 1 && $user_private_filter['private_filter_user'] === null) { + $values['private_filter_user'] = $config['id_user']; + } else if ($private_filter === $user_private_filter['private_filter_user'] && $user_private_filter['private_filter_user'] !== $config['id_user']) { + $values['private_filter_user'] = $user_private_filter['private_filter_user']; + } else { + $values['private_filter_user'] = null; + } + if (is_metaconsole() === true) { $values['server_id'] = implode(',', get_parameter('server_id')); } @@ -936,7 +955,8 @@ function save_new_filter() { "id_source_event": $("#text-id_source_event").val(), "server_id": $("#server_id").val(), "custom_data": $("#text-custom_data").val(), - "custom_data_filter_type": $("#custom_data_filter_type").val() + "custom_data_filter_type": $("#custom_data_filter_type").val(), + "private_filter_user": $("#checkbox-private_filter_event").val() }, function (data) { $("#info_box").hide(); @@ -1015,7 +1035,8 @@ function save_update_filter() { "id_source_event": $("#text-id_source_event").val(), "server_id": $("#server_id").val(), "custom_data": $("#text-custom_data").val(), - "custom_data_filter_type": $("#custom_data_filter_type").val() + "custom_data_filter_type": $("#custom_data_filter_type").val(), + "private_filter_user": $("#checkbox-private_filter_event").val() }, function (data) { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 49007aaca1..516f01d876 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3343,7 +3343,7 @@ function events_get_event_filter_select($manage=true) } $sql = ' - SELECT id_filter, id_name + SELECT id_filter, id_name, private_filter_user FROM tevent_filter WHERE id_group_filter IN (0, '.implode(',', array_keys($user_groups)).')'; @@ -3354,7 +3354,20 @@ function events_get_event_filter_select($manage=true) } else { $result = []; foreach ($event_filters as $event_filter) { - $result[$event_filter['id_filter']] = $event_filter['id_name']; + $permission = check_acl($config['id_user'], 0, 'PM'); + if ($permission || $event_filter['private_filter_user'] === $config['id_user']) { + if ($event_filter['private_filter_user'] !== null) { + $filter_name = $event_filter['id_name'].' (P)'; + } else { + $filter_name = $event_filter['id_name']; + } + + $result[$event_filter['id_filter']] = $filter_name; + } + + if ($event_filter['private_filter_user'] === null) { + $result[$event_filter['id_filter']] = $event_filter['id_name']; + } } } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 0152fea782..fd5ab1a46c 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -196,6 +196,10 @@ $search_recursive_groups = get_parameter( 'filter[search_recursive_groups]', ($filter['search_recursive_groups'] ?? '') ); +$search_recursive_groups = get_parameter( + 'filter[private_filter_event]', + ($filter['private_filter_event'] ?? '') +); $id_group_filter = get_parameter( 'filter[id_group_filter]', ($filter['id_group'] ?? '') @@ -1322,6 +1326,7 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false $filter_only_alert = $filter['filter_only_alert']; $search_secondary_groups = ($filter['search_secondary_groups'] ?? 0); + $private_filter_event = ($filter['private_filter_user'] ?? 0); $search_recursive_groups = ($filter['search_recursive_groups'] ?? 0); $id_group_filter = $filter['id_group_filter']; $date_from = $filter['date_from']; @@ -1938,6 +1943,25 @@ $in_sec_group .= ''; $in_sec_group .= ''; $in .= $in_sec_group; +// User private filter. +$data = html_print_checkbox_switch( + 'private_filter_event', + $private_filter_event, + $private_filter_event, + true, + false, + 'checked_slide_events(this);', + true +); + +$in_third_group = '
'; +$in_third_group .= $data; +$in_third_group .= ''; +$in_third_group .= '
'; +$in .= $in_third_group; + $in .= ''; $inputs[] = $in; From 74f2fa7a74549521cdb9faed1d3ac0f149648f51 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 9 Aug 2023 15:35:03 +0200 Subject: [PATCH 06/85] #10065 added private_filter_user field for new installations. --- pandora_console/pandoradb.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index cb5598f957..cf9265cfc8 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1296,6 +1296,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `custom_data` VARCHAR(500) DEFAULT '', `custom_data_filter_type` TINYINT UNSIGNED DEFAULT 0, `owner_user` TEXT, + `private_filter_user` TEXT, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; From 85de06fbecbcb8de34fbb510da6c94bcd59cd415 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 10 Aug 2023 11:36:50 +0200 Subject: [PATCH 07/85] #11807 new report vulnerability by category --- .../reporting_builder.item_editor.php | 14 +++--- .../godmode/reporting/reporting_builder.php | 2 + .../phpchartjs/src/Renderer/JavaScript.php | 43 +++++++++++++++++++ 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index ea1db7aac8..6ecaf98f0d 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -200,12 +200,10 @@ $text_agent_module = ''; $only_data = false; -$categories_security_hardening = []; -if (security_hardening_installed() === true) { - $categories_security_hardening = categories_of_cis(); - foreach ($categories_security_hardening as $key => $cat) { - $categories_security_hardening[$key] = implode(' ', $cat); - } + +$categories_security_hardening = categories_of_cis(); +foreach ($categories_security_hardening as $key => $cat) { + $categories_security_hardening[$key] = implode(' ', $cat); } // Users. @@ -1037,7 +1035,7 @@ switch ($action) { $group = $item['id_group']; $recursion = $item['recursion']; $cat_selected = $item['cat_security_hardening']; - $ignore_skipped = ($item['ignore_skipped'] !== null) ? $item['ignore_skipped'] : true; + $ignore_skipped = $item['ignore_skipped']; break; default: @@ -3718,7 +3716,7 @@ $class = 'databox filters'; html_print_checkbox_switch( 'ignore_skipped', 1, - $ignore_skipped, + ($ignore_skipped !== null) ? $ignore_skipped : true, ); ?> diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 5cc94049f7..1517de9fc1 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1996,6 +1996,7 @@ switch ($action) { case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $values['ignore_skipped'] = get_parameter('ignore_skipped'); $good_format = true; break; @@ -2884,6 +2885,7 @@ switch ($action) { case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $values['ignore_skipped'] = get_parameter('ignore_skipped'); $good_format = true; break; diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php index 100276743f..b1fcb1bb9f 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php @@ -32,6 +32,49 @@ class JavaScript extends Renderer if (empty($this->chart->defaults()->getWatermark()) === false) { $script[] = 'const chart_watermark_'.$this->chart->getId().' = { id: "chart_watermark_'.$this->chart->getId().'", + beforeDraw: (chart) => { + if (Object.prototype.hasOwnProperty.call(chart, "config") && + Object.prototype.hasOwnProperty.call(chart.config.options, "elements") && + Object.prototype.hasOwnProperty.call(chart.config.options.elements, "center")) + { + var ctx = chart.ctx; + + ctx.save(); + + var centerConfig = chart.config.options.elements.center; + var txt = centerConfig.text; + var color = centerConfig.color || "#000"; + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + var centerX = (chart.chartArea.left + chart.chartArea.right) / 2; + var centerY = (chart.chartArea.top + chart.chartArea.bottom) / 2; + + var outerRadius = Math.min(ctx.canvas.width, ctx.canvas.height) / 2; + + var padding = 20; + + var innerRadius = outerRadius - padding; + + ctx.font = "30px "; + var sidePaddingCalculated = (92/100) * (innerRadius * 2) + + var stringWidth = ctx.measureText(txt).width; + var elementWidth = (innerRadius * 2) - sidePaddingCalculated; + + var widthRatio = elementWidth / stringWidth; + var newFontSize = Math.floor(30 * widthRatio); + var elementHeight = (innerRadius * 2); + + var fontSizeToUse = Math.min(newFontSize, elementHeight); + + ctx.font = fontSizeToUse + "px Lato, sans-serif"; + ctx.fillStyle = color; + + ctx.fillText(txt, centerX, centerY); + + ctx.restore(); + } + }, afterDraw: (chart) => { const image = new Image(); image.src = "'.$this->chart->defaults()->getWatermark()->getSrc().'"; From abb173c1a7af425fe6830e3dcb8ed55d5a471405 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 18 Aug 2023 10:27:55 +0200 Subject: [PATCH 08/85] #11807 new report top checks more frequent --- .../reporting_builder.item_editor.php | 11 +++++ .../godmode/reporting/reporting_builder.php | 12 +++++ .../include/functions_reporting.php | 7 +++ .../include/functions_reporting_html.php | 49 ++++++++++++++++++- pandora_console/include/functions_reports.php | 5 ++ 5 files changed, 83 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 6ecaf98f0d..efd9da896c 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1031,6 +1031,12 @@ switch ($action) { $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; break; + case 'top_n_checks_failed': + $group = $item['id_group']; + $recursion = $item['recursion']; + $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; + break; + case 'vul_by_cat': $group = $item['id_group']; $recursion = $item['recursion']; @@ -7473,6 +7479,11 @@ function chooseType() { $("#row_max_items").show(); break; + case 'top_n_checks_failed': + $("#row_group").show(); + $("#row_max_items").show(); + break; + case 'vul_by_cat': $("#row_group").show(); $("#row_cat_security_hardening").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 1517de9fc1..7ac62c9c45 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1993,6 +1993,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_checks_failed': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); @@ -2882,6 +2888,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_checks_failed': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 6561fe9389..b61b005e2d 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -942,6 +942,13 @@ function reporting_make_reporting_data( ); break; + case 'top_n_checks_failed': + $report['contents'][] = reporting_top_n_checks_failed( + $report, + $content + ); + break; + case 'vul_by_cat': $report['contents'][] = reporting_vul_by_categories( $report, diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index bf144cd518..d532061d80 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -468,6 +468,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) reporting_html_top_n_agents_sh($table, $item); break; + case 'top_n_checks_failed': + reporting_html_top_n_checks_failed($table, $item); + break; + case 'vul_by_cat': reporting_vul_by_cat_graph($table, $item); break; @@ -486,18 +490,61 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +/** + * Function to print HTML top checks failed. + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ +function reporting_html_top_n_checks_failed($table, $item) +{ + global $config; + $table->rowclass[0] = ''; + $table->data[1][0] = ''.__('Id').''; + $table->data[1][1] = ''.__('Title').''; + $table->data[1][2] = ''.__('Total Failed').''; + + $row = 2; + foreach ($item['data'] as $key => $check) { + $table->data[$row][0] = $check['id']; + $table->data[$row][1] = $check['title']; + $table->data[$row][2] = $check['total']; + $row++; + } +} + + +/** + * Function to print HTML top categories in graph. + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ function reporting_vul_by_cat_graph($table, $item) { + $table->rowclass[0] = ''; $table->colspan['chart']['cell'] = 3; $table->cellstyle['chart']['cell'] = 'text-align: center;'; $table->data['chart']['cell'] = $item['chart']; } +/** + * Function to print HTML top n agents from security hardening. + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ function reporting_html_top_n_agents_sh($table, $item) { global $config; - + $table->rowclass[0] = ''; $table->data[1][0] = ''.__('Agent').''; $table->data[1][1] = ''.__('Last audit scan').''; $table->data[1][2] = ''.__('Score').''; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index fca253153e..f4f1f6499e 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -969,6 +969,11 @@ function reports_get_report_types($template=false, $not_editor=false) 'name' => __('Top-N agents with the worst score'), ]; + $types['top_n_checks_failed'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('Top-N most frequent failed checks'), + ]; + $types['vul_by_cat'] = [ 'optgroup' => __('Security hardening'), 'name' => __('Vulnerabilities by category'), From 76b3e1da4a02e93b77932e0ebda1e102ff65ab7f Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 21 Aug 2023 13:29:58 +0200 Subject: [PATCH 09/85] #10065 Fixed query that adds private_filter_user field in the database --- pandora_console/extras/mr/66.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 0251ea70cc..d3fe3a7c70 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -1,6 +1,6 @@ START TRANSACTION; -ALTER TABLE tevent_filter ADD private_filter_user text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL; +ALTER TABLE tevent_filter ADD private_filter_user text NULL; UPDATE `twelcome_tip` SET title = 'Scheduled downtimes', From dd453507d23b7a8056b506338525269ace2fd1dd Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 22 Aug 2023 09:53:35 +0200 Subject: [PATCH 10/85] #11807 new report top n failed by checks --- .../reporting_builder.item_editor.php | 11 +++++++ .../godmode/reporting/reporting_builder.php | 12 ++++++++ .../include/functions_reporting.php | 7 +++++ .../include/functions_reporting_html.php | 30 +++++++++++++++++++ pandora_console/include/functions_reports.php | 5 ++++ 5 files changed, 65 insertions(+) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index efd9da896c..1aeaa8a1a6 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1037,6 +1037,12 @@ switch ($action) { $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; break; + case 'top_n_categories_checks': + $group = $item['id_group']; + $recursion = $item['recursion']; + $top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value']; + break; + case 'vul_by_cat': $group = $item['id_group']; $recursion = $item['recursion']; @@ -7484,6 +7490,11 @@ function chooseType() { $("#row_max_items").show(); break; + case 'top_n_categories_checks': + $("#row_group").show(); + $("#row_max_items").show(); + break; + case 'vul_by_cat': $("#row_group").show(); $("#row_cat_security_hardening").show(); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 8b5cea5236..48805131d7 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2002,6 +2002,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_categories_checks': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); @@ -2897,6 +2903,12 @@ switch ($action) { $good_format = true; break; + case 'top_n_categories_checks': + $values['id_group'] = get_parameter('combo_group'); + $values['top_n_value'] = get_parameter('max_items'); + $good_format = true; + break; + case 'vul_by_cat': $values['id_group'] = get_parameter('combo_group'); $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b61b005e2d..67c12f73a7 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -949,6 +949,13 @@ function reporting_make_reporting_data( ); break; + case 'top_n_categories_checks': + $report['contents'][] = reporting_top_n_categories_checks( + $report, + $content + ); + break; + case 'vul_by_cat': $report['contents'][] = reporting_vul_by_categories( $report, diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index d532061d80..887c3d5fcb 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -472,6 +472,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) reporting_html_top_n_checks_failed($table, $item); break; + case 'top_n_categories_checks': + reporting_html_top_n_categories_checks($table, $item); + break; + case 'vul_by_cat': reporting_vul_by_cat_graph($table, $item); break; @@ -490,6 +494,32 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +/** + * Function to print HTML top checks failed by category + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ +function reporting_html_top_n_categories_checks($table, $item) +{ + global $config; + $table->rowclass[0] = ''; + $table->data[1][0] = ''.__('Id').''; + $table->data[1][1] = ''.__('Category').''; + $table->data[1][2] = ''.__('Total Failed').''; + + $row = 2; + foreach ($item['data'] as $key => $check) { + $table->data[$row][0] = $check['id']; + $table->data[$row][1] = $check['category']; + $table->data[$row][2] = $check['total']; + $row++; + } +} + + /** * Function to print HTML top checks failed. * diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index f4f1f6499e..9e26be5998 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -974,6 +974,11 @@ function reports_get_report_types($template=false, $not_editor=false) 'name' => __('Top-N most frequent failed checks'), ]; + $types['top_n_categories_checks'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('Top-N checks failed by category'), + ]; + $types['vul_by_cat'] = [ 'optgroup' => __('Security hardening'), 'name' => __('Vulnerabilities by category'), From 61839db7ffe79243e1e22c9f1ca6aef9893e8a47 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 22 Aug 2023 16:28:01 +0200 Subject: [PATCH 11/85] #11807 new report list of checks agent --- pandora_console/extras/mr/66.sql | 2 + .../reporting_builder.item_editor.php | 38 +++++++++++++++++++ .../godmode/reporting/reporting_builder.php | 14 +++++++ .../include/functions_reporting.php | 7 ++++ .../include/functions_reporting_html.php | 33 +++++++++++++++- pandora_console/include/functions_reports.php | 5 +++ pandora_console/pandoradb.sql | 1 + 7 files changed, 99 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 466909a617..4f92b5e659 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -4,6 +4,8 @@ ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0; +ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT; + UPDATE `twelcome_tip` SET title = 'Scheduled downtimes', url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes' diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 1aeaa8a1a6..841874e3eb 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1050,6 +1050,14 @@ switch ($action) { $ignore_skipped = $item['ignore_skipped']; break; + case 'list_checks': + $group = $item['id_group']; + $recursion = $item['recursion']; + $cat_selected = $item['cat_security_hardening']; + $status_of_check = $item['status_of_check']; + $idAgent = $item['id_agent']; + break; + default: // It's not possible. break; @@ -3751,6 +3759,28 @@ $class = 'databox filters'; + + + + + + __('All'), + 'PASS' => __('Passed'), + 'FAIL' => __('Failed'), + 'INVALID' => __('Skipped'), + ], + 'status_of_check', + $status_of_check, + ); + ?> + + + @@ -6625,6 +6655,7 @@ function chooseType() { $("#row_use_prefix_notation").hide(); $("#row_cat_security_hardening").hide(); $("#row_ignore_skipped").hide(); + $("#row_status_check").hide(); // SLA list default state. $("#sla_list").hide(); @@ -7500,6 +7531,13 @@ function chooseType() { $("#row_cat_security_hardening").show(); $("#row_ignore_skipped").show(); break; + + case 'list_checks': + $("#row_group").show(); + $("#row_agent").show(); + $("#row_cat_security_hardening").show(); + $("#row_status_check").show(); + break; } switch (type) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 48805131d7..1102aabdfc 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2015,6 +2015,13 @@ switch ($action) { $good_format = true; break; + case 'list_checks': + $values['id_group'] = get_parameter('combo_group'); + $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $values['status_of_check'] = get_parameter('status_of_check'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2916,6 +2923,13 @@ switch ($action) { $good_format = true; break; + case 'list_checks': + $values['id_group'] = get_parameter('combo_group'); + $values['cat_security_hardening'] = get_parameter('cat_security_hardening'); + $values['status_of_check'] = get_parameter('status_of_check'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 67c12f73a7..1603183b65 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -963,6 +963,13 @@ function reporting_make_reporting_data( ); break; + case 'list_checks': + $report['contents'][] = reporting_list_checks( + $report, + $content + ); + break; + default: // Default. break; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 887c3d5fcb..c9c4da53fb 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -479,6 +479,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) case 'vul_by_cat': reporting_vul_by_cat_graph($table, $item); break; + + case 'list_checks': + reporting_html_list_checks($table, $item); + break; } if ($item['type'] == 'agent_module') { @@ -494,6 +498,34 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +/** + * Function to print HTML checks filtered by agent and category. + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ +function reporting_html_list_checks($table, $item) +{ + $table->rowclass[0] = ''; + $table->colspan[0][1] = 3; + $table->data[1][0] = ''.__('Id').''; + $table->data[1][1] = ''.__('Title').''; + $table->data[1][2] = ''.__('Category').''; + $table->data[1][3] = ''.__('Status').''; + + $row = 2; + foreach ($item['data'] as $key => $check) { + $table->data[$row][0] = $check['id']; + $table->data[$row][1] = $check['title']; + $table->data[$row][2] = $check['category']; + $table->data[$row][3] = $check['status']; + $row++; + } +} + + /** * Function to print HTML top checks failed by category * @@ -504,7 +536,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) */ function reporting_html_top_n_categories_checks($table, $item) { - global $config; $table->rowclass[0] = ''; $table->data[1][0] = ''.__('Id').''; $table->data[1][1] = ''.__('Category').''; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 9e26be5998..f574beb3bf 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -983,6 +983,11 @@ function reports_get_report_types($template=false, $not_editor=false) 'optgroup' => __('Security hardening'), 'name' => __('Vulnerabilities by category'), ]; + + $types['list_checks'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('List of checks'), + ]; } return $types; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 5164d2ed21..d1fb4e4f1f 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1674,6 +1674,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1, `cat_security_hardening` INT NOT NULL DEFAULT 0, `ignore_skipped` INT NOT NULL DEFAULT 0, + `status_of_check` TINYTEXT, PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE From ae288e3dd4e1a6420c6b11c9dd391981419dc797 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 24 Aug 2023 09:24:31 +0200 Subject: [PATCH 12/85] #11807 added new report scoring --- .../reporting_builder.item_editor.php | 9 +++++ .../godmode/reporting/reporting_builder.php | 10 +++++ .../include/functions_reporting.php | 7 ++++ .../include/functions_reporting_html.php | 39 ++++++++++++++++++- pandora_console/include/functions_reports.php | 5 +++ 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 841874e3eb..99fedcb308 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1058,6 +1058,11 @@ switch ($action) { $idAgent = $item['id_agent']; break; + case 'scoring': + $group = $item['id_group']; + $recursion = $item['recursion']; + break; + default: // It's not possible. break; @@ -7538,6 +7543,10 @@ function chooseType() { $("#row_cat_security_hardening").show(); $("#row_status_check").show(); break; + + case 'scoring': + $("#row_group").show(); + break; } switch (type) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 1102aabdfc..8901b68ecd 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2022,6 +2022,11 @@ switch ($action) { $good_format = true; break; + case 'scoring': + $values['id_group'] = get_parameter('combo_group'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( @@ -2930,6 +2935,11 @@ switch ($action) { $good_format = true; break; + case 'scoring': + $values['id_group'] = get_parameter('combo_group'); + $good_format = true; + break; + default: $values['period'] = get_parameter('period'); $values['top_n'] = get_parameter( diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1603183b65..782d756e4c 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -970,6 +970,13 @@ function reporting_make_reporting_data( ); break; + case 'scoring': + $report['contents'][] = reporting_scoring( + $report, + $content + ); + break; + default: // Default. break; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index c9c4da53fb..d976b96951 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -483,6 +483,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) case 'list_checks': reporting_html_list_checks($table, $item); break; + + case 'scoring': + reporting_html_scoring($table, $item); + break; } if ($item['type'] == 'agent_module') { @@ -498,6 +502,38 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) } +/** + * Function to print the agents scoring. + * + * @param object $table Head table or false if it comes from pdf. + * @param array $item Items data. + * + * @return void + */ +function reporting_html_scoring($table, $item) +{ + global $config; + + $table1 = new stdClass(); + $table1->width = '100%'; + $table1->class = 'databox filters'; + $table1->styleTable = 'border: 0px;'; + $table1->data[0][0] = ''.__('Date').''; + $table1->data[0][1] = ''.__('Agent').''; + $table1->data[0][2] = ''.__('Score').''; + $row = 1; + foreach ($item['data'] as $key => $check) { + $table1->data[$row][1] = date($config['date_format'], $check['date']); + $table1->data[$row][2] = $check['agent']; + $table1->data[$row][3] = $check['scoring'].' %'; + $row++; + } + + $table->colspan[2][0] = 3; + $table->data[2][0] = html_print_table($table1, true); +} + + /** * Function to print HTML checks filtered by agent and category. * @@ -509,7 +545,8 @@ function reporting_html_print_report($report, $mini=false, $report_info=1) function reporting_html_list_checks($table, $item) { $table->rowclass[0] = ''; - $table->colspan[0][1] = 3; + $table->colspan[0][1] = 2; + $table->align[3] = 'center'; $table->data[1][0] = ''.__('Id').''; $table->data[1][1] = ''.__('Title').''; $table->data[1][2] = ''.__('Category').''; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index f574beb3bf..6fa873b72a 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -988,6 +988,11 @@ function reports_get_report_types($template=false, $not_editor=false) 'optgroup' => __('Security hardening'), 'name' => __('List of checks'), ]; + + $types['scoring'] = [ + 'optgroup' => __('Security hardening'), + 'name' => __('Scoring'), + ]; } return $types; From 797b24af86a515a7f79c9dccf31ab4d83b24c96a Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 28 Aug 2023 13:54:35 +0200 Subject: [PATCH 13/85] #10065 Added switch to filter create/edit modal. --- .../godmode/events/event_edit_filter.php | 2 +- .../godmode/events/event_filter.php | 2 +- pandora_console/include/ajax/events.php | 58 +++++++++++++++---- pandora_console/operation/events/events.php | 27 +++------ 4 files changed, 57 insertions(+), 32 deletions(-) diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index aaf5d00b9b..113c156df3 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -309,7 +309,7 @@ $table->data[0][0] = html_print_label_input_block( '', 'w100p' ).html_print_label_input_block( - __('Private event'), + __('Private'), html_print_checkbox_switch( 'private_filter_event', $private_filter, diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 0be93fa4a4..c4f1860e6f 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -135,7 +135,7 @@ if ($filters === false) { $filters = []; } else { foreach ($filters as $key => $filter) { - $permission = check_acl($config['id_user'], 0, 'PM'); + $permission = users_is_admin($config['id_user']); // Validate permission and private filter user. if ($permission || $filter['private_filter_user'] === $config['id_user']) { if ($filter['private_filter_user'] !== null) { diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index b3a6be0670..dbab927606 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -92,6 +92,9 @@ $get_id_source_event = get_parameter('get_id_source_event'); $node_id = (int) get_parameter('node_id', 0); $settings_modal = get_parameter('settings', 0); $parameters_modal = get_parameter('parameters', 0); +// User private filter. +$current_filter = get_parameter('current_filter', 0); +$private_filter_event = get_parameter('private_filter_event', 0); if ($get_comments === true) { global $config; @@ -731,8 +734,8 @@ if ($save_filter_modal) { $table = new StdClass; $table->id = 'save_filter_form'; $table->width = '100%'; - $table->cellspacing = 4; - $table->cellpadding = 4; + $table->cellspacing = 5; + $table->cellpadding = 5; $table->class = 'databox'; if (is_metaconsole() === true) { $table->class = 'databox filters'; @@ -751,7 +754,7 @@ if ($save_filter_modal) { 'filter_mode', 'new', __('New filter'), - true, + ((int) $current_filter === 0) ? true : false, true ); @@ -759,7 +762,7 @@ if ($save_filter_modal) { 'filter_mode', 'update', __('Update filter'), - false, + ((int) $current_filter > 0) ? true : false, true ); @@ -774,6 +777,7 @@ if ($save_filter_modal) { $table->rowclass[2] = 'flex'; $table->rowclass[3] = 'flex'; $table->rowclass[4] = 'flex'; + $table->rowclass[5] = 'flex'; $data[0] = ''.__('Filter name').''.$jump; $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); if (is_metaconsole()) { @@ -820,9 +824,9 @@ if ($save_filter_modal) { $data[0] .= html_print_select( $_filters_update, 'overwrite_filter', + $current_filter, '', - '', - '', + __('None'), 0, true, false, @@ -833,6 +837,31 @@ if ($save_filter_modal) { $table->data[] = $data; $table->rowclass[] = ''; + $data = []; + $table->rowid[4] = 'update_filter_row2'; + + $table->data[] = $data; + $table->rowclass[] = ''; + + // Update user private filter. + $data = []; + $table->rowid[6] = 'private_filter_event_row1'; + $data[0] = html_print_label_input_block( + __('Private'), + html_print_checkbox_switch( + 'private_filter_event', + $private_filter_event, + $private_filter_event, + true, + false, + 'checked_slide_events(this);', + true + ) + ); + + $table->data[] = $data; + $table->rowclass[] = ''; + html_print_table($table); html_print_div( @@ -877,10 +906,19 @@ if ($save_filter_modal) { ?> From 05320f7ad4833eb79104311e27f688ae4f1ba501 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 20 Sep 2023 12:42:01 +0200 Subject: [PATCH 61/85] #11990 Fixed enable_horizontal_tree --- pandora_console/extras/mr/66.sql | 2 ++ pandora_console/pandoradb.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index bd970d70c4..a031cfd598 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -66,4 +66,6 @@ ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0; ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT; +ALTER TABLE `tservice` ADD COLUMN `enable_horizontal_tree` TINYINT NOT NULL DEFAULT 0; + COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 147ff1bb24..d779e1660e 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2913,6 +2913,7 @@ CREATE TABLE IF NOT EXISTS `tservice` ( `is_favourite` TINYINT NOT NULL DEFAULT 0, `enable_sunburst` TINYINT NOT NULL DEFAULT 0, `asynchronous` TINYINT NOT NULL DEFAULT 0, + `enable_horizontal_tree` TINYINT NOT NULL DEFAULT 0, `rca` TEXT, PRIMARY KEY (`id`) ) ENGINE=InnoDB From d4a253a8d69dce803b16c4cbe8339fce63636a33 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 20 Sep 2023 13:36:11 +0200 Subject: [PATCH 62/85] Separate agent el7, el8 and el9 spec files --- .../unix/pandora_agent.redhat_bin.el8.spec | 166 +++++++++++++++++ .../unix/pandora_agent.redhat_bin.el9.spec | 167 ++++++++++++++++++ 2 files changed, 333 insertions(+) create mode 100644 pandora_agents/unix/pandora_agent.redhat_bin.el8.spec create mode 100644 pandora_agents/unix/pandora_agent.redhat_bin.el9.spec diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec new file mode 100644 index 0000000000..f18f3237e4 --- /dev/null +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -0,0 +1,166 @@ +# +#Pandora FMS Linux Agent +# +%global __os_install_post %{nil} +%define name pandorafms_agent_linux_bin +%define source_name pandorafms_agent_linux +%define version 7.0NG.773.3 +%define release 230919 + +Summary: Pandora FMS Linux agent, binary version +Name: %{name} +Version: %{version} +Release: %{release} +License: GPL +Vendor: ArticaST +Source0: %{source_name}-%{version}.tar.gz +URL: http://pandorafms.org +Group: System/Monitoring +Packager: Sancho Lerena +Prefix: /usr/share +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +BuildArch: x86_64 +Requires(pre): shadow-utils +Requires(post): chkconfig /bin/ln +Requires(preun): chkconfig /bin/rm /usr/sbin/userdel +Requires: coreutils unzip +Requires: util-linux procps grep +Requires: /sbin/ip /bin/awk +Requires: libnsl +AutoReq: 0 +Provides: %{name}-%{version} + +%description +Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software. + +%prep +rm -rf $RPM_BUILD_ROOT + +%setup -q -n unix + +%build + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +mkdir -p $RPM_BUILD_ROOT/usr/bin/ +mkdir -p $RPM_BUILD_ROOT/usr/sbin/ +mkdir -p $RPM_BUILD_ROOT/etc/pandora/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ +mkdir -p $RPM_BUILD_ROOT/var/log/pandora/ +mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ +cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ + +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew + +install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent + +if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then + rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec +fi + +%clean +rm -Rf $RPM_BUILD_ROOT + +%pre +getent passwd pandora >/dev/null || \ + /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora +exit 0 +chown pandora:root /var/log/pandora + +%post +if [ ! -d /etc/pandora ] ; then + mkdir -p /etc/pandora +fi + +if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then + cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf +fi + +if [ ! -f /etc/pandora/pandora_agent.conf ] ; then + ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf +else + [[ ! -f /etc/pandora/pandora_agent.conf.rpmnew ]] && ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew +fi + +if [ ! -e /etc/pandora/plugins ]; then + ln -s /usr/share/pandora_agent/plugins /etc/pandora +fi + +if [ ! -e /etc/pandora/collections ]; then + mkdir -p /usr/share/pandora_agent/collections + ln -s /usr/share/pandora_agent/collections /etc/pandora +fi + +if [ ! -e /etc/pandora/commands ]; then + mkdir -p /usr/share/pandora_agent/commands + ln -s /usr/share/pandora_agent/commands /etc/pandora +fi + +mkdir -p /var/spool/pandora/data_out +if [ ! -d /var/log/pandora ]; then + mkdir -p /var/log/pandora +fi + +if [ `command -v systemctl` ]; +then + echo "Copying new version of pandora_agent_daemon service" + cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service +# Enable the services on SystemD + systemctl enable pandora_agent_daemon.service +else + /sbin/chkconfig --add pandora_agent_daemon + /sbin/chkconfig pandora_agent_daemon on +fi + +if [ "$1" -gt 1 ] +then + + echo "If Pandora Agent daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + + +%preun + +# Upgrading +if [ "$1" = "1" ]; then + exit 0 +fi + +/sbin/chkconfig --del pandora_agent_daemon +/etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || : + +# Remove symbolic links +pushd /etc/pandora +for f in pandora_agent.conf plugins collections +do + [ -L $f ] && rm -f $f +done +exit 0 + +%files +%defattr(750,root,root) +/usr/bin/pandora_agent + +%defattr(755,pandora,root) +%{prefix}/pandora_agent + +%defattr(755,root,root) +/usr/bin/pandora_agent_exec +/usr/bin/tentacle_client +/etc/rc.d/init.d/pandora_agent_daemon + +%defattr(644,root,root) +/usr/share/man/man1/pandora_agent.1.gz +/usr/share/man/man1/tentacle_client.1.gz +%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec new file mode 100644 index 0000000000..511146f1e0 --- /dev/null +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -0,0 +1,167 @@ +# +#Pandora FMS Linux Agent +# +%global __os_install_post %{nil} +%define name pandorafms_agent_linux_bin +%define source_name pandorafms_agent_linux +%define version 7.0NG.773.3 +%define release 230919 + +Summary: Pandora FMS Linux agent, binary version +Name: %{name} +Version: %{version} +Release: %{release} +License: GPL +Vendor: ArticaST +Source0: %{source_name}-%{version}.tar.gz +URL: http://pandorafms.org +Group: System/Monitoring +Packager: Sancho Lerena +Prefix: /usr/share +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +BuildArch: x86_64 +Requires(pre): shadow-utils +Requires(post): chkconfig /bin/ln +Requires(preun): chkconfig /bin/rm /usr/sbin/userdel +Requires: coreutils unzip +Requires: util-linux procps grep +Requires: /sbin/ip /bin/awk +Requires: libnsl +Requires: libxcrypt-compat +AutoReq: 0 +Provides: %{name}-%{version} + +%description +Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software. + +%prep +rm -rf $RPM_BUILD_ROOT + +%setup -q -n unix + +%build + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +mkdir -p $RPM_BUILD_ROOT/usr/bin/ +mkdir -p $RPM_BUILD_ROOT/usr/sbin/ +mkdir -p $RPM_BUILD_ROOT/etc/pandora/ +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ +mkdir -p $RPM_BUILD_ROOT/var/log/pandora/ +mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/ +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ +cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ + +cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew + +install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent + +if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then + rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec +fi + +%clean +rm -Rf $RPM_BUILD_ROOT + +%pre +getent passwd pandora >/dev/null || \ + /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora +exit 0 +chown pandora:root /var/log/pandora + +%post +if [ ! -d /etc/pandora ] ; then + mkdir -p /etc/pandora +fi + +if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then + cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf +fi + +if [ ! -f /etc/pandora/pandora_agent.conf ] ; then + ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf +else + [[ ! -f /etc/pandora/pandora_agent.conf.rpmnew ]] && ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew +fi + +if [ ! -e /etc/pandora/plugins ]; then + ln -s /usr/share/pandora_agent/plugins /etc/pandora +fi + +if [ ! -e /etc/pandora/collections ]; then + mkdir -p /usr/share/pandora_agent/collections + ln -s /usr/share/pandora_agent/collections /etc/pandora +fi + +if [ ! -e /etc/pandora/commands ]; then + mkdir -p /usr/share/pandora_agent/commands + ln -s /usr/share/pandora_agent/commands /etc/pandora +fi + +mkdir -p /var/spool/pandora/data_out +if [ ! -d /var/log/pandora ]; then + mkdir -p /var/log/pandora +fi + +if [ `command -v systemctl` ]; +then + echo "Copying new version of pandora_agent_daemon service" + cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/ + chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service +# Enable the services on SystemD + systemctl enable pandora_agent_daemon.service +else + /sbin/chkconfig --add pandora_agent_daemon + /sbin/chkconfig pandora_agent_daemon on +fi + +if [ "$1" -gt 1 ] +then + + echo "If Pandora Agent daemon was running with init.d script," + echo "please stop it manually and start the service with systemctl" + +fi + + +%preun + +# Upgrading +if [ "$1" = "1" ]; then + exit 0 +fi + +/sbin/chkconfig --del pandora_agent_daemon +/etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || : + +# Remove symbolic links +pushd /etc/pandora +for f in pandora_agent.conf plugins collections +do + [ -L $f ] && rm -f $f +done +exit 0 + +%files +%defattr(750,root,root) +/usr/bin/pandora_agent + +%defattr(755,pandora,root) +%{prefix}/pandora_agent + +%defattr(755,root,root) +/usr/bin/pandora_agent_exec +/usr/bin/tentacle_client +/etc/rc.d/init.d/pandora_agent_daemon + +%defattr(644,root,root) +/usr/share/man/man1/pandora_agent.1.gz +/usr/share/man/man1/tentacle_client.1.gz +%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent From dc9b47a904b093671b9f65e8fa8aee415bb1d08e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 20 Sep 2023 13:51:56 +0200 Subject: [PATCH 63/85] #12027 tree view quiet mode --- pandora_console/include/class/Tree.class.php | 5 ----- pandora_console/include/functions_treeview.php | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index b4a41c494d..94b9c1b23c 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -960,11 +960,6 @@ class Tree $agent['counters']['not_init'] = 0; } - // Quiet image - if (isset($agent['quiet']) && $agent['quiet']) { - $agent['statusImageHTML'] = ui_print_status_sets('agent_no_monitors_ball.png', __('Quiet'), 1, ['is_tree_view' => 'yes', 'class' => 'status_balls', 'style' => 'background: '.COL_QUIET.';'], '', false); - } - // Children if (empty($agent['children'])) { $agent['children'] = []; diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 025276ecef..47f861314a 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -708,6 +708,13 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) $row['data'] = human_time_description_raw($agent['intervalo']); $table->data['interval'] = $row; + if (isset($agent['quiet']) && $agent['quiet']) { + $row = []; + $row['title'] = __('Quiet mode enabled'); + $row['data'] = ui_print_help_tip(__('This agent would not raise events or alerts'), true); + $table->data['quiet'] = $row; + } + // Comments. $row = []; $row['title'] = __('Description'); From 2de84982cfe12aa2515a377c246a6a3477a10fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Mon, 21 Aug 2023 11:50:46 -0600 Subject: [PATCH 64/85] Updates to save new Complex templates --- pandora_console/extras/mr/66.sql | 6 + .../alerts/configure_alert_template.php | 168 ++++++++++++++++++ pandora_console/include/functions_alerts.php | 56 ++++++ pandora_console/pandoradb.sql | 5 +- 4 files changed, 234 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index bd970d70c4..f22fe338be 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -23,6 +23,12 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; +ALTER TABLE talert_templates +ADD COLUMN `time_window` VARCHAR(25) DEFAULT NULL, +ADD COLUMN `math_function` VARCHAR(25) DEFAULT NULL, +ADD COLUMN `condition` VARCHAR(25) DEFAULT NULL, +MODIFY COLUMN `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal', 'complex'); + ALTER TABLE `tsesion_filter_log_viewer` CHANGE COLUMN `date_range` `custom_date` INT NULL DEFAULT NULL , CHANGE COLUMN `start_date_defined` `date` VARCHAR(45) NULL DEFAULT NULL , diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index edaa003ce6..10d0804a52 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -374,6 +374,9 @@ function update_template($step) $max = (float) get_parameter('max'); $min = (float) get_parameter('min'); $matches = (bool) get_parameter('matches_value'); + $math_function = (string) get_parameter('math_function'); + $condition = (string) get_parameter('condition'); + $time_window = (string) get_parameter('time_window'); $default_action = (int) get_parameter('default_action'); if (empty($default_action) === true) { @@ -394,6 +397,9 @@ function update_template($step) 'min_value' => $min, 'matches_value' => $matches, 'disable_event' => $disable_event, + 'math_function' => $math_function, + 'condition' => $condition, + 'time_window' => $time_window, ]; $result = alerts_update_alert_template($id, $values); @@ -607,6 +613,9 @@ if ($id && ! $create_template) { $max = $template['max_value']; $min = $template['min_value']; $matches = $template['matches_value']; + $math_function = $template['math_function']; + $condition = $template['condition']; + $time_window = $template['time_window']; $schedule = json_encode( $default_events_calendar @@ -856,6 +865,58 @@ if ($step == 2) { ).'' ); + + $table->data["math_function"][0] = html_print_label_input_block( + __('Math function'), + html_print_select( + alerts_get_alert_templates_functions(), + 'math_function', + $math_function, + '', + __('None'), + 0, + true, + false, + false, + 'w100p', + (!$is_management_allowed | $disabled) + ) + ); + + $table->data["time_window"][0] = html_print_label_input_block( + __('Time window').ui_print_help_tip(__('Limits to data in the following time window.'), true), + html_print_select( + alerts_get_alert_templates_windows(), + 'time_window', + $time_window, + '', + __('None'), + 0, + true, + false, + false, + 'w100p', + (!$is_management_allowed | $disabled) + ) + ); + + $table->data["condition"][0] = html_print_label_input_block( + __('Alert condition'), + html_print_select( + alerts_get_alert_templates_conditions(), + 'condition', + $condition, + '', + __('None'), + 0, + true, + false, + false, + 'w100p', + (!$is_management_allowed | $disabled) + ) + ); + $table->data['value'][1] = html_print_label_input_block( __('Value'), html_print_input_text( @@ -1088,6 +1149,12 @@ if ($step == 2) { $table->rowstyle['min'] = ''; break; + case 'complex': + $table->rowstyle['math_function'] = ''; + $table->rowstyle['condition'] = ''; + $table->rowstyle['time_window'] = ''; + break; + case 'onchange': $show_matches = true; break; @@ -1299,6 +1366,7 @@ var onchange_not = ; var error_message_min_max_zero = ; var not_normal = ; +var complex = within ')."'"; ?>; function check_fields_step2() { var correct = true; @@ -1361,6 +1429,68 @@ function render_example () { else { $("span#value").empty ().append (vvalue); } + + /* Set math function */ + var vfunction = $("select#math_function").val(); + var functionMessage = ""; + + if (vfunction == "0") { + functionMessage = ""; + } else { + if (vfunction == "avg"){ + $("span#value").empty (); + } + functionMessage = vfunction; + } + $("span#math_function").empty ().append (functionMessage); + + /* Set complex value */ + if($("select#type").val() == "complex"){ + var valueMessage = ""; + + if(vfunction == "avg"){ + valueMessage = ""; + }else if (vvalue == "") { + valueMessage = "" ; + } else { + valueMessage = vvalue; + } + + $("span#value").empty ().append (valueMessage); + } + + /* Set condition */ + var vCondition = $("select#condition").val(); + var conditionMessage = "[condition]"; + switch (vCondition){ + case "greater": + conditionMessage = (vfunction == "avg") ? "increases" : "is more than"; + break + case "lower": + conditionMessage = (vfunction == "avg") ? "decreases" : "is less than"; + break + case "equal": + conditionMessage = (vfunction == "avg") ? "remains the same" : "is equal to"; + break + } + + $("span#condition").empty ().append (conditionMessage); + + var vWindow = $("select#time_window").val(); + + /* Set time window */ + var timeWindowMessages = { + "thirty_days": "the last 30 days", + "month": "the last month", + "seven_days": "the last 7 days", + "week": "the last week", + "one_day": "the last 24 hours", + "today": "today" + }; + var windowMessage = timeWindowMessages[vWindow] || ""; + + $("span#time_window").empty().append(windowMessage); + } // Fix for metaconsole toggle @@ -1388,6 +1518,18 @@ if ($step == 2) { $("input#text-value").keyup (render_example); $("input#text-max").keyup (render_example); $("input#text-min").keyup (render_example); + $("#condition").change (render_example); + $("#time_window").change (render_example); + + $("#math_function").change (function () { + if (["0", 'avg'].includes(this.value)) { + $("#template-value").hide(); + } else { + $("#template-value").show (); + } + + render_example (); + }) $("#type").change (function () { switch (this.value) { @@ -1395,6 +1537,7 @@ if ($step == 2) { case "not_equal": $("img#regex_good, img#regex_bad, span#matches_value").hide (); $("#template-max, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-value, #template-example").show (); /* Show example */ @@ -1405,6 +1548,7 @@ if ($step == 2) { break; case "regex": $("#template-max, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-value, #template-example, span#matches_value").show (); check_regex (); @@ -1416,6 +1560,7 @@ if ($step == 2) { break; case "max_min": $("#template-value").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-max, #template-min, #template-example, span#matches_value").show (); /* Show example */ @@ -1424,9 +1569,25 @@ if ($step == 2) { else $("span#example").empty ().append (between_not); + break; + case "complex": + $("pan#matches_value, #template-example, #template-value, #template-max, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").show (); + $("#template-example").show (); + + if (["0", 'avg'].includes($("#math_function").val())) { + $("#template-value").hide(); + }else { + $("#template-value").show(); + } + + /* Show example */ + $("span#example").empty ().append (complex); + break; case "max": $("#template-value, #template-min, span#matches_value").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-max, #template-example").show (); /* Show example */ @@ -1434,6 +1595,7 @@ if ($step == 2) { break; case "min": $("#template-value, #template-max, span#matches_value").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-min, #template-example").show (); /* Show example */ @@ -1441,6 +1603,7 @@ if ($step == 2) { break; case "warning": $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-example").show (); /* Show example */ @@ -1448,6 +1611,7 @@ if ($step == 2) { break; case "critical": $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-example").show (); /* Show example */ @@ -1455,6 +1619,7 @@ if ($step == 2) { break; case "not_normal": $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-example").show (); /* Show example */ @@ -1462,6 +1627,7 @@ if ($step == 2) { break; case "onchange": $("#template-value, #template-max, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-example, span#matches_value").show (); /* Show example */ @@ -1472,6 +1638,7 @@ if ($step == 2) { break; case "unknown": $("#template-value, #template-max, span#matches_value, #template-min").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); $("#template-example").show (); if ($("#text-min_alerts").val() > 0 ) { @@ -1483,6 +1650,7 @@ if ($step == 2) { break; default: $("#template-value, #template-max, #template-min, #template-example, span#matches_value").hide (); + $("#template-math_function, #template-condition, #template-time_window").hide (); break; } diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 8d51a3b536..fc28b59b6d 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -688,11 +688,67 @@ function alerts_get_alert_templates_types() $types['onchange'] = __('On Change'); $types['always'] = __('Always'); $types['not_normal'] = __('Not normal status'); + $types['complex'] = __('Complex alert'); return $types; } +/** + * Get matemathical functions for complex alert templates. + * + * @return array Mathematical function for complex templates. + */ +function alerts_get_alert_templates_functions() +{ + $functions = []; + + $functions['avg'] = __('Avg.'); + $functions['sum'] = __('Sum.'); + $functions['max'] = __('Max.'); + $functions['min'] = __('Min.'); + + return $functions; +} + + +/** + * Get conditions for complex alert templates. + * + * @return array Conditions for complex templates. + */ +function alerts_get_alert_templates_conditions() +{ + $conditions = []; + + $conditions['lower'] = __('<'); + $conditions['greater'] = __('>'); + $conditions['equal'] = __('='); + + return $conditions; +} + + +/** + * Get time windows for complex alert templates. + * + * @return array Windows for complex templates. + */ +function alerts_get_alert_templates_windows() +{ + $windows = []; + + $windows['thirty_days'] = __('Last 30 days'); + $windows['month'] = __('This month'); + $windows['seven_days'] = __('Last 7 days'); + $windows['week'] = __('This week'); + $windows['one_day'] = __('Last 24 hours'); + $windows['today'] = __('Today'); + + return $windows; +} + + /** * Get type name of an alert template. * diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 147ff1bb24..7271f62e7f 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -484,11 +484,14 @@ CREATE TABLE IF NOT EXISTS `talert_templates` ( `field18` TEXT, `field19` TEXT, `field20` TEXT, - `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'), + `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal', 'complex'), `value` VARCHAR(255) DEFAULT '', `matches_value` TINYINT DEFAULT 0, `max_value` DOUBLE DEFAULT NULL, `min_value` DOUBLE DEFAULT NULL, + `time_window` VARCHAR(25) DEFAULT NULL, + `math_function` VARCHAR(25) DEFAULT NULL, + `condition` VARCHAR(25) DEFAULT NULL, `time_threshold` INT NOT NULL DEFAULT 0, `max_alerts` INT UNSIGNED NOT NULL DEFAULT 1, `min_alerts` INT UNSIGNED NOT NULL DEFAULT 0, From 976a32617f966429ed33748c7b741c2cabb98764 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Thu, 24 Aug 2023 17:35:07 -0600 Subject: [PATCH 65/85] Add logic to complex alerts --- pandora_console/extras/mr/66.sql | 7 +-- .../alerts/configure_alert_template.php | 2 +- pandora_console/pandoradb.sql | 6 +-- pandora_server/lib/PandoraFMS/Core.pm | 43 +++++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index f22fe338be..526602e24c 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -24,9 +24,9 @@ UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; ALTER TABLE talert_templates -ADD COLUMN `time_window` VARCHAR(25) DEFAULT NULL, -ADD COLUMN `math_function` VARCHAR(25) DEFAULT NULL, -ADD COLUMN `condition` VARCHAR(25) DEFAULT NULL, +ADD COLUMN `time_window` ENUM ('thirty_days','this_month','seven_days','this_week','one_day','today'), +ADD COLUMN `math_function` ENUM ('avg', 'min', 'max', 'sum'), +ADD COLUMN `condition` ENUM ('lower', 'greater', 'equal'), MODIFY COLUMN `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal', 'complex'); ALTER TABLE `tsesion_filter_log_viewer` @@ -72,4 +72,5 @@ ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0; ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT; + COMMIT; diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 10d0804a52..56b2d40085 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -1461,7 +1461,7 @@ function render_example () { /* Set condition */ var vCondition = $("select#condition").val(); - var conditionMessage = "[condition]"; + var conditionMessage = "" ; switch (vCondition){ case "greater": conditionMessage = (vfunction == "avg") ? "increases" : "is more than"; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 7271f62e7f..b8efa4b701 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -489,9 +489,9 @@ CREATE TABLE IF NOT EXISTS `talert_templates` ( `matches_value` TINYINT DEFAULT 0, `max_value` DOUBLE DEFAULT NULL, `min_value` DOUBLE DEFAULT NULL, - `time_window` VARCHAR(25) DEFAULT NULL, - `math_function` VARCHAR(25) DEFAULT NULL, - `condition` VARCHAR(25) DEFAULT NULL, + `time_window` ENUM ('thirty_days','this_month','seven_days','this_week','one_day','today'), + `math_function` ENUM ('avg', 'min', 'max', 'sum'), + `condition` ENUM ('lower', 'greater', 'equal'), `time_threshold` INT NOT NULL DEFAULT 0, `max_alerts` INT UNSIGNED NOT NULL DEFAULT 1, `min_alerts` INT UNSIGNED NOT NULL DEFAULT 0, diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f2c7d46143..f7fb9be07b 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -704,6 +704,49 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) { return $status if (valid_regex ($alert->{'value'}) == 1 && $data =~ m/$alert->{'value'}/i); } } + + if($alert-> {'type'} eq "complex") { + + my @allowed_functions = ("sum", "min", "max", "avg"); + my %condition_map = ( + lower => '<', + greater => '>', + equal => '==', + ); + my %time_windows_map = ( + thirty_days => sub { return time - 30 * 24 * 60 * 60 }, + this_month => sub { return timelocal(0, 0, 0, 1, (localtime)[4, 5]) }, + seven_days => sub { return time - 7 * 24 * 60 * 60 }, + this_week => sub { return time - ((localtime)[6] % 7) * 24 * 60 * 60 }, + one_day => sub { return time - 1 * 24 * 60 * 60 }, + today => sub { return timelocal(0, 0, 0, (localtime)[3, 4, 5]) }, + ); + + my $function = $alert-> {'math_function'}; + my $condition = $condition_map{$alert->{'condition'}}; + my $window = $time_windows_map{$alert->{'time_window'}}; + my $value = defined $alert->{'value'} && $alert->{'value'} ne "" ? $alert->{'value'} : 0; + + if((grep { $_ eq $function } @allowed_functions) == 1 && defined($condition) && defined($window)){ + + my $query = "SELECT IFNULL($function(datos), 0) AS $function + FROM tagente_datos + WHERE id_agente_modulo = ? AND utimestamp > ?"; + + my $historical_value = get_db_value($dbh, $query, $alert->{"id_agent_module"}, $window->()); + + my $activate_alert = 0; + if($function eq "avg"){ + # Check if the received value meets the condition compared to the avg. + $activate_alert = eval("$historical_value $condition $data"); + }else{ + # Check if the hiscorical value meets the condition compared to the val. + $activate_alert = eval("$historical_value $condition $value"); + } + + return $status if $activate_alert; + } + } return $status if ($last_status != 1 && $alert->{'type'} eq 'critical'); return $status if ($last_status != 2 && $alert->{'type'} eq 'warning'); From b7bc70f4ae7407fba52010b6b0b975e5c7dd8ef6 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Fri, 15 Sep 2023 12:51:56 -0500 Subject: [PATCH 66/85] Fix: return status for non activated alert --- pandora_server/lib/PandoraFMS/Core.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f7fb9be07b..f1cdecb7e0 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -743,8 +743,8 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) { # Check if the hiscorical value meets the condition compared to the val. $activate_alert = eval("$historical_value $condition $value"); } - - return $status if $activate_alert; + # Return $status if the alert is not activated + return $status if !$activate_alert; } } @@ -779,7 +779,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) { if(defined ($agent)) { pandora_mark_agent_for_alert_update ($dbh, $agent->{'id_agente'}); } - + return 0; #Launch the alert } From fbad0d9bccd3b8c53a2d47e201602c9edcdf3ee0 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Tue, 19 Sep 2023 13:31:44 -0500 Subject: [PATCH 67/85] Fix: Avg. math function for complex alert --- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f1cdecb7e0..e7ac485a1d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -738,7 +738,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) { my $activate_alert = 0; if($function eq "avg"){ # Check if the received value meets the condition compared to the avg. - $activate_alert = eval("$historical_value $condition $data"); + $activate_alert = eval("$data $condition $historical_value"); }else{ # Check if the hiscorical value meets the condition compared to the val. $activate_alert = eval("$historical_value $condition $value"); From 963664c1d892b000e99cf09c1b634f2ebe5cd96f Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 21 Sep 2023 01:00:30 +0200 Subject: [PATCH 68/85] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a589e1a0c0..780ba07f0a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230920 +Version: 7.0NG.773.3-230921 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 eba86c9733..51e0b3cf50 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.773.3-230920" +pandora_version="7.0NG.773.3-230921" 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 7ec3052669..ab9fb2f0e1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230920'; +use constant AGENT_BUILD => '230921'; # 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 72745dabf3..e80d8f76fb 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230920 +%define release 230921 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 62149a1d3c..2ba1df6121 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230920 +%define release 230921 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index aea35e8db1..651f12f16c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230920 +%define release 230921 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 dd201308ba..268afacd7a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230920" +PI_BUILD="230921" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 33f0eec4a9..f8155e2f83 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230920} +{230921} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f9299a70fc..8df7c167e9 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.773.3 Build 230920") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230921") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 0f575db3e1..4b3c790c96 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230920))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230921))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f3fb008266..7ba6c9d828 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230920 +Version: 7.0NG.773.3-230921 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 68bfb73c96..e9aa2f3a84 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.773.3-230920" +pandora_version="7.0NG.773.3-230921" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1aa04e2dd1..ae0029c5da 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 = 'PC230920'; +$build_version = 'PC230921'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 02d7d042c7..c4b30d898a 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 91747db77e..642d722b04 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230920 +%define release 230921 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 654c2ef7f6..6bc612d9c5 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230920 +%define release 230921 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 39af106794..2c36327c78 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230920" +PI_BUILD="230921" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a78e036eba..89fcc1ac10 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 230920"; +my $version = "7.0NG.773.3 Build 230921"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ba3091f219..0f057bb948 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.773.3 Build 230920"; +my $version = "7.0NG.773.3 Build 230921"; # save program name for logging my $progname = basename($0); From 23756e8495e0ee81a5fbbbd7d5025a31e9658e32 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 21 Sep 2023 08:46:09 +0200 Subject: [PATCH 69/85] #12038 header link setup --- pandora_console/general/header.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index a77548de53..6811fe9ae6 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -352,6 +352,21 @@ echo sprintf('
', $menuTypeClass); $display_counter = 'display:none'; } + $header_setup = ''; + if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { + $header_setup .= ''; + } + $header_autorefresh = '
'; $header_autorefresh .= $autorefresh_link_open_img; $header_autorefresh .= $autorefresh_img; @@ -428,7 +443,7 @@ echo sprintf('
', $menuTypeClass); ); // Logout. - $header_logout = '
'; + $header_logout = '
'; $header_logout .= html_print_image( 'images/sign_out@header.svg', true, @@ -454,7 +469,7 @@ echo sprintf('
', $menuTypeClass); } else { echo '
'.$config['custom_title_header'].''.$config['custom_subtitle_header'].'
'.$header_searchbar.'
-
'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_user, $header_logout.'
'; +
'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_setup, $header_user, $header_logout.'
'; } ?>
From 192ec72b327713a851a32e8b1d2b543d9ec5f378 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 21 Sep 2023 10:06:08 +0200 Subject: [PATCH 70/85] #12038 header link setup --- pandora_console/general/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 6811fe9ae6..28311371bf 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -361,7 +361,7 @@ echo sprintf('
'; From b1858a03f19fde068cf9af978d4751a4d41f09d5 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Thu, 21 Sep 2023 11:23:07 +0200 Subject: [PATCH 71/85] Debugging agent binary el8 and el9 spec file --- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 1 + pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index f18f3237e4..c8a22e7735 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -6,6 +6,7 @@ %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 %define release 230919 +%define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 511146f1e0..d46a3ac9d0 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -6,6 +6,7 @@ %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 %define release 230919 +%define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version Name: %{name} From a3f27ceb0128038563c5a64c6c2d27b364e25433 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Thu, 21 Sep 2023 12:19:13 +0200 Subject: [PATCH 72/85] Added require perl for agent binary rpm as plugins need it --- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 1 + pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 1 + pandora_agents/unix/pandora_agent.redhat_bin.spec | 1 + 3 files changed, 3 insertions(+) diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index c8a22e7735..ea817c10fe 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -27,6 +27,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: coreutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk +Requires: perl Requires: libnsl AutoReq: 0 Provides: %{name}-%{version} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index d46a3ac9d0..20bbad681f 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -27,6 +27,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: coreutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk +Requires: perl Requires: libnsl Requires: libxcrypt-compat AutoReq: 0 diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 771d5bd3c3..8ab3701319 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -26,6 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: coreutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk +Requires: perl #Requires: libnsl AutoReq: 0 Provides: %{name}-%{version} From 7fc3b3214230f7632eeda49751376355a784142d Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Thu, 21 Sep 2023 12:43:10 +0200 Subject: [PATCH 73/85] Added perl deps to el8 and el9 agent rpm --- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 5 +++-- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index ea817c10fe..4696d0bb87 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -10,7 +10,7 @@ Summary: Pandora FMS Linux agent, binary version Name: %{name} -Version: %{version} +Version: %{version}.el8 Release: %{release} License: GPL Vendor: ArticaST @@ -27,7 +27,8 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: coreutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk -Requires: perl +Requires: perl-interpreter +Requires: perl-IO-Compress Requires: libnsl AutoReq: 0 Provides: %{name}-%{version} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 20bbad681f..765ecd402f 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -10,7 +10,7 @@ Summary: Pandora FMS Linux agent, binary version Name: %{name} -Version: %{version} +Version: %{version}.el9 Release: %{release} License: GPL Vendor: ArticaST @@ -27,7 +27,8 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: coreutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk -Requires: perl +Requires: perl-interpreter +Requires: perl-IO-Compress Requires: libnsl Requires: libxcrypt-compat AutoReq: 0 From 7d5f4f17c611f02925d96b83e822d46ea7270776 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 21 Sep 2023 13:06:39 +0200 Subject: [PATCH 74/85] #12097 Fix view summary in discovery task --- .../include/javascript/pandora_taskList.js | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/javascript/pandora_taskList.js b/pandora_console/include/javascript/pandora_taskList.js index 0d0b1f8298..8c8c7c180f 100644 --- a/pandora_console/include/javascript/pandora_taskList.js +++ b/pandora_console/include/javascript/pandora_taskList.js @@ -25,7 +25,15 @@ function progress_task_list(id, title) { draggable: true, closeOnEscape: true, width: 800, - height: 600, + height: "auto", + buttons: [ + { + text: "OK", + click: function() { + $(this).dialog("close"); + } + } + ], close: function() { if (xhr != null) xhr.abort(); if (timeoutRef != null) clearTimeout(timeoutRef); @@ -35,12 +43,18 @@ function progress_task_list(id, title) { // Function var. var handleFetchTaskList = function(err, data) { if (err) { - console.error(err); + let err_text = err.toString(); + err_text = err_text.replace("Error: ", ""); + err_text = + "Error
" + err_text[0].toUpperCase() + err_text.substring(1); + $elem.html(err_text); } - if (data.error) { - // TODO: Show info about the problem. - $elem.html(data.error); - } else { + if (data) { + data = data.replace( + '', + "" + ); + data = JSON.parse(data); $elem.html(data.html); } @@ -71,7 +85,7 @@ function fetchTaskList(id, callback) { }, type: "POST", url: $("#ajax-url").val(), - dataType: "json", + dataType: "text", success: function(data) { callback(null, data); }, From d7f774bf576a5232b75b9540766e0124a00de53a Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 21 Sep 2023 13:12:11 +0200 Subject: [PATCH 75/85] #12099 Fix filter header --- pandora_console/operation/reporting/reporting_viewer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index f84ecdb699..8a23c4fa69 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -284,8 +284,8 @@ ui_print_standard_header( // ------------------------ INIT FORM ----------------------------------- $table2 = new stdClass(); $table2->id = 'controls_table'; -$table2->size[2] = '20%'; -$table2->style[3] = 'position:absolute; left: auto'; +// $table2->size[2] = '20%'; +// $table2->style[3] = 'position:absolute; left: auto'; $table2->styleTable = 'border:none'; if (defined('METACONSOLE')) { From 80b0522c7ca1f75e9c541373bbc1f5008ad43053 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 21 Sep 2023 14:21:54 +0200 Subject: [PATCH 76/85] #12097 Fix view discovery --- pandora_console/include/javascript/pandora_taskList.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/javascript/pandora_taskList.js b/pandora_console/include/javascript/pandora_taskList.js index 8c8c7c180f..043203276c 100644 --- a/pandora_console/include/javascript/pandora_taskList.js +++ b/pandora_console/include/javascript/pandora_taskList.js @@ -50,12 +50,10 @@ function progress_task_list(id, title) { $elem.html(err_text); } if (data) { - data = data.replace( - '', - "" - ); + let split_data = data.split('{"html":'); + data = '{"html":' + split_data[1]; data = JSON.parse(data); - $elem.html(data.html); + $elem.html(data.html + " " + split_data[0]); } if (!$elem.dialog("isOpen")) $elem.dialog("open"); From ea2d663c287fb88e284bccfda065a745a39dc5ec Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Thu, 21 Sep 2023 15:57:14 +0200 Subject: [PATCH 77/85] Fixed el8 and el9 agents spec file --- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 4696d0bb87..1615f10ae1 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -10,7 +10,7 @@ Summary: Pandora FMS Linux agent, binary version Name: %{name} -Version: %{version}.el8 +Version: %{version} Release: %{release} License: GPL Vendor: ArticaST diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 765ecd402f..0f63a6d626 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -10,7 +10,7 @@ Summary: Pandora FMS Linux agent, binary version Name: %{name} -Version: %{version}.el9 +Version: %{version} Release: %{release} License: GPL Vendor: ArticaST From e637866f722d331cb59b09a9a42f49be3d410850 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 21 Sep 2023 16:11:58 +0200 Subject: [PATCH 78/85] #12100 Fix custom graph --- .../include/javascript/graph_analytics.js | 16 ++++++++++++++-- .../operation/reporting/graph_analytics.php | 6 +++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/javascript/graph_analytics.js b/pandora_console/include/javascript/graph_analytics.js index e63540ae08..6c14f3f8c8 100644 --- a/pandora_console/include/javascript/graph_analytics.js +++ b/pandora_console/include/javascript/graph_analytics.js @@ -653,7 +653,8 @@ $("[data-button=export]").click(function(e) { }); }); -$("#button-export-modal").click(function(e) { +// Export graph. +function exportCustomGraph() { const filter = parseInt($("#export-filter-id").val()); const group = parseInt($("#export-group-id").val()); @@ -682,8 +683,19 @@ $("#button-export-modal").click(function(e) { } } }); + } else { + confirmDialog({ + title: titleExportError, + message: messageExportError, + hideCancelButton: true, + onAccept: function() { + $( + "button.ui-button.ui-corner-all.ui-widget.ui-button-icon-only.ui-dialog-titlebar-close" + ).click(); + } + }); } -}); +} // Remove graph. function removeGraph(e) { diff --git a/pandora_console/operation/reporting/graph_analytics.php b/pandora_console/operation/reporting/graph_analytics.php index 9b2fa5347d..8797376070 100644 --- a/pandora_console/operation/reporting/graph_analytics.php +++ b/pandora_console/operation/reporting/graph_analytics.php @@ -636,7 +636,7 @@ $data[2] = html_print_submit_button( 'class' => 'mini w30p', 'icon' => 'next', 'style' => 'margin-left: 208px; width: 130px;', - 'onclick' => '', + 'onclick' => 'exportCustomGraph()', ], true ); @@ -937,6 +937,10 @@ const titleExport = ""; const titleExportConfirm = ""; const messageExportConfirm = ""; +const titleExportError = ""; +const messageExportError = ""; + const titleRemoveConfirm = ""; const messageRemoveConfirm = ""; + \ No newline at end of file From b706376fa770d5d30ca6c3404fd7259db7365db1 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 22 Sep 2023 01:00:25 +0200 Subject: [PATCH 79/85] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 780ba07f0a..3c281c87ba 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230921 +Version: 7.0NG.773.3-230922 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 51e0b3cf50..d0027220b8 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.773.3-230921" +pandora_version="7.0NG.773.3-230922" 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 ab9fb2f0e1..30ac857f3e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230921'; +use constant AGENT_BUILD => '230922'; # 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 e80d8f76fb..b4fa1f5dca 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230921 +%define release 230922 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index c61d0c9b8a..6d4a7e3364 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230921 +%define release 230922 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 651f12f16c..b160510e81 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230921 +%define release 230922 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 268afacd7a..7d8a527047 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230921" +PI_BUILD="230922" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f8155e2f83..15ba29ed3e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230921} +{230922} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8df7c167e9..65b87b89eb 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.773.3 Build 230921") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230922") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4b3c790c96..ae582d71a4 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230921))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230922))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7ba6c9d828..f69b69e4d3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230921 +Version: 7.0NG.773.3-230922 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 e9aa2f3a84..07d5528c9d 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.773.3-230921" +pandora_version="7.0NG.773.3-230922" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ae0029c5da..63b3fb2503 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 = 'PC230921'; +$build_version = 'PC230922'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c4b30d898a..9e9914ef23 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 642d722b04..6b86300609 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230921 +%define release 230922 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6bc612d9c5..6cc4be9bd8 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230921 +%define release 230922 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2c36327c78..0326c895bf 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230921" +PI_BUILD="230922" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 89fcc1ac10..c73494bf25 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 230921"; +my $version = "7.0NG.773.3 Build 230922"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0f057bb948..c63d923402 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.773.3 Build 230921"; +my $version = "7.0NG.773.3 Build 230922"; # save program name for logging my $progname = basename($0); From f2bda1e58d037d18f3814f69085bc050fe5bb5b3 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Fri, 22 Sep 2023 13:05:29 +0200 Subject: [PATCH 80/85] #12099 Fix filter position --- pandora_console/operation/reporting/reporting_viewer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 8a23c4fa69..4602292893 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -284,8 +284,7 @@ ui_print_standard_header( // ------------------------ INIT FORM ----------------------------------- $table2 = new stdClass(); $table2->id = 'controls_table'; -// $table2->size[2] = '20%'; -// $table2->style[3] = 'position:absolute; left: auto'; +$table2->style[3] = 'position:absolute !important; right: 1em !important;'; $table2->styleTable = 'border:none'; if (defined('METACONSOLE')) { From 7b3b1f9ccc46ffc405393a6468a4c8f6b73988cd Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 23 Sep 2023 01:00:21 +0200 Subject: [PATCH 81/85] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 3c281c87ba..0d0dbeb712 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230922 +Version: 7.0NG.773.3-230923 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 d0027220b8..99e5622bc3 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.773.3-230922" +pandora_version="7.0NG.773.3-230923" 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 30ac857f3e..454bfb5cee 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230922'; +use constant AGENT_BUILD => '230923'; # 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 b4fa1f5dca..71f1480f70 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230922 +%define release 230923 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 6d4a7e3364..c87f3ce8a1 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230922 +%define release 230923 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index b160510e81..33b41933df 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230922 +%define release 230923 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 7d8a527047..0603385be6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230922" +PI_BUILD="230923" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 15ba29ed3e..a2088a7253 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230922} +{230923} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 65b87b89eb..a2034d4458 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.773.3 Build 230922") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230923") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ae582d71a4..091f74eb95 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230922))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230923))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f69b69e4d3..c9698128d6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230922 +Version: 7.0NG.773.3-230923 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 07d5528c9d..344d40849b 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.773.3-230922" +pandora_version="7.0NG.773.3-230923" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 63b3fb2503..d2e914944c 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 = 'PC230922'; +$build_version = 'PC230923'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9e9914ef23..516df1f662 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6b86300609..ad89e5eb04 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230922 +%define release 230923 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6cc4be9bd8..86bdf41cd4 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230922 +%define release 230923 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 0326c895bf..5e8bd38b30 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230922" +PI_BUILD="230923" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index c73494bf25..4278c656df 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 230922"; +my $version = "7.0NG.773.3 Build 230923"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c63d923402..240c9bc79a 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.773.3 Build 230922"; +my $version = "7.0NG.773.3 Build 230923"; # save program name for logging my $progname = basename($0); From fa2e94eea3e2f3c712a908ee106b7843b180dd75 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 24 Sep 2023 01:00:19 +0200 Subject: [PATCH 82/85] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0d0dbeb712..759904b160 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230923 +Version: 7.0NG.773.3-230924 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 99e5622bc3..f7a89bb68a 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.773.3-230923" +pandora_version="7.0NG.773.3-230924" 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 454bfb5cee..b1d3c7793e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230923'; +use constant AGENT_BUILD => '230924'; # 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 71f1480f70..a3aa3043f6 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230923 +%define release 230924 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index c87f3ce8a1..8f764c8771 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230923 +%define release 230924 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 33b41933df..d844212fb1 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230923 +%define release 230924 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 0603385be6..a5b06c5b8c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230923" +PI_BUILD="230924" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a2088a7253..07027aa2b5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230923} +{230924} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a2034d4458..1ef83479aa 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.773.3 Build 230923") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230924") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 091f74eb95..2cfe06b822 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230923))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230924))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c9698128d6..4ff926b425 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230923 +Version: 7.0NG.773.3-230924 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 344d40849b..bb1506a5e2 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.773.3-230923" +pandora_version="7.0NG.773.3-230924" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d2e914944c..7e29cdf8db 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 = 'PC230923'; +$build_version = 'PC230924'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 516df1f662..24b864b5cf 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index ad89e5eb04..273c52d5c6 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230923 +%define release 230924 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 86bdf41cd4..17f0d1b258 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230923 +%define release 230924 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5e8bd38b30..26145ad162 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230923" +PI_BUILD="230924" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4278c656df..d61e16f7e7 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 230923"; +my $version = "7.0NG.773.3 Build 230924"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 240c9bc79a..25fa957fec 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.773.3 Build 230923"; +my $version = "7.0NG.773.3 Build 230924"; # save program name for logging my $progname = basename($0); From 8c19a075c3d8cfb8eb10665ee114a8699dc8e309 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 25 Sep 2023 01:00:18 +0200 Subject: [PATCH 83/85] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 759904b160..cfea14671f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-230924 +Version: 7.0NG.773.3-230925 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 f7a89bb68a..c51a0aaa6a 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.773.3-230924" +pandora_version="7.0NG.773.3-230925" 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 b1d3c7793e..88b801d5f8 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '230924'; +use constant AGENT_BUILD => '230925'; # 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 a3aa3043f6..0cd0a7b16e 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230924 +%define release 230925 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 8f764c8771..94f4117b59 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230924 +%define release 230925 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index d844212fb1..a7b716b780 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 230924 +%define release 230925 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 a5b06c5b8c..5cf54d4647 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230924" +PI_BUILD="230925" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 07027aa2b5..a488a9ba49 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230924} +{230925} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1ef83479aa..3f9e321731 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.773.3 Build 230924") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230925") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 2cfe06b822..0b497b64de 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 230924))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230925))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4ff926b425..4d5d470e50 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230924 +Version: 7.0NG.773.3-230925 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 bb1506a5e2..79c1e26151 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.773.3-230924" +pandora_version="7.0NG.773.3-230925" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7e29cdf8db..09b4ac8abb 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 = 'PC230924'; +$build_version = 'PC230925'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 24b864b5cf..8db1222e10 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 273c52d5c6..3479250605 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230924 +%define release 230925 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 17f0d1b258..44e0c70b90 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 230924 +%define release 230925 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 26145ad162..dfc39ed2d1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="230924" +PI_BUILD="230925" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d61e16f7e7..0ef046a352 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 230924"; +my $version = "7.0NG.773.3 Build 230925"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 25fa957fec..bf4523e252 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.773.3 Build 230924"; +my $version = "7.0NG.773.3 Build 230925"; # save program name for logging my $progname = basename($0); From 9a5a1f02bfbabb41e3c452af73a949afa559ee74 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 25 Sep 2023 09:55:55 +0200 Subject: [PATCH 84/85] #12099 Fix filter position --- pandora_console/include/styles/pandora.css | 11 +++++++++++ .../operation/reporting/reporting_viewer.php | 13 +++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8d6fa524d4..817b415860 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12566,3 +12566,14 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input { .ui-date-range-in > a { background-color: #81b92e3b !important; } + +.div-report_export_filter { + left: -7em; + position: absolute; +} + +.button-export_filter { + position: absolute; + left: 7em; + margin-top: 20px; +} diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 4602292893..4465b965ab 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -284,7 +284,9 @@ ui_print_standard_header( // ------------------------ INIT FORM ----------------------------------- $table2 = new stdClass(); $table2->id = 'controls_table'; -$table2->style[3] = 'position:absolute !important; right: 1em !important;'; +$table2->size[2] = '20%'; +$table2->style[3] = 'position:absolute !important; left: auto !important;'; +// $table2->style[3] = 'position:absolute !important; right: 1em !important;'; $table2->styleTable = 'border:none'; if (defined('METACONSOLE')) { @@ -328,8 +330,9 @@ $Actionbuttons .= html_print_submit_button( 'date_submit', false, [ - 'mode' => 'mini', - 'icon' => 'next', + 'mode' => 'mini', + 'icon' => 'next', + 'style' => 'position: absolute; top: 25px;', ], true ); @@ -431,7 +434,9 @@ $(document).ready (function () { $("#string_items").show(); } }); - + $('#div-report_export').addClass('div-report_export_filter'); + $('#button-export').addClass('button-export_filter '); + $('#report_export_menu').removeClass('right'); }); From 4b999b79d3439f89893817a0294585bdb6112462 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 25 Sep 2023 10:57:46 +0200 Subject: [PATCH 85/85] #12099 Fix filter position --- pandora_console/include/functions_html.php | 4 ++ pandora_console/include/styles/pandora.css | 17 ++++-- .../operation/reporting/reporting_viewer.php | 54 +++++++++++++------ 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index cd4a00bf4d..599a48360e 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -7384,11 +7384,15 @@ function html_print_select_date_range( $('#".$name."_default').hide(); $('#".$name."_extend').hide(); $('#hidden-custom_date').val('1'); + $('.filter_label_position_before').addClass('filter_label_position_after'); } else if ($(this).val() === 'custom') { $('#".$name."_range').hide(); $('#".$name."_default').hide(); $('#".$name."_extend').show(); $('#hidden-custom_date').val('2'); + $('.filter_label_position_before').removeClass('filter_label_position_after'); + } else { + $('.filter_label_position_before').removeClass('filter_label_position_after'); } }); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 817b415860..c7f9671564 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12568,12 +12568,19 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input { } .div-report_export_filter { - left: -7em; - position: absolute; + left: 0em; + top: 0em; + position: relative; } .button-export_filter { - position: absolute; - left: 7em; - margin-top: 20px; + position: relative; + left: 17em; + top: -38px; + width: 30%; +} + +.filter_label_position_after { + position: relative; + top: -92px; } diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index 4465b965ab..e3e07590ba 100755 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -312,11 +312,19 @@ if ($html_menu_export === ENTERPRISE_NOT_HOOK) { $html_menu_export = ''; } +if ((bool) is_metaconsole() === true) { + $table2->data[0][2] = html_print_label_input_block( + __('Date').' ', + html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text), + ); +} else { + $table2->data[0][2] = html_print_label_input_block( + __('Date').' ', + html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text), + ['label_class' => 'filter_label_position_before'] + ); +} -$table2->data[0][2] = html_print_label_input_block( - __('Date').':
', - html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text) -); $table2->data[0][3] = $html_menu_export; @@ -325,17 +333,32 @@ $searchForm = '
'mini', - 'icon' => 'next', - 'style' => 'position: absolute; top: 25px;', - ], - true -); +if ((bool) is_metaconsole() === true) { + $Actionbuttons .= html_print_submit_button( + __('Update'), + 'date_submit', + false, + [ + 'mode' => 'mini', + 'icon' => 'next', + 'style' => 'position: absolute; top: 60px;', + ], + true + ); +} else { + $Actionbuttons .= html_print_submit_button( + __('Update'), + 'date_submit', + false, + [ + 'mode' => 'mini', + 'icon' => 'next', + 'style' => 'position: absolute; top: 20px;', + ], + true + ); +} + $searchForm .= html_print_div( [ @@ -428,6 +451,7 @@ $(document).ready (function () { $("#string_to").show(); $('#string_from').show(); $("#string_items").hide(); + console.log($(".filter_label_position_before").html()); } else { $("#string_to").hide(); $('#string_from').hide();