From 9cf50d005cc1b34676de072b348f41c7c9847b7e Mon Sep 17 00:00:00 2001 From: KANAYAMA Akihiro Date: Tue, 20 Dec 2022 12:06:18 +0900 Subject: [PATCH 01/87] fixed typo --- pandora_server/util/plugin/pandora_snmp_bandwidth.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/plugin/pandora_snmp_bandwidth.pl b/pandora_server/util/plugin/pandora_snmp_bandwidth.pl index 9b28848b48..db38b8444d 100755 --- a/pandora_server/util/plugin/pandora_snmp_bandwidth.pl +++ b/pandora_server/util/plugin/pandora_snmp_bandwidth.pl @@ -563,7 +563,7 @@ foreach my $iface (keys %{$analysis_tree}) { $inUsage += $analysis_tree->{$iface}{'inUsage'}; $j++; } - if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'inUsage'} == 0) { + if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'outUsage'} == 0) { $outUsage += $analysis_tree->{$iface}{'outUsage'}; $k++; } From b64c1ee44c9d2c59bb068c13de7a1cd7d368d9b4 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 23 Jan 2023 16:19:54 +0100 Subject: [PATCH 02/87] #9517 Custom sql - Agent safe mode not enable --- pandora_console/extras/mr/63.sql | 5 +++++ pandora_console/pandoradb_data.sql | 1 + 2 files changed, 6 insertions(+) create mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql new file mode 100644 index 0000000000..2b7081cf1d --- /dev/null +++ b/pandora_console/extras/mr/63.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +INSERT INTO `pandora`.`treport_custom_sql` (`id`, `name`, `sql`) VALUES ('5', 'Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); + +COMMIT; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 9a0baba05e..6dd3000466 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1165,6 +1165,7 @@ INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring&#x INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.alias from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_nombre, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by nombre;'); INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (3, 'Monitoring Report Alerts', 'select t1.alias as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;'); INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (4, 'Group view', 'select t1.nombre, (select count(t3.id_agente) from tagente as t3 where t1.id_grupo = t3.id_grupo) as agents, (SELECT COUNT(t4.id_agente) FROM tagente as t4 WHERE t4.id_grupo = t1.id_grupo AND t4.disabled = 0 AND t4.ultimo_contacto < NOW() - (intervalo / (1/2))) as agent_unknown, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND utimestamp > 0 AND tagente_modulo.id_tipo_modulo NOT IN(21,22,23,24,100) AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval / (1/2))) as monitor_unknow, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,24) AND utimestamp = 0) as monitor_no_init, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 0 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24)))) as monitor_ok, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 1 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND utimestamp > 0) as monitor_critical, (SELECT COUNT(talert_template_modules.id) FROM talert_template_modules, tagente_modulo, tagente_estado, tagente WHERE tagente.id_grupo = t1.id_grupo AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente.disabled = 0 AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo AND times_fired > 0) as monitor_alert_fired from tgrupo as t1 where 0 < (select count(t2.id_agente) from tagente as t2 where t1.id_grupo = t2.id_grupo)'); +INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (5, 'Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); -- trecon scripts INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (1, 'Discovery.Application.VMware', 'Discovery Application script to monitor VMware technologies (ESXi, VCenter, VSphere)', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); From 01ed220e1f16e14f98b54b5aed0bcbfbd9f13998 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 24 Jan 2023 10:16:31 +0100 Subject: [PATCH 03/87] #9517 Custom sql - Agent safe mode not enable --- pandora_console/extras/mr/63.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql index 2b7081cf1d..fe2ebe095f 100644 --- a/pandora_console/extras/mr/63.sql +++ b/pandora_console/extras/mr/63.sql @@ -1,5 +1,5 @@ START TRANSACTION; -INSERT INTO `pandora`.`treport_custom_sql` (`id`, `name`, `sql`) VALUES ('5', 'Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); COMMIT; From 1e7cbb552165a9992f7ba85166bdc97e4ddff964 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 24 Jan 2023 10:18:01 +0100 Subject: [PATCH 04/87] #9517 Custom sql - Agent safe mode not enable --- pandora_console/extras/mr/63.sql | 2 +- pandora_console/pandoradb_data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql index fe2ebe095f..401d4a748c 100644 --- a/pandora_console/extras/mr/63.sql +++ b/pandora_console/extras/mr/63.sql @@ -1,5 +1,5 @@ START TRANSACTION; -INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); COMMIT; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 6dd3000466..3e0e32e449 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1165,7 +1165,7 @@ INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring&#x INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.alias from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_nombre, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by nombre;'); INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (3, 'Monitoring Report Alerts', 'select t1.alias as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;'); INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (4, 'Group view', 'select t1.nombre, (select count(t3.id_agente) from tagente as t3 where t1.id_grupo = t3.id_grupo) as agents, (SELECT COUNT(t4.id_agente) FROM tagente as t4 WHERE t4.id_grupo = t1.id_grupo AND t4.disabled = 0 AND t4.ultimo_contacto < NOW() - (intervalo / (1/2))) as agent_unknown, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND utimestamp > 0 AND tagente_modulo.id_tipo_modulo NOT IN(21,22,23,24,100) AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval / (1/2))) as monitor_unknow, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,24) AND utimestamp = 0) as monitor_no_init, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 0 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24)))) as monitor_ok, (SELECT COUNT(tagente_estado.id_agente_estado) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.id_grupo = t1.id_grupo AND tagente.disabled = 0 AND tagente_estado.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND estado = 1 AND ((UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) < (tagente_estado.current_interval / (1/2)) OR (tagente_modulo.id_tipo_modulo IN(21,22,23,24,100))) AND utimestamp > 0) as monitor_critical, (SELECT COUNT(talert_template_modules.id) FROM talert_template_modules, tagente_modulo, tagente_estado, tagente WHERE tagente.id_grupo = t1.id_grupo AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 AND tagente.disabled = 0 AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo AND times_fired > 0) as monitor_alert_fired from tgrupo as t1 where 0 < (select count(t2.id_agente) from tagente as t2 where t1.id_grupo = t2.id_grupo)'); -INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (5, 'Agent safe mode not enable', 'select nombre from tagente where safe_mode_module = 0'); +INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (5, 'Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); -- trecon scripts INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (1, 'Discovery.Application.VMware', 'Discovery Application script to monitor VMware technologies (ESXi, VCenter, VSphere)', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration file","help":"","value":"","hide":""}}'); From 902a8437651782d95400c87a26303c08d9e98657 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 25 Jan 2023 17:22:54 +0100 Subject: [PATCH 05/87] implemented agents view filter management --- pandora_console/extras/mr/63.sql | 18 + pandora_console/include/ajax/agent.php | 518 ++++++++++++++++++ pandora_console/include/functions_agents.php | 44 +- .../operation/agentes/estado_agente.php | 472 ++++++++++++++-- pandora_console/pandoradb.sql | 18 + 5 files changed, 1009 insertions(+), 61 deletions(-) create mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql new file mode 100644 index 0000000000..8937d5730f --- /dev/null +++ b/pandora_console/extras/mr/63.sql @@ -0,0 +1,18 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tagent_filter` ( + `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_name` VARCHAR(600) NOT NULL, + `id_group_filter` INT NOT NULL DEFAULT 0, + `group_id` INT NOT NULL DEFAULT 0, + `recursion` TEXT, + `status` INT NOT NULL DEFAULT -1, + `search` TEXT, + `id_os` INT NOT NULL DEFAULT 0, + `policies` TEXT, + `search_custom` TEXT, + `ag_custom_fields` TEXT, + PRIMARY KEY (`id_filter`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 48abefdc7e..5ba3f90799 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -31,6 +31,14 @@ $get_agents_interfaces = (bool) get_parameter('get_agents_interfaces'); $id_agents = get_parameter('id_agents', []); $get_agents_group = (bool) get_parameter('get_agents_group', false); $force_local = (bool) get_parameter('force_local', false); + +// Agent detail filter. +$load_filter_modal = get_parameter('load_filter_modal', 0); +$save_filter_modal = get_parameter('save_filter_modal', 0); +$get_agent_filters = get_parameter('get_agent_filters', 0); +$save_agent_filter = get_parameter('save_agent_filter', 0); +$update_agent_filter = get_parameter('update_agent_filter', 0); + if (https_is_running()) { header('Content-type: application/json'); } @@ -345,4 +353,514 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { return; } +// Saves an event filter. +if ($save_agent_filter) { + $values = []; + $values['id_name'] = get_parameter('id_name'); + $values['group_id'] = get_parameter('group_id'); + $values['recursion'] = get_parameter('recursion'); + $values['status'] = get_parameter('status'); + $values['search'] = get_parameter('search'); + $values['id_os'] = get_parameter('id_os'); + $values['policies'] = json_encode(get_parameter('policies')); + $values['search_custom'] = get_parameter('search_custom'); + $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + + $exists = (bool) db_get_value_filter( + 'id_filter', + 'tagent_filter', + $values + ); + + if ($exists === true) { + echo 'duplicate'; + } else { + $result = db_process_sql_insert('tagent_filter', $values); + + if ($result === false) { + echo 'error'; + } else { + echo $result; + } + } +} + +if ($update_agent_filter) { + $values = []; + $id = get_parameter('id'); + + $values['group_id'] = get_parameter('group_id'); + $values['recursion'] = get_parameter('recursion'); + $values['status'] = get_parameter('status'); + $values['search'] = get_parameter('search'); + $values['id_os'] = get_parameter('id_os'); + $values['policies'] = json_encode(get_parameter('policies')); + $values['search_custom'] = get_parameter('search_custom'); + $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + + $result = db_process_sql_update( + 'tagent_filter', + $values, + ['id_filter' => $id] + ); + + if ($result === false) { + echo 'error'; + } else { + echo 'ok'; + } +} + +if ($get_agent_filters) { + $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + + $agent_filters = db_get_all_rows_sql($sql); + + $result = []; + + if ($agent_filters !== false) { + foreach ($agent_filters as $agent_filter) { + $result[$agent_filter['id_filter']] = $agent_filter['id_name']; + } + } + + echo io_json_mb_encode($result); +} + +if ((int) $load_filter_modal === 1) { + $user_groups = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all(), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $event_filters = db_get_all_rows_sql($sql); + + $filters = []; + foreach ($event_filters as $event_filter) { + $filters[$event_filter['id_filter']] = $event_filter['id_name']; + } + + echo '
'; + echo '
'; + + $table = new StdClass; + $table->id = 'load_filter_form'; + $table->width = '100%'; + $table->cellspacing = 4; + $table->cellpadding = 4; + $table->class = 'databox'; + if (is_metaconsole()) { + $table->cellspacing = 0; + $table->cellpadding = 0; + $table->class = 'databox filters'; + } + + $table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; + $filter_id_width = '200px'; + if (is_metaconsole()) { + $filter_id_width = '150px'; + } + + $data = []; + $table->rowid[3] = 'update_filter_row1'; + $data[0] = __('Load filter').$jump; + $data[0] .= html_print_select( + $filters, + 'filter_id', + $current, + '', + __('None'), + 0, + true, + false, + true, + '', + false, + 'margin-left:5px; width:'.$filter_id_width.';' + ); + + $data[1] = html_print_submit_button( + __('Load filter'), + 'load_filter', + false, + 'class="sub upd"', + true + ); + $data[1] .= html_print_input_hidden('load_filter', 1, true); + $table->data[] = $data; + $table->rowclass[] = ''; + html_print_table($table); + echo '
'; + echo '
'; + ?> + + + '; + if (check_acl($config['id_user'], 0, 'AW')) { + echo '
'; + + $table = new StdClass; + $table->id = 'save_filter_form'; + $table->width = '100%'; + $table->cellspacing = 4; + $table->cellpadding = 4; + $table->class = 'databox'; + + if (is_metaconsole() === true) { + $table->class = 'databox filters'; + $table->cellspacing = 0; + $table->cellpadding = 0; + } + + $table->styleTable = 'font-weight: bold; text-align:left;'; + + if (is_metaconsole() === true) { + $table->style[0] = 'width: 50%; width:50%;'; + } + + $data = []; + $table->rowid[0] = 'update_save_selector'; + $data[0] = html_print_radio_button( + 'filter_mode', + 'new', + '', + true, + true + ).__('New filter').''; + + $data[1] = html_print_radio_button( + 'filter_mode', + 'update', + '', + false, + true + ).__('Update filter').''; + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[1] = 'save_filter_row1'; + $data[0] = __('Filter name').$jump; + $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); + + if (is_metaconsole() === true) { + $data[1] = __('Save in Group').$jump; + } else { + $data[1] = __('Filter group').$jump; + } + + $user_groups_array = users_get_groups_for_select( + $config['id_user'], + 'EW', + users_can_manage_group_all(), + true + ); + + $data[1] .= html_print_select( + $user_groups_array, + 'id_group_filter_dialog', + $id_group_filter, + '', + '', + 0, + true, + false, + false, + 'w130' + ); + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[2] = 'save_filter_row2'; + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[3] = 'update_filter_row1'; + $data[0] = __('Overwrite filter').$jump; + + $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + $agent_filters = db_get_all_rows_sql($sql); + + $_filters_update = []; + + if ($agent_filters !== false) { + foreach ($agent_filters as $agent_filter) { + $_filters_update[$agent_filter['id_filter']] = $agent_filter['id_name']; + } + } + + $data[0] .= html_print_select( + $_filters_update, + 'overwrite_filter', + '', + '', + '', + 0, + true + ); + $data[1] = html_print_submit_button( + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + + $table->data[] = $data; + $table->rowclass[] = ''; + + html_print_table($table); + echo '
'; + echo html_print_submit_button( + __('Save filter'), + 'save_filter', + false, + 'class="sub upd float-right" onclick="save_new_filter();"', + true + ); + echo '
'; + } else { + include 'general/noaccess.php'; + } + + echo ''; + ?> + + 0) { + $user_groups_fl = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all(), + true + ); + + $sql = sprintf( + 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_filter = %d AND id_group_filter IN (%s)', + $load_filter_id, + implode(',', array_keys($user_groups_fl)) + ); + + $loaded_filter = db_get_row_sql($sql); +} + +if ($loaded_filter['id_filter'] > 0) { + $query_filter['id_filter'] = $load_filter_id; + $filter = db_get_row_filter('tagent_filter', $query_filter, false); + + if ($filter !== false) { + $group_id = (int) $filter['group_id']; + $recursion = $filter['recursion']; + $status = $filter['status']; + $search = $filter['search']; + $os = $filter['id_os']; + $policies = json_decode($filter['policies'], true); + $search_custom = $filter['search_custom']; + $ag_custom_fields = $filter['ag_custom_fields']; + } + + + if (is_array($ag_custom_fields) === false) { + $ag_custom_fields = json_decode(io_safe_output($ag_custom_fields), true); + } + + if (is_array($policies) === false) { + $policies = json_decode(io_safe_output($policies), true); + } +} + if (check_acl($config['id_user'], 0, 'AW')) { // Prepare the tab system to the future. $tab = 'setup'; @@ -247,22 +297,47 @@ if (isset($result_delete)) { echo '
'; -echo ''; +//echo '
'; -echo ''; +html_print_table($table); -echo '
'; +//echo '
'; -echo __('Group').' '.' '.' '; +// Start Build Search Form. +// +$table = new StdClass(); +$table->width = '100%'; +$table->cellspacing = 0; +$table->cellpadding = 0; +$table->class = 'databox filters'; +$table->style[0] = 'font-weight: bold;'; +$table->style[1] = 'font-weight: bold;'; +$table->style[2] = 'font-weight: bold;'; +$table->style[3] = 'font-weight: bold;'; +$table->style[4] = 'font-weight: bold;'; + +$table->data[0][0] = __('Group'); +$table->data[0][0] .= '
'; $groups = users_get_groups(false, $access); -html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false); +$table->data[0][0] .= html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false); -echo '
'.' '.' '.' '.' '.' '; +//$table->data[0][1] .= '  '; -echo __('Recursion').' '.' '.' '; -html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()'); +$table->data[0][0] .= __('Recursion').' '.' '.' '; +$table->data[0][0] .= html_print_input( + [ + 'type' => 'checkbox', + 'name' => 'recursion', + 'return' => true, + 'checked' => $recursion, + 'checked' => ($recursion === true || $recursion === 'true' || $recursion === '1') ? 'checked' : false, + 'value' => 1, + ] +); -echo ''; + + +//echo ''; $fields = []; $fields[AGENT_STATUS_NORMAL] = __('Normal'); @@ -272,31 +347,125 @@ $fields[AGENT_STATUS_UNKNOWN] = __('Unknown'); $fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal'); $fields[AGENT_STATUS_NOT_INIT] = __('Not init'); -echo __('Status').' '.' '.' '; -html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, false, false, true, '', false, 'width: 90px;'); +$table->data[0][1] = __('Status').' '.' '.' '; +$table->data[0][1] .= html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, true, false, true, '', false, 'width: 90px;'); -echo ''; +$table->data[0][2] = __('Search').' '.' '.' '; +$table->data[0][2] .= html_print_input_text('search', $search, '', 15, 255, true); -echo __('Search').' '.' '.' '; -html_print_input_text('search', $search, '', 15); +$table->data[1][0] = __('Operating System').' '; -echo ''; +$pre_fields = db_get_all_rows_sql( + 'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os' +); +$fields = []; -echo __('Search in custom fields').' '.' '.' '; -html_print_input_text('search_custom', $search_custom, '', 15); +foreach ($pre_fields as $key => $value) { + $fields[$value['id_os']] = $value['name']; +} -echo ''; +$table->data[1][0] .= html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0, true); -html_print_submit_button( +$table->data[1][1] = __('Policies').' '; + +$pre_fields = policies_get_policies(false, ['id', 'name']); +$fields = []; + +foreach ($pre_fields as $value) { + $fields[$value['id']] = $value['name']; +} + +$table->data[1][1] .= html_print_select($fields, 'policies[]', $policies, '', 'All', 0, true, true); + +$table->data[1][2] = __('Search in custom fields').' '.' '.' '; +$table->data[1][2] .= html_print_input_text('search_custom', $search_custom, '', 15, 255, true); + + +$custom_fields = db_get_all_fields_in_table('tagent_custom_fields'); +if ($custom_fields === false) { + $custom_fields = []; +} + +$div_custom_fields = '
'; +foreach ($custom_fields as $custom_field) { + $custom_field_value = ''; + if (empty($ag_custom_fields) === false) { + $custom_field_value = $ag_custom_fields[$custom_field['id_field']]; + if (empty($custom_field_value) === true) { + $custom_field_value = ''; + } + } + + $div_custom_fields .= '
'; + + $div_custom_fields .= '
'; + $div_custom_fields .= ''.$custom_field['name'].''; + $div_custom_fields .= '
'; + + $div_custom_fields .= '
'; + $div_custom_fields .= html_print_input_text( + 'ag_custom_fields['.$custom_field['id_field'].']', + $custom_field_value, + '', + 0, + 300, + true, + false, + false, + '', + 'div-input' + ); + $div_custom_fields .= '
'; +} + +$table->colspan[2][0] = 7; +$table->cellstyle[2][0] = 'padding-left: 10px;'; +$table->data[2][0] = ui_toggle( + $div_custom_fields, + __('Agent custom fields'), + '', + '', + true, + true, + '', + 'white-box-content', + 'white_table_graph' +); + + +$table->colspan[4][0] = 4; +$table->cellstyle[4][0] = 'padding-top: 0px;'; +$table->data[4][0] = html_print_button( + __('Load filter'), + 'load-filter', + false, + '', + 'class="float-left margin-right-2 sub config"', + true +); + +$table->cellstyle[4][0] .= 'padding-top: 0px;'; +$table->data[4][0] .= html_print_button( + __('Save filter'), + 'save-filter', + false, + '', + 'class="float-left margin-right-2 sub wand"', + true +); + +$table->cellstyle[4][2] = 'padding-top: 0px;'; +$table->data[4][2] = html_print_submit_button( __('Search'), 'srcbutton', '', - ['class' => 'sub search'] + ['class' => 'sub search'], + true ); -echo '
'; +''; if ($search != '') { $filter = ['string' => '%'.$search.'%']; @@ -320,6 +489,8 @@ $selectDescriptionUp = false; $selectDescriptionDown = false; $selectLastContactUp = false; $selectLastContactDown = false; +$selectLastStatusChangeUp = false; +$selectLastStatusChangeDown = false; $order = null; switch ($sortField) { @@ -479,6 +650,32 @@ switch ($sortField) { } break; + case 'last_status_change': + switch ($sort) { + case 'up': + $selectLastStatusChangeUp = $selected; + $order = [ + 'field' => 'last_status_change', + 'field2' => 'alias', + 'order' => 'ASC', + ]; + break; + + case 'down': + $selectLastStatusChangeDown = $selected; + $order = [ + 'field' => 'last_status_change', + 'field2' => 'alias', + 'order' => 'DESC', + ]; + break; + + default: + // Default. + break; + } + break; + case 'description': switch ($sort) { case 'up': @@ -518,6 +715,8 @@ switch ($sortField) { $selectDescriptionDown = false; $selectLastContactUp = false; $selectLastContactDown = false; + $selectLastStatusChangeUp = false; + $selectLastStatusChangeDown = false; $order = [ 'field' => 'alias', 'field2' => 'alias', @@ -577,6 +776,24 @@ if (!empty($search_custom)) { $search_sql_custom = ''; } +// Filter by agent custom fields. +$sql_conditions_custom_fields = ''; +if (empty($ag_custom_fields) === false) { + $cf_filter = []; + foreach ($ag_custom_fields as $field_id => $value) { + if (empty($value) === false) { + $cf_filter[] = '(tagent_custom_data.id_field = '.$field_id.' AND tagent_custom_data.description LIKE \'%'.$value.'%\')'; + } + } + + if (empty($cf_filter) === false) { + $sql_conditions_custom_fields = ' AND tagente.id_agente IN ( + SELECT tagent_custom_data.id_agent + FROM tagent_custom_data + WHERE '.implode(' AND ', $cf_filter).')'; + } +} + // Show only selected groups. if ($group_id > 0) { $groups = [$group_id]; @@ -589,23 +806,41 @@ if ($group_id > 0) { $groups = array_keys($user_groups); } +$all_policies = in_array(0, $policies ?? []); + +$id_os_sql = ''; +$policies_sql = ''; + +if ($os > 0) { + $id_os_sql = ' AND id_os = '.$os; +} + +if ($all_policies === false && is_array($policies) && count($policies) > 0) { + $policies_sql = ' AND tpolicy_agents.id_policy IN ('.implode(',', $policies).')'; +} if ($strict_user) { $count_filter = [ // 'order' => 'tagente.nombre ASC', - 'order' => 'tagente.nombre ASC', - 'disabled' => 0, - 'status' => $status, - 'search' => $search, + 'order' => 'tagente.nombre ASC', + 'disabled' => 0, + 'status' => $status, + 'search' => $search, + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, ]; $filter = [ // 'order' => 'tagente.nombre ASC', - 'order' => 'tagente.nombre ASC', - 'disabled' => 0, - 'status' => $status, - 'search' => $search, - 'offset' => (int) get_parameter('offset'), - 'limit' => (int) $config['block_size'], + 'order' => 'tagente.nombre ASC', + 'disabled' => 0, + 'status' => $status, + 'search' => $search, + 'offset' => (int) get_parameter('offset'), + 'limit' => (int) $config['block_size'], + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, ]; if ($group_id > 0) { @@ -644,28 +879,48 @@ if ($strict_user) { $agents = tags_get_all_user_agents(false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true); } else { + $count_filter = [ + 'disabled' => 0, + 'id_grupo' => $groups, + 'search' => $search_sql, + 'search_custom' => $search_sql_custom, + 'status' => $status, + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, + ]; + + $filter = [ + 'order' => 'nombre ASC', + 'id_grupo' => $groups, + 'disabled' => 0, + 'status' => $status, + 'search_custom' => $search_sql_custom, + 'search' => $search_sql, + 'offset' => (int) get_parameter('offset'), + 'limit' => (int) $config['block_size'], + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, + ]; + $total_agents = agents_count_agents_filter( - [ - 'disabled' => 0, - 'id_grupo' => $groups, - 'search' => $search_sql, - 'search_custom' => $search_sql_custom, - 'status' => $status, - ], + $count_filter, $access ); + $query_order = $order; + + if ($order['field'] === 'last_status_change') { + $query_order = [ + 'field' => 'alias', + 'field2' => 'alias', + 'order' => 'ASC', + ]; + } + $agents = agents_get_agents( - [ - 'order' => 'nombre '.' ASC', - 'id_grupo' => $groups, - 'disabled' => 0, - 'status' => $status, - 'search_custom' => $search_sql_custom, - 'search' => $search_sql, - 'offset' => (int) get_parameter('offset'), - 'limit' => (int) $config['block_size'], - ], + $filter, [ 'id_agente', 'id_grupo', @@ -688,7 +943,7 @@ if ($strict_user) { 'agent_version', ], $access, - $order + $query_order ); } @@ -720,7 +975,8 @@ $url_up_group = 'index.php?sec=view&sec2=operation/agentes/estado_agente& $url_down_group = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=group&sort=down'; $url_up_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_contact&sort=up'; $url_down_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_contact&sort=down'; - +$url_up_last_status_change = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_status_change&sort=up'; +$url_down_last_status_change = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_status_change&sort=down'; // Prepare pagination. ui_pagination( @@ -740,16 +996,16 @@ $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_ag $table->size[0] = '12%'; $table->head[1] = __('Description').ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown); -$table->size[1] = '16%'; +$table->size[1] = '14%'; -$table->head[10] = __('Remote').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown); -$table->size[10] = '9%'; +$table->head[12] = __('Remote').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown); +$table->size[12] = '9%'; $table->head[2] = __('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown); $table->size[2] = '8%'; $table->head[3] = __('Interval').ui_get_sorting_arrows($url_up_interval, $url_down_interval, $selectIntervalUp, $selectIntervalDown); -$table->size[3] = '10%'; +$table->size[3] = '8%'; $table->head[4] = __('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown); $table->size[4] = '8%'; @@ -767,7 +1023,13 @@ $table->head[8] = __('Alerts'); $table->size[8] = '4%'; $table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); -$table->size[9] = '15%'; +$table->size[9] = '8%'; + +$table->head[10] = __('Last status change').ui_get_sorting_arrows($url_up_last_status_change, $url_down_last_status_change, $selectLastStatusChangeUp, $selectLastStatusChangeDown); +$table->size[10] = '10%'; + +$table->head[11] = __('Agent events'); +$table->size[11] = '4%'; $table->align = []; @@ -779,6 +1041,8 @@ $table->align[6] = 'left'; $table->align[7] = 'left'; $table->align[8] = 'left'; $table->align[9] = 'left'; +$table->align[10] = 'left'; +$table->align[11] = 'left'; $table->style = []; @@ -881,12 +1145,12 @@ foreach ($agents as $agent) { $data[1] = ''.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]').''; - $data[10] = ''; + $data[12] = ''; if (enterprise_installed()) { enterprise_include_once('include/functions_config_agents.php'); if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { - $data[10] = ''.html_print_image( + $data[12] = ''.html_print_image( 'images/application_edit.png', true, [ @@ -930,6 +1194,27 @@ foreach ($agents as $agent) { $data[9] = agents_get_interval_status($agent); + $last_status_change_agent = agents_get_last_status_change($agent['id_agente']); + $time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : ''.__('N/A').''; + $data[10] = $time_elapsed; + + $agent_event_filter = [ + 'id_agent' => $agent['id_agente'], + 'event_view_hr' => 48, + 'status' => -1, + ]; + + $fb64 = base64_encode(json_encode($agent_event_filter)); + $data[11] = ''.html_print_image( + 'images/lightning.png', + true, + [ + 'align' => 'middle', + 'title' => __('Agent events'), + 'class' => 'invert_filter', + ] + ).''; + // This old code was returning "never" on agents without modules, BAD !! // And does not print outdated agents in red. WRONG !!!! // $data[7] = ui_print_timestamp ($agent_info["last_contact"], true); @@ -937,6 +1222,20 @@ foreach ($agents as $agent) { } if (!empty($table->data)) { + if ($order['field'] === 'last_status_change') { + $order_direction = $order['order']; + usort( + $table->data, + function ($a, $b) use ($order_direction) { + if ($order_direction === 'ASC') { + return strtotime($a[10]) > strtotime($b[10]); + } else { + return strtotime($a[10]) < strtotime($b[10]); + } + } + ); + } + html_print_table($table); ui_pagination( @@ -975,10 +1274,69 @@ if (!empty($table->data)) { echo ''; echo ''; } + +// Load filter div for dialog. +echo ''; +echo ''; + ?> + 'StarTrek emergency simulation', ]; +$eventsounds = mysql_db_get_row_sql('SELECT * FROM tevent_sound WHERE active = 1'); +foreach ($eventsounds as $key => $row) { + $sounds[$row['sound']] = $row['name']; +} + $inputs[] = [ 'label' => \__('Sounds'), 'class' => 'flex-row', diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index bb0802a567..fd681495be 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -477,6 +477,10 @@ if ($access_console_node === true) { } Date: Fri, 27 Jan 2023 13:43:23 +0100 Subject: [PATCH 07/87] Fix empty module data list view --- pandora_console/operation/agentes/status_monitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 8da3b9b2ba..82ba6fcfee 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1939,7 +1939,7 @@ if (!empty($result)) { } else { $sub_string = substr(io_safe_output($row['datos']), 0, 12); if ($module_value == $sub_string) { - if ($module_value == 0 && !$sub_string) { + if ((empty($module_value) === true || $module_value == 0) && !$sub_string) { $salida = 0; } else { $data_macro = modules_get_unit_macro($row['datos'], $row['unit']); From 624463d5739ec26dff469ddede86dc8b31e85d7d Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 30 Jan 2023 08:27:03 +0100 Subject: [PATCH 08/87] #9819 change setcion menu configuration sound --- pandora_console/godmode/menu.php | 4 ++++ pandora_console/operation/menu.php | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index d98eb9d3c6..9dc13b6abb 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -435,6 +435,10 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($ } } + $sub['godmode/events/configuration_sounds']['text'] = __('Configuration Sounds'); + $sub['godmode/events/configuration_sounds']['id'] = 'Configuration Sounds'; + $sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds']; + $menu_godmode['gextensions']['sub'] = $sub; } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index fd681495be..c777e1d97b 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -477,10 +477,6 @@ if ($access_console_node === true) { } Date: Mon, 30 Jan 2023 15:31:58 +0100 Subject: [PATCH 09/87] update google sheet plugin --- .../google_sheets/pandora_googlesheet.py | 72 ++++++++++++++----- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/pandora_plugins/google_sheets/pandora_googlesheet.py b/pandora_plugins/google_sheets/pandora_googlesheet.py index a6e599b429..d02fc4cd3b 100644 --- a/pandora_plugins/google_sheets/pandora_googlesheet.py +++ b/pandora_plugins/google_sheets/pandora_googlesheet.py @@ -1,7 +1,13 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + import gspread -import argparse +import argparse,json,sys from oauth2client.service_account import ServiceAccountCredentials from pprint import pprint +from os import remove + +import base64 __author__ = "Alejandro Sánchez Carrion" __copyright__ = "Copyright 2022, PandoraFMS" @@ -15,33 +21,63 @@ Version = {__version__} Manual execution -python3 pandora_googlesheets.py --cred --row --column +python3 pandora_googlesheets.py --creds_json/creds_base64 --row --column """ parser = argparse.ArgumentParser(description= info, formatter_class=argparse.RawTextHelpFormatter) -parser.add_argument('--cred', help='') -parser.add_argument('--name', help='') -parser.add_argument('--row', help='',type=int) -parser.add_argument('--column', help='',type=int) +parser.add_argument('--creds_json', help='To authenticate with a json file.') +parser.add_argument('--creds_base64', help='To authenticate with a file that includes the credentials for base64 authentication.') +parser.add_argument('--name', help='Name of the google sheets document.') +parser.add_argument('--cell', help='To collect the value of a cell.') +parser.add_argument('--row', help='To collect the value of a row.',type=int) +parser.add_argument('--column', help='To collect the value of a column.',type=int) +parser.add_argument('--sheet', help='To indicate the name of the document sheet, put it in quotation marks and count spaces and capital letters.',type=str) args = parser.parse_args() scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive"] -creds = ServiceAccountCredentials.from_json_keyfile_name(args.cred, scope) + + + + +## authenticate with file json input +if args.creds_json is not None and args.creds_base64 == None: + creds = ServiceAccountCredentials.from_json_keyfile_name(args.creds_json, scope) +## authenticate with base64 input +elif args.creds_base64 is not None and args.creds_json== None: + ## base64 to json + with open(args.creds_base64, 'r') as file: + data = file.read().replace('\n', '') + text=base64.b64decode(data).decode('utf-8') + with open("cred.json", "w") as outfile: + outfile.write(text) + creds = ServiceAccountCredentials.from_json_keyfile_name("cred.json", scope) + remove("cred.json") +else: + print("You need to use the --creds_json or creds_base 64 parameter to authenticate. You can only select one.") + sys.exit() client = gspread.authorize(creds) -sheet = client.open(args.name).sheet1 # Open the spreadhseet +sheet = client.open(args.name) # Open the spreadhseet +worksheet = sheet.worksheet(args.sheet) # Open worksheet -data = sheet.get_all_records() # Get a list of all records +if args.cell is not None and args.row==None and args.column==None : -if args.row is not None and args.column==None: - row = sheet.row_values(args.row) # Get a specific row - print(row) -elif args.row ==None and args.column is not None: - col = sheet.col_values(args.column) # Get a specific column - print(col) -elif args.row is not None and args.column is not None: - cell = sheet.cell(args.row,args.column).value # Get the value of a specific cell - print(cell) + val = worksheet.acell(args.cell).value + +elif args.row is not None and args.column==None and args.cell == None: + + val = worksheet.row_values(args.row) # Get a specific row + +elif args.column is not None and args.row== None and args.cell == None: + + val = worksheet.col_values(args.column) # Get a specific column + +else: + print("To search for data in a cell use the --cell parameter, for data in a column --column and in a row --row, only one of these parameters can be used at a time.") + sys.exit() + + +print(val) From b88f26500b66ac5b2752865ef8a2994535de4bf7 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 31 Jan 2023 08:35:47 +0100 Subject: [PATCH 10/87] #9819 Change labels Accoustic console --- pandora_console/godmode/menu.php | 4 ++-- pandora_console/include/class/EventSound.class.php | 6 +++--- pandora_console/operation/events/events.php | 6 +++--- pandora_console/operation/events/sound_events.php | 4 ++-- pandora_console/operation/menu.php | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 9dc13b6abb..d4f903290e 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -435,8 +435,8 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($ } } - $sub['godmode/events/configuration_sounds']['text'] = __('Configuration Sounds'); - $sub['godmode/events/configuration_sounds']['id'] = 'Configuration Sounds'; + $sub['godmode/events/configuration_sounds']['text'] = __('Accoustic console setup'); + $sub['godmode/events/configuration_sounds']['id'] = 'Accoustic console setup'; $sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds']; $menu_godmode['gextensions']['sub'] = $sub; diff --git a/pandora_console/include/class/EventSound.class.php b/pandora_console/include/class/EventSound.class.php index 93f42ec7c4..b943e9cce1 100644 --- a/pandora_console/include/class/EventSound.class.php +++ b/pandora_console/include/class/EventSound.class.php @@ -209,7 +209,7 @@ class EventSound extends HTML $titleHeader = __('Add new sound'); } else { $helpHeader = 'servers_ha_clusters_tab'; - $titleHeader = __('Events sound list'); + $titleHeader = __('Accoustic console sound list'); } // Header. @@ -223,11 +223,11 @@ class EventSound extends HTML [ [ 'link' => '', - 'label' => __('Events'), + 'label' => __('Admin tools'), ], [ 'link' => '', - 'label' => __('Configuration Sounds'), + 'label' => __('Accoustic console setup'), ], ] ); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 648581a3a6..eb885bf479 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1473,13 +1473,13 @@ if ($pure) { ] ).''; - // Sound events. + // Accoustic console. $sound_event['active'] = false; $sound_event['text'] = ''.html_print_image( 'images/sound.png', true, [ - 'title' => __('Sound events'), + 'title' => __('Accoustic console'), 'class' => 'invert_filter', ] ).''; @@ -1529,7 +1529,7 @@ if ($pure) { switch ($section) { case 'sound_event': $onheader['sound_event']['active'] = true; - $section_string = __('Sound events'); + $section_string = __('Accoustic console'); break; case 'history': diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 2f2b11e065..6ce7a31c3a 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -60,7 +60,7 @@ ob_start(); echo ''; echo ''; -echo ''.__('Sound Events').''; +echo ''.__('Accoustic console').''; ui_require_css_file('wizard'); ui_require_css_file('discovery'); ?> @@ -161,7 +161,7 @@ if ($config['style'] === 'pandora_black' && !is_metaconsole()) { echo ''; echo ""; -echo "

".__('Sound console').'

'; +echo "

".__('Accoustic console').'

'; // Connection lost alert. ui_require_css_file('register', 'include/styles/', true); diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index c777e1d97b..eed84a4d48 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -432,11 +432,11 @@ if ($access_console_node === true) { $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&fb64='.$fb64]['type'] = 'direct'; } - // Sound Events. + // Accoustic console. $data_sound = base64_encode( json_encode( [ - 'title' => __('Sound Console'), + 'title' => __('Accoustic console'), 'start' => __('Start'), 'stop' => __('Stop'), 'noAlert' => __('No alert'), @@ -449,8 +449,8 @@ if ($access_console_node === true) { ); $javascript = 'javascript: openSoundEventModal(`'.$data_sound.'`);'; - $sub[$javascript]['text'] = __('Sound Events'); - $sub[$javascript]['id'] = 'Sound Events Modal'; + $sub[$javascript]['text'] = __('Accoustic console'); + $sub[$javascript]['id'] = 'Accoustic console Modal'; $sub[$javascript]['type'] = 'direct'; echo ''; From c8b1d22c5d28b035c90f8bc9df34434539172a3e Mon Sep 17 00:00:00 2001 From: alejandro Date: Tue, 31 Jan 2023 10:23:42 +0100 Subject: [PATCH 11/87] change parameter --creds_Base64 --- pandora_plugins/google_sheets/pandora_googlesheet.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora_plugins/google_sheets/pandora_googlesheet.py b/pandora_plugins/google_sheets/pandora_googlesheet.py index d02fc4cd3b..bfa346aa40 100644 --- a/pandora_plugins/google_sheets/pandora_googlesheet.py +++ b/pandora_plugins/google_sheets/pandora_googlesheet.py @@ -21,7 +21,7 @@ Version = {__version__} Manual execution -python3 pandora_googlesheets.py --creds_json/creds_base64 --row --column +python3 pandora_googlesheets.py --creds_json/creds_base64 --name --sheet --cell --row --column """ @@ -47,9 +47,7 @@ if args.creds_json is not None and args.creds_base64 == None: ## authenticate with base64 input elif args.creds_base64 is not None and args.creds_json== None: ## base64 to json - with open(args.creds_base64, 'r') as file: - data = file.read().replace('\n', '') - text=base64.b64decode(data).decode('utf-8') + text=base64.b64decode(args.creds_base64).decode('utf-8') with open("cred.json", "w") as outfile: outfile.write(text) creds = ServiceAccountCredentials.from_json_keyfile_name("cred.json", scope) From d49f1320f53474739a82e711fa07c04fe36a0385 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 31 Jan 2023 12:37:55 +0100 Subject: [PATCH 12/87] #10127 added param 'id_node' in set_validate_events for update from metaconsole --- pandora_console/include/functions_api.php | 47 ++++++++++++++++++++--- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 89e764aaaa..11149e86f8 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11061,20 +11061,55 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3) function api_set_validate_events($id_event, $trash1, $other, $return_type, $user_in_db) { - $text = $other['data']; + $node_int = 0; + if ($other['type'] == 'string') { + returnError('Parameter error.'); + return; + } else if ($other['type'] == 'array') { + $text = $other['data'][0]; + if (is_metaconsole() === true) { + if (isset($other['data'][1]) === true + && empty($other['data'][1]) === false + ) { + $node_int = $other['data'][1]; + } + } + } - // Set off the standby mode when close an event - $event = events_get_event($id_event); - alerts_agent_module_standby($event['id_alert_am'], 0); + try { + if (is_metaconsole() === true + && (int) $node_int > 0 + ) { + $node = new Node($node_int); + $node->connect(); + } - $result = events_change_status($id_event, EVENT_VALIDATE); + // Set off the standby mode when close an event + $event = events_get_event($id_event); + alerts_agent_module_standby($event['id_alert_am'], 0); + $result = events_change_status($id_event, EVENT_VALIDATE); - if ($result) { if (!empty($text)) { // Set the comment for the validation events_comment($id_event, $text); } + } catch (\Exception $e) { + if (is_metaconsole() === true + && $node_int > 0 + ) { + $node->disconnect(); + } + $result = false; + } finally { + if (is_metaconsole() === true + && $node_int > 0 + ) { + $node->disconnect(); + } + } + + if ($result) { returnData( 'string', [ From 407ce7baa0156ee15ab18dbbd743a1330200ffe6 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 31 Jan 2023 13:33:02 +0100 Subject: [PATCH 13/87] #9003 changed command center name to Merging tool --- pandora_console/general/node_deactivated.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/node_deactivated.php b/pandora_console/general/node_deactivated.php index c88f4f599e..ae0e3b8f24 100644 --- a/pandora_console/general/node_deactivated.php +++ b/pandora_console/general/node_deactivated.php @@ -56,7 +56,7 @@ ui_require_css_file('maintenance'); 'Please navigate to %s to unify system', ''.__('command center').'' + ).'" target="_new">'.__('merging tool').'' ); ?>

From 2b9f7f9b09a3b76310c1bc30a0fa7a5c6458cb99 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 1 Feb 2023 10:47:36 +0100 Subject: [PATCH 14/87] #10267 limit entries in events list --- pandora_console/operation/events/events.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 18c928727a..ba27a38a6e 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -2413,8 +2413,6 @@ try { 100, 200, 500, - 1000, - -1, ], [ $config['block_size'], @@ -2423,8 +2421,6 @@ try { 100, 200, 500, - 1000, - 'All', ], ], 'order' => [ From e465fb67596758b1c039f34a91f3d70c71574688 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 1 Feb 2023 17:35:56 +0100 Subject: [PATCH 15/87] #9003 changed merging tool for command center in warning --- pandora_console/general/node_deactivated.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/node_deactivated.php b/pandora_console/general/node_deactivated.php index ae0e3b8f24..c88f4f599e 100644 --- a/pandora_console/general/node_deactivated.php +++ b/pandora_console/general/node_deactivated.php @@ -56,7 +56,7 @@ ui_require_css_file('maintenance'); 'Please navigate to %s to unify system', ''.__('merging tool').'' + ).'" target="_new">'.__('command center').'' ); ?>

From 18f2cee2a7698e6b6e4624d72d14400109eea0ce Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 2 Feb 2023 11:18:47 +0100 Subject: [PATCH 16/87] #10283 fixed filter design in snmp console --- .../include/class/SnmpConsole.class.php | 105 +++++++++--------- pandora_console/include/styles/tables.css | 22 +++- 2 files changed, 74 insertions(+), 53 deletions(-) diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 9aae307bc5..96553d2ac4 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -413,73 +413,74 @@ class SnmpConsole extends HTML 'class' => 'flex-row', 'inputs' => [ [ - 'label' => __('Alert'), - 'type' => 'select', - 'id' => 'filter_alert', - 'name' => 'filter_alert', - 'class' => 'w200px', - 'fields' => $show_alerts, - 'return' => true, - 'selected' => $this->filter_alert, + 'label' => __('Alert'), + 'type' => 'select', + 'id' => 'filter_alert', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_alert', + 'fields' => $show_alerts, + 'return' => true, + 'selected' => $this->filter_alert, ], [ - 'label' => __('Severity'), - 'type' => 'select', - 'id' => 'filter_severity', - 'name' => 'filter_severity', - 'class' => 'w200px', - 'fields' => $severities, - 'return' => true, - 'selected' => $this->filter_severity, + 'label' => __('Severity'), + 'type' => 'select', + 'id' => 'filter_severity', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_severity', + 'fields' => $severities, + 'return' => true, + 'selected' => $this->filter_severity, ], [ - 'label' => __('Free search'), - 'type' => 'text', - 'class' => 'w400px', - 'id' => 'filter_free_search', - 'name' => 'filter_free_search', - 'value' => $this->filter_free_search, + 'label' => __('Free search'), + 'type' => 'text', + 'id' => 'filter_free_search', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_free_search', + 'value' => $this->filter_free_search, ], [ - 'label' => __('Status'), - 'type' => 'select', - 'id' => 'filter_status', - 'name' => 'filter_status', - 'class' => 'w200px', - 'fields' => $status_array, - 'return' => true, - 'selected' => $this->filter_status, + 'label' => __('Status'), + 'type' => 'select', + 'id' => 'filter_status', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_status', + 'fields' => $status_array, + 'return' => true, + 'selected' => $this->filter_status, ], [ - 'label' => __('Group by Enterprise String/IP'), - 'type' => 'select', - 'name' => 'filter_group_by', - 'selected' => $this->filter_group_by, - 'disabled' => false, - 'return' => true, - 'id' => 'filter_group_by', - 'fields' => [ + 'label' => __('Group by Enterprise String/IP'), + 'type' => 'select', + 'name' => 'filter_group_by', + 'selected' => $this->filter_group_by, + 'disabled' => false, + 'return' => true, + 'id' => 'filter_group_by', + 'input_class' => 'filter_input_datatable', + 'fields' => [ 0 => __('No'), 1 => __('Yes'), ], ], [ - 'label' => __('Max. hours old'), - 'type' => 'text', - 'class' => 'w200px', - 'id' => 'filter_hours_ago', - 'name' => 'filter_hours_ago', - 'value' => $this->filter_hours_ago, + 'label' => __('Max. hours old'), + 'type' => 'text', + 'id' => 'filter_hours_ago', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_hours_ago', + 'value' => $this->filter_hours_ago, ], [ - 'label' => __('Trap type'), - 'type' => 'select', - 'id' => 'filter_trap_type', - 'name' => 'filter_trap_type', - 'class' => 'w200px', - 'fields' => $trap_types, - 'return' => true, - 'selected' => $this->filter_trap_type, + 'label' => __('Trap type'), + 'type' => 'select', + 'id' => 'filter_trap_type', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_trap_type', + 'fields' => $trap_types, + 'return' => true, + 'selected' => $this->filter_trap_type, ], ], ], diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 40ecaf11ba..fca924b6e0 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -323,6 +323,25 @@ a.pandora_pagination.current:hover { cursor: default; } +.filter_input_datatable { + width: 45% !important; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + max-width: 450px; + min-width: 400px; +} +.filter_input_datatable input { + flex: 1; +} +.filter_input_datatable label { + width: 93px; + max-width: 100%; +} +.filter_input_datatable .select2.select2-container { + flex: 1; +} + /* Default datatable filter style */ .datatable_filter.content { display: flex; @@ -336,7 +355,8 @@ a.pandora_pagination.current:hover { } .datatable_filter.content li { flex: 1 1 auto; - margin: 1em auto; + margin: 1em 0; + padding: 0px 10px; } .sorting_desc { background: url(../../images/sort_down_green.png) no-repeat; From c9ea46e219f58da0df3eacbec1b89933add280f0 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 2 Feb 2023 11:25:59 +0100 Subject: [PATCH 17/87] #10283 align left input only in datatable_filter --- pandora_console/include/styles/tables.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index fca924b6e0..30592ed6db 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -341,7 +341,9 @@ a.pandora_pagination.current:hover { .filter_input_datatable .select2.select2-container { flex: 1; } - +.datatable_filter.content li.filter_input_datatable { + margin: 1em 0; +} /* Default datatable filter style */ .datatable_filter.content { display: flex; @@ -355,7 +357,7 @@ a.pandora_pagination.current:hover { } .datatable_filter.content li { flex: 1 1 auto; - margin: 1em 0; + margin: 1em auto; padding: 0px 10px; } .sorting_desc { From 925880dbdbe1bd0b31859700975977909aabd5cc Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Feb 2023 17:06:28 +0100 Subject: [PATCH 18/87] #9523 dialog title plugins --- pandora_console/godmode/servers/plugin.php | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 5a0d8a063a..b6d78e1d98 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -892,7 +892,7 @@ if (($create != '') || ($view != '')) { echo ' From 1457dffe6cf80c34721327190145e5b499c56054 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 7 Feb 2023 10:30:22 +0100 Subject: [PATCH 35/87] #10296 added getSystemDate in AJAXMethods --- pandora_console/include/class/Diagnostics.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 44e003fd95..99e28e3983 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -104,6 +104,7 @@ class Diagnostics extends Wizard 'getChartAjax', 'formFeedback', 'createdScheduleFeedbackTask', + 'getSystemDate', ]; @@ -209,6 +210,7 @@ class Diagnostics extends Wizard 'getAttachmentFolder', 'getInfoTagenteDatos', 'getServerThreads', + 'getSystemDate', ]; if ($this->pdf === true) { @@ -278,6 +280,10 @@ class Diagnostics extends Wizard $title = __('SQL show engine innodb status'); break; + case 'getSystemDate': + $title = __('Date system'); + break; + default: // Not possible. $title = ''; From 00b3564d5f993cc73886055d4e32818f7cd752aa Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 7 Feb 2023 13:53:40 +0100 Subject: [PATCH 36/87] #10321 removed token in limit sql --- pandora_console/operation/events/events.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index bf0655b5a3..6777ced4c3 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -324,11 +324,9 @@ if (is_ajax() === true) { $start = get_parameter('start', 0); $length = get_parameter( 'length', - $config['events_per_query'] + $config['block_size'] ); - $length = ($length === '-1') ? $config['events_per_query'] : $length; - if ($get_events !== 0) { try { ob_start(); From 2e9b1c70997ddc858849f4e5fb2c23b47ee224f0 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 7 Feb 2023 14:16:59 +0100 Subject: [PATCH 37/87] fixed node connection --- pandora_console/extensions/dbmanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index db92dda0a9..3f36935e5c 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -227,7 +227,7 @@ function dbmgr_extension_main() 'dbport' => $node->dbport(), 'dbname' => $node->dbname(), 'dbuser' => $node->dbuser(), - 'dbpass' => $node->dbpass(), + 'dbpass' => io_output_password($node->dbpass()), ] ); $error = ''; From bcfa977f567b86ff0b43358e90ba008830f816da Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 8 Feb 2023 15:23:13 +0100 Subject: [PATCH 38/87] #10335 fixed plugin select in edit modules in bulk --- .../agentes/module_manager_editor_plugin.php | 3 +- .../godmode/massive/massive_edit_modules.php | 74 +++++++++---------- 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_plugin.php b/pandora_console/godmode/agentes/module_manager_editor_plugin.php index 2cc0ec3d8e..9477091e95 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_plugin.php +++ b/pandora_console/godmode/agentes/module_manager_editor_plugin.php @@ -89,8 +89,7 @@ $password_fields = []; // If there are $macros, we create the form fields if (!empty($macros)) { - $macros = json_decode($macros, true); - + $macros = json_decode(io_safe_output($macros), true); foreach ($macros as $k => $m) { $data = []; $data[0] = $m['desc']; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 85a0006986..a03e278957 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -2094,46 +2094,21 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' switch ($field) { case 'id_plugin': if ($value != 0) { - $value_field_1 = get_parameter('_field1_', ''); - $value_field_1_desc = get_parameter('desc_field1_', ''); - - $value_field_2 = get_parameter('_field2_', ''); - $value_field_2_desc = get_parameter('desc_field2_', ''); - - $value_field_3 = get_parameter('_field3_', ''); - $value_field_3_desc = get_parameter('desc_field3_', ''); - - $value_field_4 = get_parameter('_field4_', ''); - $value_field_4_desc = get_parameter('desc_field4_', ''); - - $value_field_5 = get_parameter('_field5_', ''); - $value_field_5_desc = get_parameter('desc_field5_', ''); - - $values['macros'] = '{"1":{"macro":"_field1_","desc":"'.io_safe_input($value_field_1_desc).'","help":"'.io_safe_input($value_field_1_desc).'","value":"'.$value_field_1.'"}'; - - if ($value_field_2_desc != '') { - $values['macros'] .= ',"2":{"macro":"_field2_","desc":"'.io_safe_input($value_field_2_desc).'","help":"'.io_safe_input($value_field_2_desc).'","value":"'.$value_field_2.'"}'; - - if ($value_field_3_desc != '') { - $values['macros'] .= ',"3":{"macro":"_field3_","desc":"'.io_safe_input($value_field_3_desc).'","help":"'.io_safe_input($value_field_3_desc).'","value":"'.$value_field_3.'"}'; - - if ($value_field_4_desc != '') { - $values['macros'] .= ',"4":{"macro":"_field4_","desc":"'.io_safe_input($value_field_4_desc).'","help":"'.io_safe_input($value_field_4_desc).'","value":"'.$value_field_4.'"}'; - - if ($value_field_5_desc != '') { - $values['macros'] .= ',"5":{"macro":"_field5_","desc":"'.io_safe_input($value_field_5_desc).'","help":"'.io_safe_input($value_field_5_desc).'","value":"'.$value_field_5.'"}'; - } else { - $values['macros'] .= '}'; - } - } else { - $values['macros'] .= '}'; - } - } else { - $values['macros'] .= '}'; + for ($i = 0; $i <= 15; $i++) { + $value_field = get_parameter('_field'.$i.'_', ''); + $value_field_desc = get_parameter('desc_field'.$i.'_', ''); + if ($value_field_desc != '') { + $values['macros'][$i] = [ + 'macro' => '_field'.$i.'_', + 'desc' => io_safe_input($value_field_desc), + 'help' => io_safe_input($value_field_desc), + 'value' => $value_field, + ]; } - } else { - $values['macros'] .= '}'; } + + $values['macros'] = json_encode($values['macros']); + $values[$field] = $value; } break; @@ -2260,7 +2235,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' // Apply at All agents (within valid groups). $modules = db_get_all_rows_sql( sprintf( - 'SELECT tam.id_agente_modulo, tam.id_tipo_modulo + 'SELECT tam.id_agente_modulo, tam.id_tipo_modulo,tam.macros, tam.id_plugin FROM tagente_modulo tam INNER JOIN tagente ta ON ta.id_agente = tam.id_agente WHERE ta.id_grupo IN (%s) %s;', @@ -2277,6 +2252,8 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' [ 'id_agente_modulo', 'id_tipo_modulo', + 'macros', + 'id_plugin', ] ); } else { @@ -2289,6 +2266,8 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' [ 'id_agente_modulo', 'id_tipo_modulo', + 'macros', + 'id_plugin', ] ); } @@ -2346,6 +2325,23 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' } } + if ($module['macros'] && $module['id_plugin'] == $values['id_plugin']) { + $module_macros = json_decode($module['macros'], true); + $values_macros = json_decode($values['macros'], true); + + foreach ($values_macros as $k => $value_macro) { + foreach ($module_macros as $s => $module_macro) { + if ($value_macro['macro'] == $module_macro['macro'] && $value_macro['value'] !== '') { + $module_macros[$s]['value'] = $value_macro['value']; + $module_macros[$s]['desc'] = $value_macro['desc']; + $module_macros[$s]['help'] = $value_macro['help']; + } + } + } + + $values['macros'] = json_encode($module_macros); + } + $result = modules_update_agent_module( $module['id_agente_modulo'], $values, From 8b9803c1c558e8f08bd1d733bf8381fbd7fa5523 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 8 Feb 2023 17:04:24 +0100 Subject: [PATCH 39/87] fixed tinyMCE converting URLs to relative ones --- pandora_console/include/rest-api/models/VisualConsole/View.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index cd1e25fd49..e8305df830 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -144,6 +144,8 @@ class View extends \HTML tinyMCE.init({ selector: "#textarea_label", theme: "advanced", + convert_urls:false, + relative_urls:false, content_css: "'.ui_get_full_url(false, false, false, false).'include/styles/pandora.css", theme_advanced_font_sizes: "4pt=.visual_font_size_4pt, " + From 50e8b457f8d2ae1d0bece5a83937550f393ae8a3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 9 Feb 2023 11:42:42 +0100 Subject: [PATCH 40/87] #10302 fixed tz in event list --- pandora_console/operation/events/events.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 6777ced4c3..c7c8be45ce 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -350,7 +350,7 @@ if (is_ajax() === true) { 'te.warning_instructions', 'te.unknown_instructions', 'te.owner_user', - 'if(te.ack_utimestamp > 0, from_unixtime(te.ack_utimestamp),"") as ack_utimestamp', + 'if(te.ack_utimestamp > 0, te.ack_utimestamp,"") as ack_utimestamp', 'te.custom_data', 'te.data', 'te.module_status', @@ -380,7 +380,7 @@ if (is_ajax() === true) { $order['field'] = 'agent_name'; break; - case 'if(te.ack_utimestamp > 0, from_unixtime(te.ack_utimestamp),"") as ack_utimestamp': + case 'if(te.ack_utimestamp > 0, te.ack_utimestamp,"") as ack_utimestamp': $order['field'] = 'ack_utimestamp'; break; @@ -528,7 +528,7 @@ if (is_ajax() === true) { true ); $tmp->timestamp = ui_print_timestamp( - $tmp->timestamp, + $tmp->utimestamp, true ); From 55347713516a40fdf30bd36ce97acce723b4f657 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 14 Feb 2023 10:24:08 +0100 Subject: [PATCH 41/87] added all nodes option in sql query report item in meta --- .../reporting_builder.item_editor.php | 26 ++++- .../include/functions_reporting.php | 109 ++++++++++++++++-- 2 files changed, 123 insertions(+), 12 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 80e72e65cf..8c66b583ee 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1233,6 +1233,29 @@ $class = 'databox filters'; } ?> + 'All nodes'], $servers); + if ($meta) { + ?> + + + + + + + + @@ -6334,6 +6357,7 @@ function chooseType() { $("#row_alert_templates").hide(); $("#row_alert_actions").hide(); $("#row_servers").hide(); + $("#row_servers_all_opt").hide(); $("#row_multiple_servers").hide(); $("#row_sort").hide(); $("#row_date").hide(); @@ -6648,7 +6672,7 @@ function chooseType() { $("#row_header").show(); $("#row_custom").show(); $("#row_custom_example").show(); - $("#row_servers").show(); + $("#row_servers_all_opt").show(); $("#row_historical_db_check").show(); break; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 637ae59752..c17745da8b 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -68,6 +68,7 @@ define('REPORT_STATUS_IGNORED', 5); // Clases. use PandoraFMS\Enterprise\Metaconsole\Node; +use PandoraFMS\Enterprise\Metaconsole\Synchronizer; use PandoraFMS\Event; use PandoraFMS\Module; @@ -7421,6 +7422,14 @@ function reporting_text($report, $content) } +/** + * Build SQL report item. + * + * @param array $report Report info. + * @param array $content Content info. + * + * @return array + */ function reporting_sql($report, $content) { global $config; @@ -7438,15 +7447,97 @@ function reporting_sql($report, $content) $return['description'] = $content['description']; $return['date'] = reporting_get_date_text(); - if ($config['metaconsole'] && !empty($content['server_name'])) { - $id_meta = metaconsole_get_id_server( + if (is_metaconsole() === true + && empty($content['server_name']) === false + && $content['server_name'] !== 'all' + ) { + $id_server = metaconsole_get_id_server( $content['server_name'] ); - - $server = metaconsole_get_connection_by_id($id_meta); - metaconsole_connect($server); } + if (is_metaconsole() === true && $content['server_name'] === 'all') { + $sync = new Synchronizer(); + $results = $sync->apply( + function ($node) use ($report, $content) { + try { + $node->connect(); + $rs = reporting_sql_auxiliary($report, $content); + $node->disconnect(); + } catch (Exception $e) { + return [ + 'error' => __( + 'Failed to connect to node %s', + $node->server_name() + ), + ]; + } + + if ($rs === false) { + return ['result' => []]; + } + + return ['result' => $rs]; + }, + false + ); + + $data = []; + $return['correct'] = 1; + $return['error'] = ''; + + foreach ($results as $id_node => $items) { + foreach ($items['result']['data'] as $key => $item) { + $items['result']['data'][$key] = ['node_id' => $id_node] + $items['result']['data'][$key]; + } + + if ((int) $items['result']['correct'] !== 1) { + $return['correct'] = 0; + } + + if ($items['result']['error'] !== '') { + $return['error'] = $items['result']['error']; + } + + $return['sql'] = $items['result']['sql']; + + $data = array_merge($data, $items['result']['data']); + } + + $return['data'] = $data; + } else { + try { + if (is_metaconsole() === true && $id_server > 0) { + $node = new Node($id_server); + $node->connect(); + } + + $query_result = reporting_sql_auxiliary($report, $content); + $return = array_merge($return, $query_result); + + if (is_metaconsole() === true && $id_server > 0) { + $node->disconnect(); + } + } catch (\Exception $e) { + if (is_metaconsole() === true && $id_server > 0) { + $node->disconnect(); + } + } + } + + return reporting_check_structure_content($return); +} + + +/** + * Auxiliary function for reporting_sql. + * + * @param array $report Report info. + * @param array $content Content info. + * + * @return array + */ +function reporting_sql_auxiliary($report, $content) { if ($content['treport_custom_sql_id'] != 0) { $sql = io_safe_output( db_get_value_filter( @@ -7459,7 +7550,7 @@ function reporting_sql($report, $content) $sql = $content['external_source']; } - // Check if exist sql macro. + // Check if SQL macro exists. $sql = reporting_sql_macro($report, $sql); // Do a security check on SQL coming from the user. @@ -7514,11 +7605,7 @@ function reporting_sql($report, $content) $return['error'] = __('Illegal query: Due security restrictions, there are some tokens or words you cannot use: *, delete, drop, alter, modify, password, pass, insert or update.'); } - if ($config['metaconsole'] && !empty($content['server_name'])) { - metaconsole_restore_db(); - } - - return reporting_check_structure_content($return); + return $return; } From 87c3bee756380da6ff865ad7c0bae043c52c3188 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 15 Feb 2023 11:23:36 +0100 Subject: [PATCH 42/87] 9666-New widget Event cardboard --- .../images/widgets/EventCardboard.png | Bin 0 -> 4179 bytes pandora_console/include/functions_events.php | 55 ++ .../include/lib/Dashboard/Widget.php | 1 + .../lib/Dashboard/Widgets/EventCardboard.php | 664 ++++++++++++++++++ .../include/styles/meta_dashboards.css | 15 + 5 files changed, 735 insertions(+) create mode 100644 pandora_console/images/widgets/EventCardboard.png create mode 100644 pandora_console/include/lib/Dashboard/Widgets/EventCardboard.php diff --git a/pandora_console/images/widgets/EventCardboard.png b/pandora_console/images/widgets/EventCardboard.png new file mode 100644 index 0000000000000000000000000000000000000000..5dba098d468700d397496abf9f0341b9f9bb6cd4 GIT binary patch literal 4179 zcmV-Z5UlTsP)aSSS%8Ya;P3yjBEJ6Fee^T%ut) zTm;s=XST2W_m|iF?&Dif`WxK0(|M8Chj{e>K|9}6FKpd{>f4)74XhwfkCn^#3 zx*IFXTX-}93rkkKIT7<->4Mqc{(uqrB|v8KBP(7Vp&uc40sWN&=n6joDud5oo7 zXZ(Yu8{S+y2{NKiF)ToctoG9K`=}r6GAgfYiiHXbg4`?v?KGcF8_juL7ov+ zKV3UoGmK(8&|Zd{l@X2lVPP+hb3Y)#RksA6kNlU)1K ziu21aoBbZ2{@|zc*CS4lG$;K?5`M1u_33& zk{1&mCTL3C{5h9&zC<~IrJ+n3;CQku+yIrc%C})XYpA+rV;@avIs+@aGR2#Lb=Yh* z0s^CzM9g%h7EZj99;&NqDmPAFaO}JF^(F0Ob$o<{7Dp*qiK7)P&ze4A9sTyc8Ot!@ z$;q=0MoBqo2sG;@4Z&+1U*+gfc$MSpoYlc=oO_kSYaCzYNW-U&ri0h`seRAo@rXR` zY|7YtZ4nZQ5n=GLhdsQ;8ymj1(C~$%+Z%!QK`MUxBb>AxCIiMUVfwGXyc3wOj>#;2aOEp34blM8$T8^)!S7515(P=&Ei3Zx^&m`A(G;F6 zYylke<0KnzTD9+x%{N^-f=!T_4MD4hVF*=E*M0-?nOtH-Zl70i;Z~l9r6C>wAB}=y zjNjTsIT=wE;hk?+lDAv1uUfc2cvZq4evg&8n zotbJjk7t<8Jh;B{s;QsC%%NL5NeX3al;kErCiQ&hK|ZEJ>CSN>gM3Kg(Q|Eic^qV6 z3gzOVnr+2#EG9hu-1<_OWA|$C{=4SBKX|Mpx#1lCLMIb-@9FIK=Mshv|vPJA|f z*+xzqKh+7u>OSAGMH@bH{58|QUtta)?Z~iRAgc-OG&{gv24(osk{u4Cr@zEI*LLhM zEW_;HBR@JFi%BV)?Yr;Mqkn3Cj{4;kPa8Bu&i$1PK-m`xU;w)5e8bPUvPa2Y3z$zrDdgr zUuZ=>)ljAoG!3U%mW`7Xyf#O*F-(G$){;4 z1cYvi@Jt;Q;SnJ3pa_qWt|CYqJ`~Ur`I`1l4;|T~Yu)V;RaFVBo2QZ^Y33&tLB7Lf zk*G~xF+mXN^7E<^QnyJZ``#Y2Xxruw7XN3&XtKVwg;bw7kd>c(XD8XXp_V-RWc8v< z7ydFaSTrIuit}cFcc&MVf}(=WPt0#2Z!C!uShXyU6>UCu=QeWl{=KYRR9v$8$|)nr zy|>=L%3i#(4Vzn0zRMi3W@COS+Y0dfaqY`g2!PpKY~vg6$~?w;AWw@zSP5x956f}5 z&C82oh)}gdT;wLm!R!&k-piI)Vm4TVmCC|JyP*Al2gqk{&#vN&?B@9_Q zxZtXb>b+)1ooIb216J4i#)lE5!y2~a#IdXEBGDG9p3IEniT6 z^ojOAy6AJrjowk2<;&L;w@8uEZbaQ(U!p17=FGXI)hd#0diMRvq|D;tv3 zcH_)xpYn29l&M;|c7ma6J!UK|}4>S-ULLZ&j0uBaWa(nlx)dP+*e!L%D@mwycM zGA~ruyf(BaDgp|C+#tWHjHXB@L7}H!D8Ep(vi3AXH~RHdMNn=*6b{R&6oCMXEn8lD z^2DK{Yk#WWtdsMK+}C`zCgNn=Q11ui`nq;<&bb$$Y)R>d@4ltoa`$8BB>|3BfF3C) z4k1!x<^#p9iU69O8(&#gCj$^bli%wrgYO?8FJ zq_R+V!9&k zL|g|&6u--ezLkM3lY{$=L;ftaM@I|&`w@ARHGt3_G0lf%0~4d3&gav`Uc6wxaB~y4 z^@{?$BC3%NQr~?Bme=<;ZZc`@iU0tX*R}0COdPu+4Cm+;P?onT0(G#wUP71I@$#z( z;QRIrAU7rIiPFGA#-QkU>4y#xBXMjuwiA-EZ*yn0!z~7Y7*$Ae56p66$?DQl1}L2R ziJf~=Kd~dYD8Zxo?I%2q@7s(g%GZ3TOz4>$SRlO3a$w{@O@y8aWVRd-rSuHMv~+)T z4IvOKoys1*Vrw3||F%04iG=GEF5P)Ggzmhmb8F1c&a6~C&Ym#2+AHWA+V-W4n~?cd zpYk?)@$Xd^z-}=(4FH5sRqjp&Jv{@0pE7OB;#0=T1cHP{kDa(^-jVvnQ;JIn1PMWT z#x?U6Pn>)afgqt&Xa8hdQBTjbG&P(m#-Jf&-zSd#l?GI zp)+5F^^yzZ2KfQUTy2KJakF#|%D{Ep1T}Q3L&$LxZh{IydRzno@d`1eXowamZ65CD zR6ILv#^tUG(Q*=`#|O_jDP^yN06V4N>$0L~q$o~98VL<;l%*&QYg8P=8VwrOXmod2 zqg{!hIOoBqUM`c2!U2M4bRHj=sZ>3f-q3|cO=v%O)6Xt#%2bU&&RMczU0*>` z2OF9Z%T$2lonDZHgrUj%7R;X7kgl%2oC99~53PD_kfh6l(rqBbw^~3G)dLG>UVOmM zHUUrPz{sF28aac`)*hR&v9=YK0$PB^jH*Q)$}XosdSvP795{+ZZP!O=n(7Eg;xNtJ z0+J*fa-q2Mx+^ZQ#&%HF7US2{)JP2-1JBZgW5>{D-h9Zxj|C({>gXG--&#>oVNRWy z&RM?vzjQCn;k?~T<43{c0jEUkNB0b!!}bg@=iEo%Eya1f$?147dOA9^(oJ2r(oJ3R z?+imMd+NY&G3cK)h`f67iwIAdepjA`^+N_&p}KE=K1(j&f9 zAnzBA_Kv<-5j2I~0vn2gIwokl`A8?rGC6(Z7%Auz1a$(xi1gPx!cjh2B#%CAbOW>c_;b&bwyJ7Z9C7M(L>hOQD;xmY zCod6w-Q%t}ySINv4%F>)g#%#FkilfwsNtSC=>oIj958w+!}}2wjP7N4KRm$bUWWI> z1B~9)hWFEMR-A(kJM|zxJqGD9b?QN>dJNKH>ePc$^%$hZ)Tsw$qsL%-S#?g>gV4;u z((r>InB8(h6*?y;W)9X!=$v47%L!HJoSc|BSRB>!S8ssDgvR$9S33oXV)|w{)$Zc*2V6#u|7F_9zNoeM~Ids3()gNBznJwSH4*Q z{36re`$-srSQtb&IG1SIU+-8NZ;OxR>ER%mYkzU?T&P>V_%};i6Kxha94s?u(H|K6 z$%pP*+Sb})fx|&F*DSnyZgEMO%Jc0_dGL!Y6h<3JTn*%$7gjF092^6`GRI%^q@S?> zgF0{w{OTNk(UX5nI5-A=g^s`INk9xf^ZMIY^Yy(c4}K93TsgH~(hb)idG|6%Nm(Cu z=nwq-A6}RT7{cM_0P(^+4~L%z#0&FCi}k%J1%H5FGTxs9kG9&ER-6xqd4U1JsO)DA zk3Nzzh4&_>psu(-C*0YF7Ri&8-`QpkLSd_0|Hz?_VQ*rd$l0sJ0K0?zamyhnZ}uGC z65(!Y-Wu7>``%4$7b84}z;2PQD+fM@z%D{~f`{EA!OLBCf`^+3;n_ECmPxM9`q?+h zO7+u5o>ZuY dCl&IB{XalUnPp*y+1LO8002ovPDHLkV1j)P-su1U literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 48ef7b2c30..6d7de4a9b1 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5826,3 +5826,58 @@ function get_events_get_response_target( } } } + + +/** + * Gets the count of events by criticity. + * + * @param integer $utimestamp Utimestamp to search. + * @param integer $eventType Event type. + * @param array $groupId Groups. + * @param integer $eventStatus Event status. + * @param array $criticityId Criticity to search. + * + * @return array + */ +function get_count_event_criticity( + $utimestamp, + $eventType, + $groupId, + $eventStatus, + $criticityId +) { + $type = ' '; + if ($eventType !== '0') { + $type = 'AND event_type = "'.$eventType.'"'; + } + + $groups = ' '; + if ((int) $groupId !== 0) { + $groups = 'AND id_grupo IN ('.$groupId.')'; + } + + $status = ' '; + if ((int) $eventStatus !== -1) { + $status = 'AND estado = '.$eventStatus; + } + + $criticity = ' '; + if (empty($criticityId) === false) { + $criticity = 'AND criticity IN ('.$criticityId.')'; + } + + $sql_meta = sprintf( + 'SELECT COUNT(id_evento) AS count, + criticity + FROM tevento + WHERE utimestamp >= %d %s %s %s %s + GROUP BY criticity', + $utimestamp, + $type, + $groups, + $status, + $criticity + ); + + return db_get_all_rows_sql($sql_meta); +} diff --git a/pandora_console/include/lib/Dashboard/Widget.php b/pandora_console/include/lib/Dashboard/Widget.php index 2753b8a55d..bb082de0c7 100644 --- a/pandora_console/include/lib/Dashboard/Widget.php +++ b/pandora_console/include/lib/Dashboard/Widget.php @@ -420,6 +420,7 @@ class Widget case 'ColorModuleTabs': case 'BlockHistogram': case 'DataMatrix': + case 'EventCardboard': $className .= '\\'.$name; break; diff --git a/pandora_console/include/lib/Dashboard/Widgets/EventCardboard.php b/pandora_console/include/lib/Dashboard/Widgets/EventCardboard.php new file mode 100644 index 0000000000..87e592c8af --- /dev/null +++ b/pandora_console/include/lib/Dashboard/Widgets/EventCardboard.php @@ -0,0 +1,664 @@ +width = $width; + + // Height. + $this->height = $height; + + // Grid Width. + $this->gridWidth = $gridWidth; + + // Cell Id. + $this->cellId = $cellId; + + // Options. + $this->values = $this->decoders($this->getOptionsWidget()); + + // Positions. + $this->position = $this->getPositionWidget(); + + // Page. + $this->page = basename(__FILE__); + + // ClassName. + $class = new \ReflectionClass($this); + $this->className = $class->getShortName(); + + // Title. + $this->title = __('Event cardboard'); + + // Name. + if (empty($this->name) === true) { + $this->name = 'EventCardboard'; + } + + // This forces at least a first configuration. + $this->configurationRequired = false; + if (isset($this->values['groupId']) === false) { + $this->configurationRequired = true; + } + + $this->overflow_scrollbars = false; + } + + + /** + * Decoders hack for retrocompability. + * + * @param array $decoder Values. + * + * @return array Returns the values ​​with the correct key. + */ + public function decoders(array $decoder): array + { + $values = []; + // Retrieve global - common inputs. + $values = parent::decoders($decoder); + + if (isset($decoder['eventType']) === true) { + $values['eventType'] = $decoder['eventType']; + } + + if (isset($decoder['maxHours']) === true) { + $values['maxHours'] = $decoder['maxHours']; + } + + if (isset($decoder['eventStatus']) === true) { + $values['eventStatus'] = $decoder['eventStatus']; + } + + if (isset($decoder['severity']) === true) { + $values['severity'] = $decoder['severity']; + } + + if (isset($decoder['groupId']) === true) { + $values['groupId'] = $decoder['groupId']; + } + + if (isset($decoder['nodes']) === true) { + $values['nodes'] = $decoder['nodes']; + } + + return $values; + } + + + /** + * Generates inputs for form (specific). + * + * @return array Of inputs. + * + * @throws Exception On error. + */ + public function getFormInputs(): array + { + $values = $this->values; + + // Retrieve global - common inputs. + $inputs = parent::getFormInputs(); + + // Remove background field, this widget doesn't use it. + foreach ($inputs as $kIn => $vIn) { + if ($vIn['label'] === 'Background') { + unset($inputs[$kIn]); + } + } + + $blocks = [ + 'row1', + 'row2', + ]; + + $inputs['blocks'] = $blocks; + + foreach ($inputs as $kInput => $vInput) { + $inputs['inputs']['row1'][] = $vInput; + } + + // Event Type. + $fields = get_event_types(); + $fields['not_normal'] = __('Not normal'); + + $inputs['inputs']['row1'][] = [ + 'label' => __('Event type'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $fields, + 'class' => 'event-widget-input', + 'name' => 'eventType', + 'selected' => $values['eventType'], + 'return' => true, + 'nothing' => __('Any'), + 'nothing_value' => 0, + ], + ]; + + // Max. hours old. Default 8. + if (isset($values['maxHours']) === false) { + $values['maxHours'] = 8; + } + + $inputs['inputs']['row1'][] = [ + 'label' => __('Max. hours old'), + 'arguments' => [ + 'name' => 'maxHours', + 'type' => 'number', + 'class' => 'event-widget-input', + 'value' => $values['maxHours'], + 'return' => true, + 'min' => 0, + ], + ]; + + // Event status. + $fields = [ + -1 => __('All event'), + 1 => __('Only validated'), + 0 => __('Only pending'), + ]; + + $inputs['inputs']['row1'][] = [ + 'label' => __('Event status'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $fields, + 'class' => 'event-widget-input', + 'name' => 'eventStatus', + 'selected' => $values['eventStatus'], + 'return' => true, + ], + ]; + + // Groups. + $return_all_group = false; + $selected_groups_array = explode(',', $values['groupId'][0]); + + if (empty($values['groupId'][0]) === true) { + $selected_groups_array = [0]; + } + + if ((bool) \users_can_manage_group_all('RM') === true + || ($selected_groups_array[0] !== '' + && in_array(0, $selected_groups_array) === true) + ) { + // Return all group if user has permissions or it is a currently + // selected group. + $return_all_group = true; + } + + $inputs['inputs']['row1'][] = [ + 'label' => __('Groups'), + 'arguments' => [ + 'type' => 'select_groups', + 'name' => 'groupId[]', + 'class' => 'event-widget-input', + 'returnAllGroup' => true, + 'privilege' => 'AR', + 'selected' => $selected_groups_array, + 'return' => true, + 'multiple' => true, + 'returnAllGroup' => $return_all_group, + 'required' => true, + ], + ]; + + // Nodes. + if (is_metaconsole() === true) { + $nodes_fields = []; + $servers_ids = metaconsole_get_servers(); + + foreach ($servers_ids as $server) { + $nodes_fields[$server['id']] = $server['server_name']; + } + + $nodes_fields[0] = __('Metaconsola'); + + $nodes_selected = explode(',', $values['nodes']); + + (isset($values['nodes']) === false) ? $nodes_selected = $servers_ids : ''; + + $nodes_height = count($nodes_fields); + if (count($nodes_fields) > 5) { + $nodes_height = 5; + } + + $inputs['inputs']['row2'][] = [ + 'label' => __('Servers'), + 'arguments' => [ + 'name' => 'nodes', + 'type' => 'select', + 'fields' => $nodes_fields, + 'selected' => $nodes_selected, + 'return' => true, + 'multiple' => true, + 'class' => 'overflow-hidden', + 'size' => $nodes_height, + 'select_all' => false, + 'required' => true, + ], + ]; + } + + // Severity. + $fields = get_priorities(); + + $severity_selected = explode(',', $values['severity']); + + if (isset($values['severity']) === false) { + $severity_selected = array_keys($fields); + } + + $inputs['inputs']['row2'][] = [ + 'label' => __('Severity'), + 'arguments' => [ + 'type' => 'select', + 'fields' => $fields, + 'class' => 'event-widget-input', + 'name' => 'severity', + 'selected' => $severity_selected, + 'return' => true, + 'multiple' => true, + ], + ]; + + return $inputs; + } + + + /** + * Get Post for widget. + * + * @return array + */ + public function getPost():array + { + // Retrieve global - common inputs. + $values = parent::getPost(); + + $values['eventType'] = \get_parameter('eventType', 0); + $values['maxHours'] = \get_parameter('maxHours', 8); + $values['eventStatus'] = \get_parameter('eventStatus', -1); + $values['groupId'] = \get_parameter('groupId', []); + $values['severity'] = \get_parameter('severity', -1); + $values['nodes'] = \get_parameter('nodes', 0); + + return $values; + } + + + /** + * Draw widget. + * + * @return string; + */ + public function load() + { + $output = ''; + + ui_require_css_file('events', 'include/styles/', true); + ui_require_javascript_file('pandora_events', 'include/javascript/', true); + + $eventType = $this->values['eventType']; + $groupId = implode(',', $this->values['groupId']); + $utimestamp = strtotime('-'.$this->values['maxHours'].' hours'); + $eventStatus = $this->values['eventStatus']; + $severity = $this->values['severity']; + + $priorities = explode(',', $severity); + // Sort criticity array. + asort($priorities); + + $count_meta = []; + $count_meta_tmp = []; + if (is_metaconsole() === true) { + $meta = false; + $nodes = $this->values['nodes']; + + if (isset($nodes) === true) { + $servers_ids = explode(',', $nodes); + } + + if (in_array(0, $servers_ids) === true) { + $meta = true; + unset($servers_ids[0]); + } + + if (is_metaconsole() === true && $meta === true) { + $events_meta_rows = get_count_event_criticity( + $utimestamp, + $eventType, + $groupId, + $eventStatus, + $severity + ); + + array_push($count_meta_tmp, $events_meta_rows); + } + + foreach ($servers_ids as $server_id) { + try { + $node = new Node((int) $server_id); + $node->connect(); + + $events_meta_rows = get_count_event_criticity( + $utimestamp, + $eventType, + $groupId, + $eventStatus, + $severity + ); + + array_push($count_meta_tmp, $events_meta_rows); + $node->disconnect(); + } catch (\Exception $e) { + // Unexistent envents. + $node->disconnect(); + } + } + + foreach ($count_meta_tmp as $tmpValue) { + foreach ($tmpValue as $value) { + array_push($count_meta, $value); + } + } + + $events_rows = []; + foreach ($priorities as $pKey) { + $count = 0; + $tmp['criticity'] = $pKey; + foreach ($count_meta as $kEventMeta => $vEventMeta) { + if ((int) $pKey === (int) $vEventMeta['criticity']) { + $count += (int) $vEventMeta['count']; + } + } + + $tmp['count'] = $count; + array_push($events_rows, $tmp); + } + } else { + $events_rows = get_count_event_criticity( + $utimestamp, + $eventType, + $groupId, + $eventStatus, + $severity + ); + } + + $output .= ''; + + $width_td = (100 / count(explode(',', $severity))); + + $td_count = 0; + foreach ($priorities as $key) { + $count = 0; + foreach ($events_rows as $event) { + if ((int) $key === (int) $event['criticity']) { + $count = $event['count']; + } + } + + switch ((int) $key) { + case 0: + $text = __('Maintenance'); + $color = get_priority_class((int) $key); + break; + + case 1: + $text = __('Informational'); + $color = get_priority_class((int) $key); + break; + + case 2: + $text = __('Normal'); + $color = get_priority_class((int) $key); + break; + + case 3: + $text = __('Warning'); + $color = get_priority_class((int) $key); + break; + + case 4: + $text = __('Critical'); + $color = get_priority_class((int) $key); + break; + + case 5: + $text = __('Minor'); + $color = get_priority_class((int) $key); + break; + + case 6: + $text = __('Major'); + $color = get_priority_class((int) $key); + break; + + case 20: + $text = __('Not normal'); + $color = get_priority_class((int) $key); + break; + + case 21: + $text = __('Critical').'/'.__('Normal'); + $color = get_priority_class((int) $key); + break; + + case 34: + $text = __('Warning').'/'.__('Critical'); + $color = get_priority_class((int) $key); + break; + + default: + return false; + } + + $border = ''; + $td_count++; + if (count($priorities) > $td_count) { + $border = ' border-right: 1px solid white; border-collapse: collapse;'; + } + + $output .= ''; + } + + $output .= '
'; + $output .= $count; + $output .= '
'; + $output .= $text; + $output .= '
'; + + return $output; + } + + + /** + * Get description. + * + * @return string. + */ + public static function getDescription() + { + return __('Event cardboard'); + } + + + /** + * Get Name. + * + * @return string. + */ + public static function getName() + { + return 'EventCardboard'; + } + + + /** + * Get size Modal Configuration. + * + * @return array + */ + public function getSizeModalConfiguration(): array + { + if (is_metaconsole() === true) { + $size = [ + 'width' => 950, + 'height' => 450, + ]; + } else { + $size = [ + 'width' => 900, + 'height' => 450, + ]; + } + + return $size; + } + + +} diff --git a/pandora_console/include/styles/meta_dashboards.css b/pandora_console/include/styles/meta_dashboards.css index f75afafa93..f3716c0f81 100644 --- a/pandora_console/include/styles/meta_dashboards.css +++ b/pandora_console/include/styles/meta_dashboards.css @@ -29,3 +29,18 @@ li#select_multiple_modules_filtered { #menu_tab li.nomn form#form-select-dashboard { margin-top: 0px !important; } + +.table-border-0 { + border: none !important; + border-spacing: 0px !important; +} + +.big_data { + text-decoration: none; + font-size: 2em; +} + +.med_data { + text-decoration: none; + font-size: 1.5em; +} From 96ba57606934f2806d941422a3d54711f8f8f20c Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 16 Feb 2023 19:24:56 +0100 Subject: [PATCH 43/87] Prevent rpmbuild from messing PAR::Packer binaries. --- pandora_agents/pc/pandora_agent.redhat.spec | 1 + pandora_agents/pc/pandora_agent.spec | 1 + pandora_agents/shellscript/linux/pandora_agent.spec | 1 + pandora_agents/unix/pandora_agent.redhat.spec | 1 + pandora_agents/unix/pandora_agent.spec | 1 + pandora_server/pandora_server.redhat.spec | 1 + pandora_server/pandora_server.spec | 1 + 7 files changed, 7 insertions(+) diff --git a/pandora_agents/pc/pandora_agent.redhat.spec b/pandora_agents/pc/pandora_agent.redhat.spec index ae481e3403..ce60c8841f 100644 --- a/pandora_agents/pc/pandora_agent.redhat.spec +++ b/pandora_agents/pc/pandora_agent.redhat.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 4.0 %define release 1 diff --git a/pandora_agents/pc/pandora_agent.spec b/pandora_agents/pc/pandora_agent.spec index 1bfc289d52..5ad481315a 100644 --- a/pandora_agents/pc/pandora_agent.spec +++ b/pandora_agents/pc/pandora_agent.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 4.0.1 %define release 1 diff --git a/pandora_agents/shellscript/linux/pandora_agent.spec b/pandora_agents/shellscript/linux/pandora_agent.spec index 64b33bfecf..9c5e0296c6 100755 --- a/pandora_agents/shellscript/linux/pandora_agent.spec +++ b/pandora_agents/shellscript/linux/pandora_agent.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent %define version 3.2 Summary: Pandora FMS Linux agent diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index c914f7980f..b7292a432a 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.768 %define release 230206 diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 55d75e5a3b..041e0d5aec 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.768 %define release 230206 diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 2760e9c975..ee0ef5ad8e 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -1,6 +1,7 @@ # # Pandora FMS Server # +%global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.768 %define release 230206 diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index fbc20d43e9..65c8751e45 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -1,6 +1,7 @@ # # Pandora FMS Server # +%global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.768 %define release 230206 From f4d3c65c2b56f4ee4ca314d50f792143f3d23ef3 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 17 Feb 2023 13:13:37 +0100 Subject: [PATCH 44/87] Fix error on pandoradb delete cookies file --- pandora_server/util/pandora_db.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 9a1f94b0ee..ac725d1a10 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -53,6 +53,9 @@ my $SMALL_OPERATION_STEP = 1000; # 1000 is default # Timeout for lock acquisition. my $LOCK_TIMEOUT = 60; +# Cron cookies file. +my $COOKIES_FILE = '/tmp/cron-session-cookies'; + # FLUSH in each IO $| = 1; @@ -1075,9 +1078,8 @@ sub pandora_delete_old_session_data { db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'"); # Delete cron cookies file - my $cookie_file = '/tmp/cron-session-cookies'; log_message ('PURGE', "Deleting cron session file"); - unlink($cookie_file) or die log_message ('PURGE', "Could not delete session file"); + unlink($COOKIES_FILE); } From 8db5ef0789187be300839f98ec92245d2d0839e1 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 18 Feb 2023 01:01:14 +0100 Subject: [PATCH 45/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5f29343d22..c6285e9055 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230217 +Version: 7.0NG.769-230218 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 07e42a8119..d98a0a0745 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.769-230217" +pandora_version="7.0NG.769-230218" 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 33f9b75177..7ecb45a3d7 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230217'; +use constant AGENT_BUILD => '230218'; # 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 982080d877..e03f30f3a1 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.769 -%define release 230217 +%define release 230218 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index bff8999226..c26329c1e8 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.769 -%define release 230217 +%define release 230218 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 0955293f59..e28c1a7b86 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230217" +PI_BUILD="230218" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9d180788d6..8dc3194732 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230217} +{230218} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b6a69e5783..3737dad91a 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.769 Build 230217") +#define PANDORA_VERSION ("7.0NG.769 Build 230218") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 61bf76a879..1f650a737a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230217))" + VALUE "ProductVersion", "(7.0NG.769(Build 230218))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7eaf7524ea..8089e40024 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230217 +Version: 7.0NG.769-230218 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 d6e24860e3..0e36ebcd8f 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.769-230217" +pandora_version="7.0NG.769-230218" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6b8c7c25fa..3f9824106a 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 = 'PC230217'; +$build_version = 'PC230218'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 64d39e5054..b3495001ca 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 81140cd2e6..dfe72969d2 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.769 -%define release 230217 +%define release 230218 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e834877aaa..4dd0423865 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.769 -%define release 230217 +%define release 230218 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index f81e4030b3..3e7a00c99e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230217" +PI_BUILD="230218" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ac725d1a10..1dee961de0 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.769 Build 230217"; +my $version = "7.0NG.769 Build 230218"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ea21a3610f..0c75ecd044 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.769 Build 230217"; +my $version = "7.0NG.769 Build 230218"; # save program name for logging my $progname = basename($0); From 5a56dc01213bafc03cedbc1aeed926f9407cee78 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 19 Feb 2023 01:02:04 +0100 Subject: [PATCH 46/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c6285e9055..7259a4624f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230218 +Version: 7.0NG.769-230219 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 d98a0a0745..05a2fdd102 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.769-230218" +pandora_version="7.0NG.769-230219" 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 7ecb45a3d7..046ea7a7ea 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230218'; +use constant AGENT_BUILD => '230219'; # 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 e03f30f3a1..2efa397c6f 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.769 -%define release 230218 +%define release 230219 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index c26329c1e8..62f7e0a23c 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.769 -%define release 230218 +%define release 230219 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 e28c1a7b86..b37e0eedea 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230218" +PI_BUILD="230219" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8dc3194732..7534dfdf45 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230218} +{230219} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3737dad91a..59c0e1f2e2 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.769 Build 230218") +#define PANDORA_VERSION ("7.0NG.769 Build 230219") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1f650a737a..995a3d436e 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230218))" + VALUE "ProductVersion", "(7.0NG.769(Build 230219))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8089e40024..7e8b4a29f0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230218 +Version: 7.0NG.769-230219 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 0e36ebcd8f..d00729681d 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.769-230218" +pandora_version="7.0NG.769-230219" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3f9824106a..4c14e2dd2b 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 = 'PC230218'; +$build_version = 'PC230219'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b3495001ca..3544aaab85 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 dfe72969d2..88c7d7ba97 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.769 -%define release 230218 +%define release 230219 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 4dd0423865..964fab20b2 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.769 -%define release 230218 +%define release 230219 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3e7a00c99e..5ed07b9a84 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230218" +PI_BUILD="230219" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1dee961de0..8d2e18337b 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.769 Build 230218"; +my $version = "7.0NG.769 Build 230219"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0c75ecd044..f2353801cf 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.769 Build 230218"; +my $version = "7.0NG.769 Build 230219"; # save program name for logging my $progname = basename($0); From c24bf70cc2104484702538c38b8b3658c98ec451 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 20 Feb 2023 01:01:37 +0100 Subject: [PATCH 47/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7259a4624f..bc6b5f0a61 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230219 +Version: 7.0NG.769-230220 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 05a2fdd102..dff687f821 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.769-230219" +pandora_version="7.0NG.769-230220" 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 046ea7a7ea..254bcd2bb7 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230219'; +use constant AGENT_BUILD => '230220'; # 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 2efa397c6f..e79f2fbb48 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.769 -%define release 230219 +%define release 230220 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 62f7e0a23c..3807bddd44 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.769 -%define release 230219 +%define release 230220 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 b37e0eedea..24e9feb2ad 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230219" +PI_BUILD="230220" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7534dfdf45..e18d90153f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230219} +{230220} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 59c0e1f2e2..354f282757 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.769 Build 230219") +#define PANDORA_VERSION ("7.0NG.769 Build 230220") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 995a3d436e..98564615ba 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230219))" + VALUE "ProductVersion", "(7.0NG.769(Build 230220))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7e8b4a29f0..34e0cb2453 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230219 +Version: 7.0NG.769-230220 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 d00729681d..654c9a5d97 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.769-230219" +pandora_version="7.0NG.769-230220" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4c14e2dd2b..e0058687db 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 = 'PC230219'; +$build_version = 'PC230220'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 3544aaab85..9a64b90539 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 88c7d7ba97..6fbeb80a2f 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.769 -%define release 230219 +%define release 230220 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 964fab20b2..0395fe8616 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.769 -%define release 230219 +%define release 230220 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5ed07b9a84..40b85fefa1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230219" +PI_BUILD="230220" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8d2e18337b..276c0f4d20 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.769 Build 230219"; +my $version = "7.0NG.769 Build 230220"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f2353801cf..d50993673a 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.769 Build 230219"; +my $version = "7.0NG.769 Build 230220"; # save program name for logging my $progname = basename($0); From 1d0046b3c167a2ab7a38092f233d68c2213200fb Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 20 Feb 2023 10:07:10 +0100 Subject: [PATCH 48/87] #10459 activate Apply password policy to admin users default by default --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index db55df207d..21fd247902 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -97,7 +97,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('first_login', 0), ('mins_fail_pass', 5), ('number_attempts', 5), -('enable_pass_policy_admin', 0), +('enable_pass_policy_admin', 1), ('enable_pass_history', 0), ('compare_pass', 3), ('meta_style', 'meta_pandora'), From bf307adb01a67acf6b056a1195a89cccc7f3b711 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 20 Feb 2023 10:47:00 +0100 Subject: [PATCH 49/87] 10483-Fixed csrf token on login after logout --- pandora_console/general/login_page.php | 4 ++++ pandora_console/index.php | 1 + 2 files changed, 5 insertions(+) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index bb9fa19185..cd45f34f48 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -359,6 +359,10 @@ if ($config['enterprise_installed']) { } // CSRF validation. +if (isset($_SESSION['csrf_code']) === true) { + unset($_SESSION['csrf_code']); +} + html_print_csrf_hidden(); echo '
'; diff --git a/pandora_console/index.php b/pandora_console/index.php index 1826dbe789..d7f124575b 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1049,6 +1049,7 @@ if (isset($_GET['bye'])) { header_remove('Set-Cookie'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); + generate_csrf_code(); // Process logout. include 'general/logoff.php'; From f67bf4d084db8c2af4c343ec2d98af9009a75591 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 20 Feb 2023 13:10:00 +0100 Subject: [PATCH 50/87] #10416 added name agent in filter event --- pandora_console/operation/events/events.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 6777ced4c3..7dffeeb9b6 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -239,6 +239,13 @@ $server_id = get_parameter( ($filter['server_id'] ?? '') ); +if (empty($id_agent) === true) { + $id_agent = get_parameter( + 'id_agent', + ($filter['id_agent'] ?? '') + ); +} + if (is_metaconsole() === true) { $servers = metaconsole_get_servers(); if (is_array($servers) === true) { From 03c40fe582d92f37686f28ce3c27737b41ea2683 Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 20 Feb 2023 18:52:35 +0100 Subject: [PATCH 51/87] 10435 adding features to online installers --- .../deploy-scripts/deploy_ext_database_el8.sh | 2 ++ .../deploy_ext_database_ubuntu_2204.sh | 4 +-- .../pandora_deploy_community_el8.sh | 15 +++++++- .../pandora_deploy_community_ubuntu_2204.sh | 34 ++++++++++++++++--- 4 files changed, 47 insertions(+), 8 deletions(-) diff --git a/extras/deploy-scripts/deploy_ext_database_el8.sh b/extras/deploy-scripts/deploy_ext_database_el8.sh index 422887b0e2..93dc1c561c 100644 --- a/extras/deploy-scripts/deploy_ext_database_el8.sh +++ b/extras/deploy-scripts/deploy_ext_database_el8.sh @@ -275,6 +275,8 @@ EO_CONFIG_F if [ "$MYVER" -eq '80' ] ; then sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf + sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf + fi execute_cmd "systemctl restart mysqld" "Configuring database engine" diff --git a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh index a82244c3b6..22349ea5ce 100644 --- a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh +++ b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh @@ -181,7 +181,7 @@ cat > /etc/mysql/my.cnf << EOF_DB [mysqld] datadir=/var/lib/mysql user=mysql -character-set-server=utf8 +character-set-server=utf8mb4 skip-character-set-client-handshake # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 @@ -196,7 +196,7 @@ innodb_flush_log_at_trx_commit = 0 innodb_flush_method = O_DIRECT innodb_log_file_size = 64M innodb_log_buffer_size = 16M -innodb_io_capacity = 100 +innodb_io_capacity = 300 thread_cache_size = 8 thread_stack = 256K max_connections = 100 diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 13f90fcf85..4fa0814d59 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -107,6 +107,17 @@ check_root_permissions () { fi } +installing_docker () { + #Installing docker for debug + echo "Start installig docker" &>> "$LOGFILE" + dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &>> "$LOGFILE" + dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE" + systemctl disable --now docker &>> "$LOGFILE" + systemctl disable docker.socket --now &>> "$LOGFILE" + echo "End installig docker" &>> "$LOGFILE" +} + + ## Main echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" @@ -207,6 +218,7 @@ else execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" fi +execute_cmd "installing_docker" "Installing Docker for debug" #Installing wget execute_cmd "dnf install -y wget" "Installing wget" @@ -454,7 +466,7 @@ innodb_flush_log_at_trx_commit = 0 innodb_flush_method = O_DIRECT innodb_log_file_size = 64M innodb_log_buffer_size = 16M -innodb_io_capacity = 100 +innodb_io_capacity = 300 thread_cache_size = 8 thread_stack = 256K max_connections = 100 @@ -483,6 +495,7 @@ EO_CONFIG_F if [ "$MYVER" -eq '80' ] ; then sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf + sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf fi execute_cmd "systemctl restart mysqld" "Configuring database engine" diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index b22d5d163f..5ac47ca60b 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -106,6 +106,21 @@ check_root_permissions () { fi } +installing_docker () { + #Installing docker for debug + echo "Start installig docker" &>> "$LOGFILE" + mkdir -m 0755 -p /etc/apt/keyrings &>> "$LOGFILE" + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /etc/apt/keyrings/docker.gpg &>> "$LOGFILE" + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &>> "$LOGFILE" + apt update -y &>> "$LOGFILE" + apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE" + systemctl disable docker --now &>> "$LOGFILE" + systemctl disable docker.socket --now &>> "$LOGFILE" + echo "End installig docker" &>> "$LOGFILE" +} + ## Main echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION" @@ -173,7 +188,7 @@ execute_cmd "cd $WORKDIR" "Moving to workdir: $WORKDIR" ## Install utils execute_cmd "apt update" "Updating repos" -execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https" "Installing utils" +execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https ca-certificates gnupg lsb-release" "Installing utils" #Installing Apache and php-fpm [ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo" @@ -221,7 +236,8 @@ systemctl restart php$PHPVER-fpm &>> "$LOGFILE" php$PHPVER-xml \ php$PHPVER-yaml \ libnet-telnet-perl \ - whois" + whois \ + cron" execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies" # Server dependencies @@ -254,10 +270,13 @@ server_dependencies=" \ libnet-telnet-perl \ libjson-perl \ libencode-perl \ + cron \ libgeo-ip-perl \ openjdk-8-jdk " execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" +execute_cmd "installing_docker" "Installing Docker for debug" + # wmic and pandorawmic execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic" execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic" @@ -393,7 +412,7 @@ cat > /etc/mysql/my.cnf << EOF_DB [mysqld] datadir=/var/lib/mysql user=mysql -character-set-server=utf8 +character-set-server=utf8mb4 skip-character-set-client-handshake # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 @@ -408,7 +427,7 @@ innodb_flush_log_at_trx_commit = 0 innodb_flush_method = O_DIRECT innodb_log_file_size = 64M innodb_log_buffer_size = 16M -innodb_io_capacity = 100 +innodb_io_capacity = 300 thread_cache_size = 8 thread_stack = 256K max_connections = 100 @@ -731,10 +750,15 @@ systemctl enable pandora_server &>> "$LOGFILE" execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" systemctl enable tentacle_serverd &>> "$LOGFILE" -# Enabling condole cron +# Enabling console cron execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab +# Enabling pandoradb cron +execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron" +echo "@hourly root bash -c /etc/cron.hourly/pandora_db" >> /etc/crontab + + ## Enabling agent adn configuring Agente sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE" execute_cmd "/etc/init.d/pandora_agent_daemon start" "Starting PandoraFSM Agent" From 490d3db08625650f0ce6c4828b2633ca43e144ca Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 21 Feb 2023 01:01:52 +0100 Subject: [PATCH 52/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index bc6b5f0a61..5a537cea8d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230220 +Version: 7.0NG.769-230221 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 dff687f821..3bdb964eb0 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.769-230220" +pandora_version="7.0NG.769-230221" 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 254bcd2bb7..cd0fdd0989 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230220'; +use constant AGENT_BUILD => '230221'; # 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 e79f2fbb48..1a82c15221 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.769 -%define release 230220 +%define release 230221 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3807bddd44..4015375532 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.769 -%define release 230220 +%define release 230221 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 24e9feb2ad..6d8458b318 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230220" +PI_BUILD="230221" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e18d90153f..bd75795838 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230220} +{230221} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 354f282757..f38933f5b9 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.769 Build 230220") +#define PANDORA_VERSION ("7.0NG.769 Build 230221") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 98564615ba..21f5675492 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230220))" + VALUE "ProductVersion", "(7.0NG.769(Build 230221))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 34e0cb2453..919f840961 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230220 +Version: 7.0NG.769-230221 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 654c9a5d97..524fd6c38c 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.769-230220" +pandora_version="7.0NG.769-230221" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e0058687db..af73bd3842 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 = 'PC230220'; +$build_version = 'PC230221'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9a64b90539..5976f2c24e 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 6fbeb80a2f..e972b323a3 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.769 -%define release 230220 +%define release 230221 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0395fe8616..3412365986 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.769 -%define release 230220 +%define release 230221 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 40b85fefa1..cd73c5e77f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230220" +PI_BUILD="230221" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 276c0f4d20..b54b653594 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.769 Build 230220"; +my $version = "7.0NG.769 Build 230221"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d50993673a..37b388fb73 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.769 Build 230220"; +my $version = "7.0NG.769 Build 230221"; # save program name for logging my $progname = basename($0); From 77f4f4a68001f534afd304f85870445f426dc08d Mon Sep 17 00:00:00 2001 From: rafael Date: Tue, 21 Feb 2023 12:34:11 +0100 Subject: [PATCH 53/87] 10435 set new version number --- extras/deploy-scripts/deploy_ext_database_el8.sh | 2 +- extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh | 2 +- extras/deploy-scripts/pandora_deploy_community_el8.sh | 2 +- extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extras/deploy-scripts/deploy_ext_database_el8.sh b/extras/deploy-scripts/deploy_ext_database_el8.sh index 93dc1c561c..52bad444fe 100644 --- a/extras/deploy-scripts/deploy_ext_database_el8.sh +++ b/extras/deploy-scripts/deploy_ext_database_el8.sh @@ -9,7 +9,7 @@ # RedHat 8.5 #Constants -S_VERSION='202302081' +S_VERSION='202302201' LOGFILE="/tmp/deploy-ext-db-$(date +%F).log" diff --git a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh index 22349ea5ce..dba6aa2773 100644 --- a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh +++ b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh @@ -16,7 +16,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf WORKDIR=/opt/pandora/deploy -S_VERSION='202302081' +S_VERSION='202302201' LOGFILE="/tmp/deploy-ext-db-$(date +%F).log" rm -f $LOGFILE &> /dev/null # remove last log before start diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 4fa0814d59..721d60ffb5 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='202301251' +S_VERSION='202302201' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 5ac47ca60b..06f23804db 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -16,7 +16,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf WORKDIR=/opt/pandora/deploy -S_VERSION='202301251' +S_VERSION='202302201' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" rm -f $LOGFILE &> /dev/null # remove last log before start From 9d3f253dd4304deadaf81c7b7b4b260d83005429 Mon Sep 17 00:00:00 2001 From: Rafael Date: Tue, 21 Feb 2023 15:36:37 +0100 Subject: [PATCH 54/87] 10435 fixing os description for ssh banner --- extras/deploy-scripts/pandora_deploy_community_el8.sh | 2 +- extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 721d60ffb5..fe00f81571 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -756,7 +756,7 @@ execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" cat > /etc/issue.net << EOF_banner -Welcome to Pandora FMS appliance on CentOS +Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8 ------------------------------------------ Go to Public http://$ipplublic/pandora_console$to to login web console $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 06f23804db..8bd8bcfaff 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -772,7 +772,7 @@ sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = open cat > /etc/issue.net << EOF_banner -Welcome to Pandora FMS appliance on CentOS +Welcome to Pandora FMS appliance on Ubuntu ------------------------------------------ Go to Public http://$ipplublic/pandora_console$to to login web console $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') From 2b185b5754c1d16793531ff8ed703ea4a22173c3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Feb 2023 15:44:41 +0100 Subject: [PATCH 55/87] #10493 fixed pagination in alerts --- pandora_console/godmode/alerts/alert_actions.php | 4 ++-- pandora_console/godmode/alerts/alert_commands.php | 6 +++--- pandora_console/godmode/alerts/alert_templates.php | 5 +++-- pandora_console/godmode/alerts/configure_alert_action.php | 3 ++- pandora_console/godmode/alerts/configure_alert_template.php | 3 ++- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 873d91598c..2089dc5900 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -391,7 +391,7 @@ foreach ($actions as $action) { $data = []; - $data[0] = ''.$action['name'].''; + $data[0] = ''.$action['name'].''; if ($action['id_group'] == 0 && $can_edit_all == false) { $data[0] .= ui_print_help_tip(__('You cannot edit this action, You don\'t have the permission to edit All group.'), true); } @@ -467,7 +467,7 @@ if (isset($data)) { if (is_management_allowed() === true) { echo '
'; - echo '
'; + echo ''; html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); html_print_input_hidden('create_alert', 1); echo '
'; diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 24d07a392f..2090461050 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -795,15 +795,15 @@ foreach ($commands as $command) { ); $data['action'] = ''; $table->cellclass[]['action'] = 'action_buttons'; - + $offset_delete = ($offset >= ($total_commands - 1)) ? ($offset - $limit) : $offset; // (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group. if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) { if (is_user_admin($config['id_user']) === true) { $data['action'] = ''; - $data['action'] .= ''.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).''; - $data['action'] .= ''.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).''; $data['action'] .= ''; } diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index c0374c210b..cd49f7ee7c 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -352,7 +352,8 @@ if ($search_string) { $filter[] = "(name LIKE '%".$search_string."%' OR description LIKE '%".$search_string."%' OR value LIKE '%".$search_string."%')"; } -$filter['offset'] = (int) get_parameter('offset'); +$offset = (int) get_parameter('offset'); +$filter['offset'] = $offset; $filter['limit'] = (int) $config['block_size']; if (!is_user_admin($config['id_user'])) { $filter['id_group'] = array_keys(users_get_groups(false, 'LM')); @@ -420,7 +421,7 @@ foreach ($templates as $template) { && check_acl($config['id_user'], $template['id_group'], 'LM') ) { $table->cellclass[][4] = 'action_buttons'; - $data[4] = '
'; + $data[4] = ''; $data[4] .= html_print_input_hidden('duplicate_template', 1, true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true); $data[4] .= html_print_input_image( diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 068026c953..240fa26fc3 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -372,8 +372,9 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { ); } +$offset = (int) get_parameter('offset', 0); -echo ''; +echo ''; $table_html = html_print_table($table, true); echo $table_html; diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 8838c5c458..0269d94573 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -1147,9 +1147,10 @@ if ($step == 2) { echo ui_get_using_system_timezone_warning(); } +$offset = (int) get_parameter('offset'); // If it's the last step it will redirect to template lists. if ($step >= LAST_STEP) { - echo ''; + echo ''; } else { echo ''; } From f9c3524be887ff07169ca028e55c79899a07c07f Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Feb 2023 16:05:24 +0100 Subject: [PATCH 56/87] #10493 fixed pagination in profiles --- pandora_console/godmode/users/user_list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 85e713bed0..11ecc02f11 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -816,7 +816,7 @@ foreach ($info as $user_id => $user_info) { $toDoClass = 'filter_none'; } - $data[6] = ''; + $data[6] = ''; $data[6] .= html_print_input_hidden( 'id', $user_info['id_user'], @@ -874,7 +874,8 @@ foreach ($info as $user_id => $user_info) { && $user_info['id_user'] != $config['id_user'] && isset($user_info['not_delete']) === false ) { - $data[6] .= ''; + $offset_delete = ($offset >= count($info) - 1) ? ($offset - $config['block_size']) : $offset; + $data[6] .= ''; $data[6] .= html_print_input_hidden( 'delete_user', $user_info['id_user'], From dfadbb0f80cc57d61bc1f1ccbb77163acf1ab6db Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Feb 2023 16:51:05 +0100 Subject: [PATCH 57/87] #10493 added pagination in group module --- pandora_console/godmode/groups/configure_modu_group.php | 5 +++-- pandora_console/godmode/groups/modu_group_list.php | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/groups/configure_modu_group.php b/pandora_console/godmode/groups/configure_modu_group.php index 9330aa1320..282bd81d18 100644 --- a/pandora_console/godmode/groups/configure_modu_group.php +++ b/pandora_console/godmode/groups/configure_modu_group.php @@ -40,6 +40,7 @@ $custom_id = ''; $create_group = (bool) get_parameter('create_group'); $id_group = (int) get_parameter('id_group'); +$offset = (int) get_parameter('offset', 0); if ($id_group) { $group = db_get_row('tmodule_group', 'id_mg', $id_group); @@ -70,9 +71,9 @@ $table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true); echo ''; if (is_metaconsole()) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } html_print_table($table); diff --git a/pandora_console/godmode/groups/modu_group_list.php b/pandora_console/godmode/groups/modu_group_list.php index 84dc35ada8..ea74c92cf5 100644 --- a/pandora_console/godmode/groups/modu_group_list.php +++ b/pandora_console/godmode/groups/modu_group_list.php @@ -262,18 +262,18 @@ if (empty($groups) === false) { } $table->data = []; - + $offset_delete = ($offset >= $total_groups - 1) ? ($offset - $config['block_size']) : $offset; foreach ($groups as $id_group) { $data = []; $data[0] = $id_group['id_mg']; if ($is_management_allowed === true) { - $data[1] = ''.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).''; + $data[1] = ''.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).''; if (is_metaconsole() === true) { - $data[2] = ''.html_print_image('images/cross.png', true, ['border' => '0']).''; + $data[2] = ''.html_print_image('images/cross.png', true, ['border' => '0']).''; } else { $table->cellclass[][2] = 'action_buttons'; - $data[2] = ''.html_print_image('images/cross.png', true, ['border' => '0']).''; + $data[2] = ''.html_print_image('images/cross.png', true, ['border' => '0']).''; } } else { $data[1] = ''; From 53ca82277949056c7f3c64001f4ac9d7e2317dfe Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 22 Feb 2023 01:02:03 +0100 Subject: [PATCH 58/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5a537cea8d..c34db5f894 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230221 +Version: 7.0NG.769-230222 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 3bdb964eb0..72b549f170 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.769-230221" +pandora_version="7.0NG.769-230222" 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 cd0fdd0989..c82ed15205 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230221'; +use constant AGENT_BUILD => '230222'; # 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 1a82c15221..fe2362d995 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.769 -%define release 230221 +%define release 230222 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 4015375532..81c0006686 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.769 -%define release 230221 +%define release 230222 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 6d8458b318..dbba71464e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230221" +PI_BUILD="230222" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index bd75795838..9cd2f1ce9b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230221} +{230222} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f38933f5b9..8ea729b765 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.769 Build 230221") +#define PANDORA_VERSION ("7.0NG.769 Build 230222") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 21f5675492..16401cb766 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230221))" + VALUE "ProductVersion", "(7.0NG.769(Build 230222))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 919f840961..2574c3509a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230221 +Version: 7.0NG.769-230222 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 524fd6c38c..c60d8d2f48 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.769-230221" +pandora_version="7.0NG.769-230222" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index af73bd3842..779168d363 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 = 'PC230221'; +$build_version = 'PC230222'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5976f2c24e..c5e562f2cc 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 e972b323a3..11f52f0cc9 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.769 -%define release 230221 +%define release 230222 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3412365986..e97a126961 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.769 -%define release 230221 +%define release 230222 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index cd73c5e77f..a2864c992f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230221" +PI_BUILD="230222" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b54b653594..cd6b6075aa 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.769 Build 230221"; +my $version = "7.0NG.769 Build 230222"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 37b388fb73..2aa01fdd62 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.769 Build 230221"; +my $version = "7.0NG.769 Build 230222"; # save program name for logging my $progname = basename($0); From 2f1060af56bb340d873b39c011e2b7c5e713ce16 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 22 Feb 2023 09:05:27 +0100 Subject: [PATCH 59/87] #10493 fixed pagination in collection --- .../modules/manage_network_components.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index bdec795443..8a27800ec2 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -597,9 +597,10 @@ if ((bool) $id !== false || $new_component $search_id_group = (int) get_parameter('search_id_group'); $search_string = (string) get_parameter('search_string'); +$offset = (int) get_parameter('offset'); $url = ui_get_url_refresh( [ - 'offset' => false, + 'offset' => $offset, 'search_string' => $search_string, 'search_id_group' => $search_id_group, 'id' => $id, @@ -607,7 +608,7 @@ $url = ui_get_url_refresh( true, false ); - +$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components'; $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; @@ -712,8 +713,9 @@ $total_components = network_components_get_network_components( 'COUNT(*) AS total' ); $total_components = $total_components[0]['total']; -ui_pagination($total_components, $url); -$filter['offset'] = (int) get_parameter('offset'); +$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset; +ui_pagination($total_components, $name_url); +$filter['offset'] = $offset; $filter['limit'] = (int) $config['block_size']; $components = network_components_get_network_components( false, @@ -791,7 +793,7 @@ foreach ($components as $component) { true ); - $data[0] = ''; + $data[0] = ''; $data[0] .= io_safe_output($component['name']); $data[0] .= ''; } else { @@ -855,7 +857,7 @@ foreach ($components as $component) { if ($is_management_allowed === true) { $table->cellclass[][6] = 'action_buttons'; - $data[6] = ''.html_print_image( + $data[6] = ''.html_print_image( 'images/copy.png', true, [ @@ -864,7 +866,7 @@ foreach ($components as $component) { 'class' => 'invert_filter', ] ).''; - $data[6] .= ''.html_print_image( + $data[6] .= ''.html_print_image( 'images/cross.png', true, [ @@ -887,7 +889,7 @@ if (isset($data) === true) { html_print_table($table); ui_pagination( $total_components, - $url, + $name_url, 0, 0, false, From 2b7b49db2072c43a4682e2b1ed714ed8a7822a55 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 22 Feb 2023 09:29:55 +0100 Subject: [PATCH 60/87] #10493 fixed pagination in tags --- pandora_console/godmode/tag/tag.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/tag/tag.php b/pandora_console/godmode/tag/tag.php index b808edde9b..6474abd437 100644 --- a/pandora_console/godmode/tag/tag.php +++ b/pandora_console/godmode/tag/tag.php @@ -207,14 +207,14 @@ if (empty($tag_name) === false) { // If the user has filtered the view. $filter_performed = !empty($filter); - -$filter['offset'] = (int) get_parameter('offset'); +$offset = (int) get_parameter('offset'); +$filter['offset'] = $offset; $filter['limit'] = (int) $config['block_size']; // Statements for pagination. -$url = ui_get_url_refresh(); +$url = 'index.php?sec=gusuarios&sec2=godmode/tag/tag'; $total_tags = tags_get_tag_count($filter); - +$offset_delete = ($offset >= ($total_tags - 1)) ? ($offset - $config['block_size']) : $offset; $result = tags_search_tag(false, $filter); // Filter form. @@ -392,7 +392,7 @@ if (empty($result) === false) { ] ); $data[6] .= ''; - $data[6] .= ''.html_print_image( + $data[6] .= ''.html_print_image( 'images/cross.png', true, [ From 2a9494b48d15082942403030ec19e6938ff56ab8 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 22 Feb 2023 10:10:59 +0100 Subject: [PATCH 61/87] fix conflicts --- pandora_console/extras/mr/62.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pandora_console/extras/mr/62.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..794d0a4c94 --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,18 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tagent_filter` ( + `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_name` VARCHAR(600) NOT NULL, + `id_group_filter` INT NOT NULL DEFAULT 0, + `group_id` INT NOT NULL DEFAULT 0, + `recursion` TEXT, + `status` INT NOT NULL DEFAULT -1, + `search` TEXT, + `id_os` INT NOT NULL DEFAULT 0, + `policies` TEXT, + `search_custom` TEXT, + `ag_custom_fields` TEXT, + PRIMARY KEY (`id_filter`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +COMMIT; From df86a428b7b9bcd45ff78f4f6a1e2266ee987fbd Mon Sep 17 00:00:00 2001 From: rafael Date: Wed, 22 Feb 2023 10:38:14 +0100 Subject: [PATCH 62/87] 10435 change gotty to be downloaded from firefly --- extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh | 1 + extras/deploy-scripts/pandora_deploy_community.sh | 2 +- extras/deploy-scripts/pandora_deploy_community_el8.sh | 4 ++-- extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh index dba6aa2773..45a99783ab 100644 --- a/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh +++ b/extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh @@ -4,6 +4,7 @@ ############################################################################################################## ## Tested versions ## # Ubuntu 22.04.1 +# Ubuntu 22.04.2 #avoid promps export DEBIAN_FRONTEND=noninteractive diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 78f1ef0e41..9386d55647 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -431,7 +431,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" # Copy gotty utility -execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' +execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index fe00f81571..cc14ad1ffa 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -5,7 +5,7 @@ ## Tested versions ## # Centos 8.4, 8.5 # Rocky 8.4, 8.5, 8.6, 8.7 -# Almalinuz 8.4, 8.5 +# Almalinux 8.4, 8.5 # RedHat 8.5 #Constants @@ -530,7 +530,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages" # Copy gotty utility -execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' +execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 8bd8bcfaff..1446abfab3 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -4,6 +4,7 @@ ############################################################################################################## ## Tested versions ## # Ubuntu 22.04.1 +# Ubuntu 22.04.2 #avoid promps export DEBIAN_FRONTEND=noninteractive @@ -496,7 +497,7 @@ check_cmd_status "Error installing PandoraFMS Agent" # Copy gotty utility cd $WORKDIR &>> "$LOGFILE" -execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' +execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' From 3d5458ae4623d332d7cb38cd4ec9650e31fcfd56 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 22 Feb 2023 11:36:09 +0100 Subject: [PATCH 63/87] #10302 fixed ack date --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index c7c8be45ce..251d95200d 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -521,7 +521,7 @@ if (is_ajax() === true) { $tmp->agent_name = io_safe_output($tmp->agent_name); - $tmp->ack_utimestamp_raw = strtotime($tmp->ack_utimestamp); + $tmp->ack_utimestamp_raw = $tmp->ack_utimestamp; $tmp->ack_utimestamp = ui_print_timestamp( (empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp, From 1babcb408d796103ec38478701cc8994581204f1 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 23 Feb 2023 01:01:56 +0100 Subject: [PATCH 64/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c34db5f894..6b591599d5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230222 +Version: 7.0NG.769-230223 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 72b549f170..d306e073aa 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.769-230222" +pandora_version="7.0NG.769-230223" 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 c82ed15205..26beae4e4e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230222'; +use constant AGENT_BUILD => '230223'; # 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 fe2362d995..7e1615718b 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.769 -%define release 230222 +%define release 230223 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 81c0006686..a4b5de26aa 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.769 -%define release 230222 +%define release 230223 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 dbba71464e..27dffd49fb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230222" +PI_BUILD="230223" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9cd2f1ce9b..f56388f223 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230222} +{230223} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8ea729b765..343b2d5ad4 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.769 Build 230222") +#define PANDORA_VERSION ("7.0NG.769 Build 230223") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 16401cb766..1d15b31559 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230222))" + VALUE "ProductVersion", "(7.0NG.769(Build 230223))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2574c3509a..23f0c3d13b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230222 +Version: 7.0NG.769-230223 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 c60d8d2f48..e758b98398 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.769-230222" +pandora_version="7.0NG.769-230223" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 779168d363..d1edec1366 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 = 'PC230222'; +$build_version = 'PC230223'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c5e562f2cc..dc3c4615f5 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 11f52f0cc9..999aef37e9 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.769 -%define release 230222 +%define release 230223 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e97a126961..e8777152b3 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.769 -%define release 230222 +%define release 230223 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a2864c992f..85089f0af6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230222" +PI_BUILD="230223" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cd6b6075aa..3d70cb6e5f 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.769 Build 230222"; +my $version = "7.0NG.769 Build 230223"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2aa01fdd62..ce47d29a9f 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.769 Build 230222"; +my $version = "7.0NG.769 Build 230223"; # save program name for logging my $progname = basename($0); From dfa63378ffab0db2fa4991895df3ac1d3f0228ef Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 23 Feb 2023 11:19:17 +0100 Subject: [PATCH 65/87] Unified event timestamp and utimestamp --- pandora_console/include/functions_events.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ca35739891..5f2e66bcae 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2412,14 +2412,17 @@ function events_create_event( $source = get_product_name(); } + // Get Timestamp. + $timestamp = time(); + $values = [ 'id_agente' => $id_agent, 'id_usuario' => $id_user, 'id_grupo' => $id_group, 'estado' => $status, - 'timestamp' => date('Y-m-d H:i:s'), + 'timestamp' => date('Y-m-d H:i:s', $timestamp), 'evento' => $event, - 'utimestamp' => time(), + 'utimestamp' => $timestamp, 'event_type' => $event_type, 'id_agentmodule' => $id_agent_module, 'id_alert_am' => $id_aam, From d1a3795acb1ae5d1072c6792b6935f09ada42db7 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 23 Feb 2023 12:58:33 +0100 Subject: [PATCH 66/87] Added new indexes to mr and pandoradb --- pandora_console/extras/mr/62.sql | 7 +++++++ pandora_console/pandoradb.sql | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 pandora_console/extras/mr/62.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..b5358f6254 --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,7 @@ +-- Active: 1653046769261@@172.16.0.2@3306@pandora +START TRANSACTION; + +CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); +CREATE INDEX idx_disabled ON talert_template_modules (disabled); + +COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e43aaa7646..530a0049ac 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -557,7 +557,8 @@ CREATE TABLE IF NOT EXISTS `talert_template_modules` ( FOREIGN KEY (`id_alert_template`) REFERENCES talert_templates(`id`) ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE (`id_agent_module`, `id_alert_template`, `id_policy_alerts`), - INDEX force_execution (`force_execution`) + INDEX force_execution (`force_execution`), + INDEX idx_disabled (disabled) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- ----------------------------------------------------- @@ -719,7 +720,8 @@ CREATE TABLE IF NOT EXISTS `tevento` ( PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), - KEY `idx_utimestamp` USING BTREE (`utimestamp`) + KEY `idx_utimestamp` USING BTREE (`utimestamp`), + INDEX `agente_modulo_estado`(`estado`, `id_agentmodule`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- Criticity: 0 - Maintance (grey) -- Criticity: 1 - Informational (blue) From 25bfc490555f38de1cdada1d66d46d592d638056 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 23 Feb 2023 18:04:04 +0100 Subject: [PATCH 67/87] minor fix --- .../godmode/reporting/reporting_builder.item_editor.php | 2 +- 1 file changed, 1 insertion(+), 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 8c66b583ee..c6650d08fe 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -281,7 +281,7 @@ switch ($action) { $server_name = $item['server_name']; // Metaconsole db connection. - if ($meta && empty($server_name) === false) { + if ($meta && empty($server_name) === false && $server_name !== 'all') { $connection = metaconsole_get_connection($server_name); $server_id = $connection['id']; if (metaconsole_load_external_db($connection) != NOERR) { From 4374e78ad71ebb10f29513be0cf131d9661c88d3 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 23 Feb 2023 18:09:14 +0100 Subject: [PATCH 68/87] Removed Win32 service from pandora_server --- pandora_server/bin/pandora_server | 143 +----------------------- pandora_server/lib/PandoraFMS/Config.pm | 4 - 2 files changed, 1 insertion(+), 146 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 957d2d8f42..c6b1fc15bb 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -42,9 +42,6 @@ use PandoraFMS::PredictionServer; use PandoraFMS::WebServer; use PandoraFMS::InventoryServer; -# Constants for Win32 services. -use constant WIN32_SERVICE_STOPPED => 0x01; -use constant WIN32_SERVICE_RUNNING => 0x04; # Global vars my %Config :shared; @@ -255,7 +252,6 @@ sub pandora_crash () { print_message (\%Config, " Error description:\n", 0); print_message (\%Config, $full_error, 0); - callback_stop() if ($^O eq 'MSWin32' && defined($Config{'win32_service'})); } ######################################################################################## @@ -510,135 +506,6 @@ sub pandora_server_tasks ($) { db_disconnect($dbh); } -################################################################################ -## Install the Windows service. -################################################################################ -sub win32_install_service() { - - # Load Win32::Daemon. - eval "use Win32::Daemon"; - die($@) if ($@); - - # Configure and install the service. - my $service_path = $0; - my $service_params = "-S run \"" . $Config{'pandora_path'} ."\""; - my %service_hash = ( - machine => '', - name => 'PANDORAFMSSRV', - display => 'Pandora FMS Server', - path => $service_path, - user => '', - pwd => '', - description => 'Pandora FMS Server http://pandorafms.com/', - parameters => $service_params - ); - - if (Win32::Daemon::CreateService(\%service_hash)) { - print "Successfully added.\n"; - exit 0; - } else { - print "Failed to add service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n"; - exit 1; - } -} - -################################################################################ -## Install the Windows service. -################################################################################ -sub win32_uninstall_service() { - - # Load Win32::Daemon. - eval "use Win32::Daemon"; - die($@) if ($@); - - # Uninstall the service. - if (Win32::Daemon::DeleteService('', 'PANDORAFMSSRV')) { - print "Successfully deleted.\n"; - exit 0; - } else { - print "Failed to delete service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n"; - exit 1; - } -} - -################################################################################ -## Windows service callback function for the running event. -################################################################################ -sub callback_running { - if (Win32::Daemon::State() == WIN32_SERVICE_RUNNING) { - } -} - -################################################################################ -## Windows service callback function for the start event. -################################################################################ -sub callback_start { - no strict; - - # Accept_connections (); - my $thr = threads->create(\&main); - if (!defined($thr)) { - Win32::Daemon::State(WIN32_SERVICE_STOPPED); - Win32::Daemon::StopService(); - return; - } - $thr->detach(); - - Win32::Daemon::State(WIN32_SERVICE_RUNNING); -} - -################################################################################ -## Windows service callback function for the stop event. -################################################################################ -sub callback_stop { - - $RUN = 0; - Win32::Daemon::State(WIN32_SERVICE_STOPPED); - Win32::Daemon::StopService(); -} - -################################################################################ -# Run as a Windows service. -################################################################################ -sub win32_service_run() { - - # Load Win32::Daemon. - eval "use Win32::Daemon"; - die($@) if ($@); - - # Run the Pandora FMS Server as a Windows service. - Win32::Daemon::RegisterCallbacks({ - start => \&callback_start, - running => \&callback_running, - stop => \&callback_stop, - }); - Win32::Daemon::StartService(); -} - -################################################################################ -## Parse command line options. -################################################################################ -sub parse_service_options ($) { - my $config = shift; - - # Sanity checks. - return unless defined($config->{'win32_service'}); - die ("[ERROR] Windows services are only available on Win32.\n\n") if ($^O ne 'MSWin32'); - - # Win32 service management. - eval "use Win32::Daemon"; - die($@) if ($@); - - if ($config->{'win32_service'} eq 'install') { - win32_install_service(); - } elsif ($config->{'win32_service'} eq 'uninstall') { - win32_uninstall_service(); - } elsif ($config->{'win32_service'} eq 'run') { - } else { - die("[ERROR] Unknown action: " . $config->{'win32_service'}); - } -} - ################################################################ ################################################################ ## Main. @@ -967,17 +834,9 @@ $SIG{'ALRM'} = 'IGNORE'; pandora_init(\%Config, pandora_get_initial_product_name() . ' Server'); pandora_load_config (\%Config); -# Parse command line options. -parse_service_options(\%Config); # Run as a regular process. -if (!defined($Config{'win32_service'})) { - main(); -} -# Run as a Windows service. -else { - win32_service_run(); -} +main(); ################################################################################ # Kill any scripts started by the Pandora FMS Server that are still running. diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 30a23bc725..a06b9bc4a0 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -64,7 +64,6 @@ sub help_screen { print " -d : Debug mode activated. Writes extensive information in the logfile \n"; print " -D : Daemon mode (runs in background)\n"; print " -P : Store PID to file.\n"; - print " -S : Manage the win32 service.\n"; print " -h : This screen. Shows a little help screen \n"; print " \n"; exit; @@ -111,9 +110,6 @@ sub pandora_init { elsif ($parametro =~ m/-D\z/) { $pa_config->{"daemon"}=1; } - elsif ($parametro =~ m/^-S\z/i) { - $pa_config->{'win32_service'}= clean_blank($ARGV[$ax+1]); - } else { ($pa_config->{"pandora_path"} = $parametro); } From 4fdd5296a03b11d93ab192aafbb7546022a9ec44 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 24 Feb 2023 01:02:05 +0100 Subject: [PATCH 69/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6b591599d5..c44f80ca60 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230223 +Version: 7.0NG.769-230224 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 d306e073aa..1bc515c521 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.769-230223" +pandora_version="7.0NG.769-230224" 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 26beae4e4e..b66ab84a41 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230223'; +use constant AGENT_BUILD => '230224'; # 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 7e1615718b..ff48136e54 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.769 -%define release 230223 +%define release 230224 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a4b5de26aa..48ea58dc7d 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.769 -%define release 230223 +%define release 230224 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 27dffd49fb..993a2c544f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230223" +PI_BUILD="230224" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f56388f223..c2c6089094 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230223} +{230224} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 343b2d5ad4..e5ba16b0dc 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.769 Build 230223") +#define PANDORA_VERSION ("7.0NG.769 Build 230224") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1d15b31559..3fdf2d15ef 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230223))" + VALUE "ProductVersion", "(7.0NG.769(Build 230224))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 23f0c3d13b..34ce9a67a8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230223 +Version: 7.0NG.769-230224 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 e758b98398..53cc57af0d 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.769-230223" +pandora_version="7.0NG.769-230224" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d1edec1366..7b0315f8d4 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 = 'PC230223'; +$build_version = 'PC230224'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index dc3c4615f5..900f45546b 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 999aef37e9..b67c5b708a 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.769 -%define release 230223 +%define release 230224 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e8777152b3..181fc6f43e 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.769 -%define release 230223 +%define release 230224 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 85089f0af6..be003d47f5 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230223" +PI_BUILD="230224" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3d70cb6e5f..4f9e1c8925 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.769 Build 230223"; +my $version = "7.0NG.769 Build 230224"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ce47d29a9f..663ddd3ec7 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.769 Build 230223"; +my $version = "7.0NG.769 Build 230224"; # save program name for logging my $progname = basename($0); From c7e53f5a1a50f704436c0b206981173fdda2167c Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 24 Feb 2023 12:07:37 +0100 Subject: [PATCH 70/87] #10259 resolve conflics --- .../include/class/ConsoleSupervisor.php | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index ce6d2df301..837be70906 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -262,7 +262,17 @@ class ConsoleSupervisor * Check number of agents is equals and more than 200. * NOTIF.ACCESSSTASTICS.PERFORMANCE */ + $this->checkAccessStatisticsPerformance(); + + /* + * Checkc agent missing libraries. + * NOTIF.AGENT.LIBRARY + */ + + if ((bool) enterprise_installed() === true) { + $this->checkLibaryError(); + } } @@ -528,7 +538,18 @@ class ConsoleSupervisor * Check number of agents is equals and more than 200. * NOTIF.ACCESSSTASTICS.PERFORMANCE */ + $this->checkAccessStatisticsPerformance(); + + /* + * Checkc agent missing libraries. + * NOTIF.AGENT.LIBRARY + */ + + if ((bool) enterprise_installed() === true) { + $this->checkLibaryError(); + } + } @@ -2418,7 +2439,7 @@ class ConsoleSupervisor if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { $message_conf_cron .= __('Discovery relies on an appropriate cron setup.'); $message_conf_cron .= '. '.__('Please, add the following line to your crontab file:'); - $message_conf_cron .= '
* * * * * <user> wget -q -O - --no-check-certificate ';
+                $message_conf_cron .= '
* * * * * <user> wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
                 $message_conf_cron .= str_replace(
                     ENTERPRISE_DIR.'/meta/',
                     '',
@@ -2845,4 +2866,30 @@ class ConsoleSupervisor
     }
 
 
+    /**
+     * Chechs if an agent has a dependency eror on omnishell
+     *
+     * @return void
+     */
+    public function checkLibaryError()
+    {
+        $sql = 'SELECT COUNT(errorlevel) from tremote_command_target WHERE errorlevel = 2';
+
+        $error_dependecies = db_get_sql($sql);
+        if ($error_dependecies > 0) {
+            $this->notify(
+                [
+                    'type'    => 'NOTIF.AGENT.LIBRARY',
+                    'title'   => __('Agent dependency error'),
+                    'message' => __(
+                        'There are omnishell agents with dependency errors',
+                    ),
+
+                    'url'     => '__url__/index.php?sec=gextensions&sec2=enterprise/tools/omnishell',
+                ]
+            );
+        }
+    }
+
+
 }

From 9294253675caac425403a378cbfa96471b48dae8 Mon Sep 17 00:00:00 2001
From: Calvo 
Date: Fri, 24 Feb 2023 15:12:18 +0100
Subject: [PATCH 71/87] Fix regex to extract version and oum

---
 pandora_server/lib/PandoraFMS/PluginTools.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index dbb60fa2c8..d937120d39 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -33,7 +33,7 @@ use base 'Exporter';
 our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
-my $pandora_version = "7.0NG.769";
+my $pandora_version = "7.0NG.769+ALT";
 my $pandora_build = "230224";
 our $VERSION = $pandora_version." ".$pandora_build;
 
@@ -118,12 +118,12 @@ sub check_lib_version {
 
 	$plugin_version = "0NG.0" if empty($plugin_version);
 
-	my ($main,$oum) = split /NG./, $plugin_version;
+	my ($main,$oum) = $plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/;
 
 	$main = 0 if empty($main) || !looks_like_number($main);
 	$oum  = 0 if empty($oum)  || !looks_like_number($oum);
 
-	my ($libmain,$liboum) = split /NG./, $pandora_version;
+	my ($libmain,$liboum) =  $pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/;
 
 	if (($liboum < $oum)
 	||  ($libmain != $main)) {

From 96a5dd99919d9b78375e53b55791c0e6866738a6 Mon Sep 17 00:00:00 2001
From: Calvo 
Date: Fri, 24 Feb 2023 15:15:06 +0100
Subject: [PATCH 72/87] Fix minor bug

---
 pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index d937120d39..930174b98c 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -33,7 +33,7 @@ use base 'Exporter';
 our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
-my $pandora_version = "7.0NG.769+ALT";
+my $pandora_version = "7.0NG.769";
 my $pandora_build = "230224";
 our $VERSION = $pandora_version." ".$pandora_build;
 

From e38504d3df49111b826e6216da09dd6308e6137f Mon Sep 17 00:00:00 2001
From: artica 
Date: Sat, 25 Feb 2023 01:00:27 +0100
Subject: [PATCH 73/87] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index c44f80ca60..0827a1e792 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.769-230224
+Version: 7.0NG.769-230225
 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 1bc515c521..ccb0797e87 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.769-230224"
+pandora_version="7.0NG.769-230225"
 
 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 b66ab84a41..3959d4686c 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -1023,7 +1023,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.769';
-use constant AGENT_BUILD => '230224';
+use constant AGENT_BUILD => '230225';
 
 # 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 ff48136e54..1bc85f6d3d 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.769
-%define release     230224
+%define release     230225
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 48ea58dc7d..56c2e0d15b 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.769
-%define release     230224
+%define release     230225
 
 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 993a2c544f..165f6a1660 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.769"
-PI_BUILD="230224"
+PI_BUILD="230225"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index c2c6089094..2402f9d542 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{230224}
+{230225}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index e5ba16b0dc..9fbca11738 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.769 Build 230224")
+#define PANDORA_VERSION ("7.0NG.769 Build 230225")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 3fdf2d15ef..3d533779c3 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.769(Build 230224))"
+      VALUE "ProductVersion", "(7.0NG.769(Build 230225))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 34ce9a67a8..84ff16619b 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.769-230224
+Version: 7.0NG.769-230225
 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 53cc57af0d..e5a5e39d09 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.769-230224"
+pandora_version="7.0NG.769-230225"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 7b0315f8d4..cdde0999cd 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 = 'PC230224';
+$build_version = 'PC230225';
 $pandora_version = 'v7.0NG.769';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 900f45546b..28071d3304 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 b67c5b708a..159b5a44e9 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.769 -%define release 230224 +%define release 230225 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 181fc6f43e..a2fd42db28 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.769 -%define release 230224 +%define release 230225 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index be003d47f5..52cc7387dc 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230224" +PI_BUILD="230225" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4f9e1c8925..f3ae079d74 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.769 Build 230224"; +my $version = "7.0NG.769 Build 230225"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 663ddd3ec7..ff274ed989 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.769 Build 230224"; +my $version = "7.0NG.769 Build 230225"; # save program name for logging my $progname = basename($0); From ce5b0abda6b9fb7f79e3a9ee27dc2a46b6590792 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 26 Feb 2023 01:00:21 +0100 Subject: [PATCH 74/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0827a1e792..6f9fc950c9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230225 +Version: 7.0NG.769-230226 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 ccb0797e87..0d680ebb68 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.769-230225" +pandora_version="7.0NG.769-230226" 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 3959d4686c..159fdff686 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230225'; +use constant AGENT_BUILD => '230226'; # 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 1bc85f6d3d..b13613d147 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.769 -%define release 230225 +%define release 230226 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 56c2e0d15b..e96cc170ab 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.769 -%define release 230225 +%define release 230226 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 165f6a1660..91c5816ca4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230225" +PI_BUILD="230226" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2402f9d542..357d8d7df2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230225} +{230226} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9fbca11738..8f4e4cdb68 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.769 Build 230225") +#define PANDORA_VERSION ("7.0NG.769 Build 230226") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3d533779c3..151eab3d2e 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230225))" + VALUE "ProductVersion", "(7.0NG.769(Build 230226))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 84ff16619b..aa1ad532ad 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230225 +Version: 7.0NG.769-230226 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 e5a5e39d09..d3a7fe1466 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.769-230225" +pandora_version="7.0NG.769-230226" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index cdde0999cd..74a137f797 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 = 'PC230225'; +$build_version = 'PC230226'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 28071d3304..db5a4e8f2d 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 159b5a44e9..a1b1666030 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.769 -%define release 230225 +%define release 230226 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a2fd42db28..0540879424 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.769 -%define release 230225 +%define release 230226 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 52cc7387dc..cc30e9c5b0 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230225" +PI_BUILD="230226" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f3ae079d74..cab43f356e 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.769 Build 230225"; +my $version = "7.0NG.769 Build 230226"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ff274ed989..6a4271befe 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.769 Build 230225"; +my $version = "7.0NG.769 Build 230226"; # save program name for logging my $progname = basename($0); From 491958a105d1a9222234795ffbb79f2b6c395a05 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 27 Feb 2023 01:00:21 +0100 Subject: [PATCH 75/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6f9fc950c9..f59bb0ff18 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230226 +Version: 7.0NG.769-230227 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 0d680ebb68..a9ee5343bd 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.769-230226" +pandora_version="7.0NG.769-230227" 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 159fdff686..bddaac64d4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230226'; +use constant AGENT_BUILD => '230227'; # 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 b13613d147..005d3a8bc3 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.769 -%define release 230226 +%define release 230227 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index e96cc170ab..07b3d30bdf 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.769 -%define release 230226 +%define release 230227 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 91c5816ca4..f9ef95d7ab 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230226" +PI_BUILD="230227" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 357d8d7df2..c4f68463d7 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230226} +{230227} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8f4e4cdb68..c5bac1e0ac 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.769 Build 230226") +#define PANDORA_VERSION ("7.0NG.769 Build 230227") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 151eab3d2e..ad8addeb38 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230226))" + VALUE "ProductVersion", "(7.0NG.769(Build 230227))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index aa1ad532ad..2a40cdd9c1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230226 +Version: 7.0NG.769-230227 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 d3a7fe1466..8a957476bd 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.769-230226" +pandora_version="7.0NG.769-230227" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 74a137f797..e7273c3287 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 = 'PC230226'; +$build_version = 'PC230227'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index db5a4e8f2d..d7451230e0 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 a1b1666030..f93bb611ad 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.769 -%define release 230226 +%define release 230227 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0540879424..46c861f6bd 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.769 -%define release 230226 +%define release 230227 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index cc30e9c5b0..5420293644 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230226" +PI_BUILD="230227" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cab43f356e..05f8f8e7d5 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.769 Build 230226"; +my $version = "7.0NG.769 Build 230227"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6a4271befe..0c9c3aa929 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.769 Build 230226"; +my $version = "7.0NG.769 Build 230227"; # save program name for logging my $progname = basename($0); From fcd9a93f68660168d89a070e88d11682853b28f0 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 27 Feb 2023 10:53:59 +0100 Subject: [PATCH 76/87] Fix code style --- pandora_server/lib/PandoraFMS/PluginTools.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 930174b98c..0cb752b956 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -118,12 +118,12 @@ sub check_lib_version { $plugin_version = "0NG.0" if empty($plugin_version); - my ($main,$oum) = $plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/; + my ($main,$oum) = ($plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/); $main = 0 if empty($main) || !looks_like_number($main); $oum = 0 if empty($oum) || !looks_like_number($oum); - my ($libmain,$liboum) = $pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/; + my ($libmain,$liboum) = ($pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/); if (($liboum < $oum) || ($libmain != $main)) { From 5d4c61f8c4c28d04de67d1db95a9672adfbe41b9 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 27 Feb 2023 13:26:32 +0100 Subject: [PATCH 77/87] #10253 added notify enforcement in metaconsole --- .../include/class/ConsoleSupervisor.php | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index e426858e8a..4084d53cd2 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -583,18 +583,33 @@ class ConsoleSupervisor } if ($limit_value !== '' && $message !== '') { - $this->notify( - [ - 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, - 'title' => __('Incorrect config value'), - 'message' => __( - $message, - $names[$variable], - $limit_value - ), - 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup', - ] - ); + if (is_metaconsole() === true) { + $this->notify( + [ + 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, + 'title' => __('Incorrect config value'), + 'message' => __( + $message, + $names[$variable], + $limit_value + ), + 'url' => '__url__index.php?sec=advanced&sec2=advanced/metasetup', + ] + ); + } else { + $this->notify( + [ + 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, + 'title' => __('Incorrect config value'), + 'message' => __( + $message, + $names[$variable], + $limit_value + ), + 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup', + ] + ); + } } } From 3259795a0bf70969e4b476398e8dd6375850d629 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 27 Feb 2023 16:15:34 +0100 Subject: [PATCH 78/87] #10559 control delete task list if not exist id --- .../wizards/DiscoveryTaskList.class.php | 59 +++++++++++-------- 1 file changed, 36 insertions(+), 23 deletions(-) diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index a1fa53ced3..44f8ebf868 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -955,29 +955,42 @@ class DiscoveryTaskList extends HTML ) ) { if ($ipam === true) { - $data[9] .= ''.html_print_image( - 'images/config.png', - true, - [ - 'title' => __('Edit task'), - 'class' => 'invert_filter', - ] - ).''; - $data[9] .= ''.html_print_image( - 'images/cross.png', - true, - [ - 'title' => __('Delete task'), - 'class' => 'invert_filter', - ] - ).''; + if (empty($tipam_task_id) === false) { + $data[9] .= ''.html_print_image( + 'images/config.png', + true, + [ + 'title' => __('Edit task'), + 'class' => 'invert_filter', + ] + ).''; + $data[9] .= ''.html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete task'), + 'class' => 'invert_filter', + ] + ).''; + } else { + $data[9] .= ''.html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete task'), + 'class' => 'invert_filter', + ] + ).''; + } } else { // Check if is a H&D, Cloud or Application or IPAM. $data[9] .= ' /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index bddaac64d4..a994aabc8b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230227'; +use constant AGENT_BUILD => '230228'; # 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 005d3a8bc3..1e35d4443c 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.769 -%define release 230227 +%define release 230228 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 07b3d30bdf..3519ff8837 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.769 -%define release 230227 +%define release 230228 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 f9ef95d7ab..ec3075858c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230227" +PI_BUILD="230228" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c4f68463d7..2f2c4f1324 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230227} +{230228} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index c5bac1e0ac..9d41d77811 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.769 Build 230227") +#define PANDORA_VERSION ("7.0NG.769 Build 230228") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ad8addeb38..ab42fb366e 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230227))" + VALUE "ProductVersion", "(7.0NG.769(Build 230228))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2a40cdd9c1..12ed651bf5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230227 +Version: 7.0NG.769-230228 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 8a957476bd..32b28e5e53 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.769-230227" +pandora_version="7.0NG.769-230228" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e7273c3287..a853e7eef5 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 = 'PC230227'; +$build_version = 'PC230228'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d7451230e0..2a7bde9bb0 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 f93bb611ad..8fbf6b3a47 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.769 -%define release 230227 +%define release 230228 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 46c861f6bd..2e8dbd979d 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.769 -%define release 230227 +%define release 230228 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5420293644..b4b9a39a65 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230227" +PI_BUILD="230228" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 05f8f8e7d5..95573a89de 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.769 Build 230227"; +my $version = "7.0NG.769 Build 230228"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0c9c3aa929..ea984d2726 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.769 Build 230227"; +my $version = "7.0NG.769 Build 230228"; # save program name for logging my $progname = basename($0); From a1f172e713a86c9d074c0bbe80122ed70ee08528 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 28 Feb 2023 17:06:31 +0100 Subject: [PATCH 80/87] several fixes --- pandora_console/include/ajax/agent.php | 195 +++++++++++++++--- pandora_console/include/ajax/module.php | 123 +++++++++-- .../operation/agentes/estado_agente.php | 10 +- .../operation/agentes/status_monitor.php | 6 +- 4 files changed, 289 insertions(+), 45 deletions(-) diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 5ba3f90799..f0884dea7f 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -38,6 +38,7 @@ $save_filter_modal = get_parameter('save_filter_modal', 0); $get_agent_filters = get_parameter('get_agent_filters', 0); $save_agent_filter = get_parameter('save_agent_filter', 0); $update_agent_filter = get_parameter('update_agent_filter', 0); +$delete_agent_filter = get_parameter('delete_agent_filter', 0); if (https_is_running()) { header('Content-type: application/json'); @@ -365,6 +366,7 @@ if ($save_agent_filter) { $values['policies'] = json_encode(get_parameter('policies')); $values['search_custom'] = get_parameter('search_custom'); $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + $values['id_group_filter'] = get_parameter('id_group_filter'); $exists = (bool) db_get_value_filter( 'id_filter', @@ -411,8 +413,40 @@ if ($update_agent_filter) { } } +if ($delete_agent_filter) { + $id = get_parameter('id'); + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'DELETE + FROM tagent_filter + WHERE id_filter = '.$id.' AND id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $agent_filters = db_process_sql($sql); + + if ($agent_filters === false) { + echo 'error'; + } else { + echo 'ok'; + } +} + if ($get_agent_filters) { - $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + $user_groups = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all('AR'), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; $agent_filters = db_get_all_rows_sql($sql); @@ -431,7 +465,7 @@ if ((int) $load_filter_modal === 1) { $user_groups = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); @@ -439,11 +473,11 @@ if ((int) $load_filter_modal === 1) { FROM tagent_filter WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; - $event_filters = db_get_all_rows_sql($sql); + $agent_filters = db_get_all_rows_sql($sql); $filters = []; - foreach ($event_filters as $event_filter) { - $filters[$event_filter['id_filter']] = $event_filter['id_name']; + foreach ($agent_filters as $agent_filter) { + $filters[$agent_filter['id_filter']] = $agent_filter['id_name']; } echo '
'; @@ -560,7 +594,7 @@ if ($save_filter_modal) { '', false, true - ).__('Update filter').''; + ).__('Update/delete filter').''; $table->data[] = $data; $table->rowclass[] = ''; @@ -578,8 +612,8 @@ if ($save_filter_modal) { $user_groups_array = users_get_groups_for_select( $config['id_user'], - 'EW', - users_can_manage_group_all(), + 'AW', + users_can_manage_group_all('AW'), true ); @@ -607,9 +641,19 @@ if ($save_filter_modal) { $data = []; $table->rowid[3] = 'update_filter_row1'; - $data[0] = __('Overwrite filter').$jump; + $data[0] = __('Filter').$jump; + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; - $sql = 'SELECT id_filter, id_name FROM tagent_filter'; $agent_filters = db_get_all_rows_sql($sql); $_filters_update = []; @@ -629,21 +673,30 @@ if ($save_filter_modal) { 0, true ); - $data[1] = html_print_submit_button( - __('Update filter'), - 'update_filter', - false, - 'class="sub upd" onclick="save_update_filter();"', - true - ); $table->data[] = $data; $table->rowclass[] = ''; html_print_table($table); - echo '
'; + echo '

'; echo html_print_submit_button( - __('Save filter'), + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + echo html_print_submit_button( + __('Delete filter'), + 'delete_filter', + false, + 'class="sub delete float-right" onclick="save_delete_filter();"', + true + ); + echo '
'; + echo '

'; + echo html_print_submit_button( + __('Save current filter'), 'save_filter', false, 'class="sub upd float-right" onclick="save_new_filter();"', @@ -662,6 +715,7 @@ function show_save_filter() { $('#save_filter_row1').show(); $('#save_filter_row2').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); // Filter save mode selector $("[name='filter_mode']").click(function() { if ($(this).val() == 'new') { @@ -669,12 +723,14 @@ function show_save_filter() { $('#save_filter_row2').show(); $('#submit-save_filter').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); } else { $('#save_filter_row1').hide(); $('#save_filter_row2').hide(); $('#update_filter_row1').show(); $('#submit-save_filter').hide(); + $('#update_delete_row').show(); } }); $("#save-filter-select").dialog({ @@ -726,7 +782,9 @@ function save_new_filter() { "policies" : $("#policies").val(), "search_custom" : $("#text-search_custom").val(), "ag_custom_fields": JSON.stringify(ag_custom_fields), + "id_group_filter": $("#id_group_filter_dialog").val(), }, + function (data) { $("#info_box").hide(); if (data == 'error') { @@ -759,6 +817,27 @@ function save_new_filter() { }).show(); } + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/agent", + "get_agent_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + $('#filter_id').append($('').html (s).attr("value", i)); + }); + }, + "json" + ); + // Close dialog. $("#save-filter-select").dialog('close'); } @@ -793,10 +872,10 @@ function save_update_filter() { "group_id" : $("#group_id").val(), "recursion" : $("#checkbox-recursion").is(':checked'), "status" : $("#status").val(), - "search" : $("#search").val(), + "search" : $("#text-search").val(), "id_os" : $("#os").val(), "policies" : $("#policies").val(), - "search_custom" : $("#search_custom").val(), + "search_custom" : $("#text-search_custom").val(), "ag_custom_fields": JSON.stringify(ag_custom_fields), }, function (data) { @@ -821,11 +900,13 @@ function save_update_filter() { } }); - // First remove all options of filters select + // First remove all options of filters select. $('#filter_id').find('option').remove().end(); - // Add 'none' option the first - $('#filter_id').append ($('').html ( ).attr ("value", 0)); - // Reload filters select + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. jQuery.post ("", { "page" : "include/ajax/agent", @@ -853,7 +934,69 @@ function save_update_filter() { $('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update); return false; } - + +function save_delete_filter() { + var id_filter_update = $("#overwrite_filter").val(); + + jQuery.post ("", + { + "page" : "include/ajax/agent", + "delete_agent_filter" : 1, + "id" : $("#overwrite_filter").val(), + }, + function (data) { + $(".info_box").hide(); + if (data == 'ok') { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_update_filter") { + return true; + } + else + return false; + }).show(); + } + else { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); + } + }); + + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/agent", + "get_agent_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + if (i == id_filter_update) { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + else { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + }); + }, + "json" + ); + + // Close dialog + $('.ui-dialog-titlebar-close').trigger('click'); + + return false; +} $(document).ready(function() { show_save_filter(); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 3857c5d6b2..ec87996805 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -73,6 +73,7 @@ if (check_login()) { $get_monitor_filters = get_parameter('get_monitor_filters', 0); $save_monitor_filter = get_parameter('save_monitor_filter', 0); $update_monitor_filter = get_parameter('update_monitor_filter', 0); + $delete_monitor_filter = get_parameter('delete_monitor_filter', 0); if ($get_agent_modules_json_by_name === true) { $agent_name = get_parameter('agent_name'); @@ -1740,6 +1741,29 @@ if (check_login()) { } } + if ($delete_monitor_filter) { + $id = get_parameter('id'); + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'DELETE + FROM tmonitor_filter + WHERE id_filter = '.$id.' AND id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $monitor_filters = db_process_sql($sql); + + if ($monitor_filters === false) { + echo 'error'; + } else { + echo 'ok'; + } + } + if ($get_monitor_filters) { $sql = 'SELECT id_filter, id_name FROM tmonitor_filter'; @@ -1760,7 +1784,7 @@ if (check_login()) { $user_groups = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); @@ -1886,7 +1910,7 @@ if (check_login()) { '', false, true - ).__('Update filter').''; + ).__('Update/delete filter').''; $table->data[] = $data; $table->rowclass[] = ''; @@ -1904,7 +1928,7 @@ if (check_login()) { $user_groups_array = users_get_groups_for_select( $config['id_user'], 'AW', - users_can_manage_group_all(), + users_can_manage_group_all('AW'), true ); @@ -1954,21 +1978,30 @@ if (check_login()) { 0, true ); - $data[1] = html_print_submit_button( - __('Update filter'), - 'update_filter', - false, - 'class="sub upd" onclick="save_update_filter();"', - true - ); $table->data[] = $data; $table->rowclass[] = ''; html_print_table($table); - echo '
'; + echo '

'; echo html_print_submit_button( - __('Save filter'), + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + echo html_print_submit_button( + __('Delete filter'), + 'delete_filter', + false, + 'class="sub delete float-right" onclick="save_delete_filter();"', + true + ); + echo '
'; + echo '

'; + echo html_print_submit_button( + __('Save current filter'), 'save_filter', false, 'class="sub upd float-right" onclick="save_new_filter();"', @@ -1986,6 +2019,7 @@ if (check_login()) { $('#save_filter_row1').show(); $('#save_filter_row2').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); // Filter save mode selector $("[name='filter_mode']").click(function() { if ($(this).val() == 'new') { @@ -1993,12 +2027,14 @@ if (check_login()) { $('#save_filter_row2').show(); $('#submit-save_filter').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); } else { $('#save_filter_row1').hide(); $('#save_filter_row2').hide(); $('#update_filter_row1').show(); $('#submit-save_filter').hide(); + $('#update_delete_row').show(); } }); $("#save-filter-select").dialog({ @@ -2189,6 +2225,69 @@ if (check_login()) { $('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update); return false; } + + function save_delete_filter() { + var id_filter_update = $("#overwrite_filter").val(); + + jQuery.post ("", + { + "page" : "include/ajax/module", + "delete_monitor_filter" : 1, + "id" : $("#overwrite_filter").val(), + }, + function (data) { + $(".info_box").hide(); + if (data == 'ok') { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_update_filter") { + return true; + } + else + return false; + }).show(); + } + else { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); + } + }); + + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/module", + "get_monitor_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + if (i == id_filter_update) { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + else { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + }); + }, + "json" + ); + + // Close dialog + $('.ui-dialog-titlebar-close').trigger('click'); + + return false; + } $(document).ready(function() { show_save_filter(); diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 5314c36df7..8e49877037 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -319,11 +319,11 @@ $table->data[0][0] .= '
/dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a994aabc8b..4fa07035d2 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230228'; +use constant AGENT_BUILD => '230301'; # 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 1e35d4443c..f8ab9c7e41 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.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3519ff8837..6a16d883fd 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.769 -%define release 230228 +%define release 230301 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 ec3075858c..46e66a8170 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230228" +PI_BUILD="230301" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2f2c4f1324..79687a6d2e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230228} +{230301} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9d41d77811..8264d0e9c8 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.769 Build 230228") +#define PANDORA_VERSION ("7.0NG.769 Build 230301") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ab42fb366e..ece56bd837 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230228))" + VALUE "ProductVersion", "(7.0NG.769(Build 230301))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 12ed651bf5..c9f3c45a17 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230228 +Version: 7.0NG.769-230301 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 32b28e5e53..90ab3e8133 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.769-230228" +pandora_version="7.0NG.769-230301" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a853e7eef5..e197b66be2 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 = 'PC230228'; +$build_version = 'PC230301'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2a7bde9bb0..e76fce4a52 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 8fbf6b3a47..8b319376d8 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.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 2e8dbd979d..931745b212 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.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b4b9a39a65..f4c905a120 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230228" +PI_BUILD="230301" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 95573a89de..cad9bf5993 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.769 Build 230228"; +my $version = "7.0NG.769 Build 230301"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ea984d2726..5fbf54b2e5 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.769 Build 230228"; +my $version = "7.0NG.769 Build 230301"; # save program name for logging my $progname = basename($0); From 36cfcc3c2f7fa6660d42b178f8d920f1900da833 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Mar 2023 14:19:35 +0100 Subject: [PATCH 82/87] error fix --- pandora_console/operation/agentes/estado_generalagente.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index a0bd1bca8f..dca542b800 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -644,6 +644,7 @@ $last_incident = db_get_row_sql( ); if ($last_incident != false) { + $table_incident = new stdClass(); $table_incident->id = 'agent_incident_main'; $table_incident->width = '100%'; $table_incident->cellspacing = 0; From 296ec44ef40c38bf156d3d6a543165bc3cf7afed Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Mar 2023 16:10:18 +0100 Subject: [PATCH 83/87] minor fix --- pandora_console/operation/agentes/estado_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 8e49877037..c2e797f3fd 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -199,7 +199,7 @@ if ($load_filter_id > 0) { $user_groups_fl = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); From f1bb7b450e3e607b960706d985721ad3b53969a6 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 2 Mar 2023 01:00:46 +0100 Subject: [PATCH 84/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f60763b69b..a8a7940165 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230301 +Version: 7.0NG.769-230302 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 4f52b3aa35..21522e4937 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.769-230301" +pandora_version="7.0NG.769-230302" 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 4fa07035d2..a1e5ea6e0e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230301'; +use constant AGENT_BUILD => '230302'; # 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 f8ab9c7e41..107be42b57 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.769 -%define release 230301 +%define release 230302 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 6a16d883fd..0f5ae307c0 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.769 -%define release 230301 +%define release 230302 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 46e66a8170..6c14bec893 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230301" +PI_BUILD="230302" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 79687a6d2e..0c79064ec1 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230301} +{230302} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8264d0e9c8..13c0a7445d 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.769 Build 230301") +#define PANDORA_VERSION ("7.0NG.769 Build 230302") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ece56bd837..eff0e22339 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230301))" + VALUE "ProductVersion", "(7.0NG.769(Build 230302))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c9f3c45a17..59ea1588fa 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230301 +Version: 7.0NG.769-230302 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 90ab3e8133..aaae992e96 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.769-230301" +pandora_version="7.0NG.769-230302" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e197b66be2..3ba4310159 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 = 'PC230301'; +$build_version = 'PC230302'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e76fce4a52..7938198596 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 8b319376d8..b3438f8d82 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.769 -%define release 230301 +%define release 230302 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 931745b212..3b050ebbea 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.769 -%define release 230301 +%define release 230302 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index f4c905a120..5f1d3b7245 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230301" +PI_BUILD="230302" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cad9bf5993..74cbb27d4c 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.769 Build 230301"; +my $version = "7.0NG.769 Build 230302"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5fbf54b2e5..dc01241c19 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.769 Build 230301"; +my $version = "7.0NG.769 Build 230302"; # save program name for logging my $progname = basename($0); From 2f4543a0234ae05ef17b283270c4c5d4c2596d16 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Mar 2023 08:20:43 +0100 Subject: [PATCH 85/87] #9517 Change MR sql --- pandora_console/extras/mr/62.sql | 2 ++ pandora_console/extras/mr/63.sql | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index b5358f6254..b04dd12c25 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -4,4 +4,6 @@ START TRANSACTION; CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); CREATE INDEX idx_disabled ON talert_template_modules (disabled); +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); + COMMIT; diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql deleted file mode 100644 index 401d4a748c..0000000000 --- a/pandora_console/extras/mr/63.sql +++ /dev/null @@ -1,5 +0,0 @@ -START TRANSACTION; - -INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); - -COMMIT; From 590ddc827c4b5749b4c7d2eccb31d434a1c739a0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Mar 2023 08:29:06 +0100 Subject: [PATCH 86/87] #9819 Change MR and add pandoradb.sql create table teventsound --- pandora_console/extras/mr/62.sql | 7 +++++++ pandora_console/extras/mr/65.sql | 10 ---------- pandora_console/pandoradb.sql | 10 ++++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 pandora_console/extras/mr/65.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index b5358f6254..a265c1a62d 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -1,6 +1,13 @@ -- Active: 1653046769261@@172.16.0.2@3306@pandora START TRANSACTION; +CREATE TABLE `tevent_sound` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` TEXT NULL, + `sound` TEXT NULL, + `active` TINYINT NOT NULL DEFAULT '1', +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); CREATE INDEX idx_disabled ON talert_template_modules (disabled); diff --git a/pandora_console/extras/mr/65.sql b/pandora_console/extras/mr/65.sql deleted file mode 100644 index 7e65e62c2f..0000000000 --- a/pandora_console/extras/mr/65.sql +++ /dev/null @@ -1,10 +0,0 @@ -START TRANSACTION; - -CREATE TABLE `tevent_sound` ( - `id` INT NOT NULL AUTO_INCREMENT, - `name` TEXT NULL, - `sound` TEXT NULL, - `active` TINYINT NOT NULL DEFAULT '1', -PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 530a0049ac..3da24db710 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4179,3 +4179,13 @@ CREATE TABLE IF NOT EXISTS `tmonitor_filter` ( `ag_custom_fields` TEXT, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +-- --------------------------------------------------------------------- +-- Table `tevent_sound` +-- --------------------------------------------------------------------- +CREATE TABLE `tevent_sound` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` TEXT NULL, + `sound` TEXT NULL, + `active` TINYINT NOT NULL DEFAULT '1', +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file From 1f046e94466cf781fd0869b80e12545ef584d227 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 Mar 2023 01:00:24 +0100 Subject: [PATCH 87/87] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a8a7940165..7a6aeff356 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230302 +Version: 7.0NG.769-230303 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 21522e4937..fa61aa49c9 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.769-230302" +pandora_version="7.0NG.769-230303" 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 a1e5ea6e0e..0a12df1c9f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230302'; +use constant AGENT_BUILD => '230303'; # 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 107be42b57..89ea2a0b9f 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.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0f5ae307c0..aed2381793 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.769 -%define release 230302 +%define release 230303 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 6c14bec893..c63a4a6cfc 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230302" +PI_BUILD="230303" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0c79064ec1..2c51bc2a4b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230302} +{230303} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 13c0a7445d..acf6b701e5 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.769 Build 230302") +#define PANDORA_VERSION ("7.0NG.769 Build 230303") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index eff0e22339..c6e79f7d24 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230302))" + VALUE "ProductVersion", "(7.0NG.769(Build 230303))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 59ea1588fa..57d645e9b5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230302 +Version: 7.0NG.769-230303 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 aaae992e96..f701f80ec0 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.769-230302" +pandora_version="7.0NG.769-230303" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3ba4310159..70d3efe878 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 = 'PC230302'; +$build_version = 'PC230303'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7938198596..f89f637f9e 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 b3438f8d82..258f04a16d 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.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3b050ebbea..14deb9c3c3 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.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5f1d3b7245..ea2a1a70ed 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230302" +PI_BUILD="230303" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 74cbb27d4c..6889216e80 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.769 Build 230302"; +my $version = "7.0NG.769 Build 230303"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index dc01241c19..b7374ab423 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.769 Build 230302"; +my $version = "7.0NG.769 Build 230303"; # save program name for logging my $progname = basename($0);