From cc1c138552271abbcf2804f6bce13e46dc19df73 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 4 Dec 2023 11:23:43 +0100 Subject: [PATCH 01/34] #12518 Fixed up custom field type link --- pandora_console/operation/agentes/estado_generalagente.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index dd4effe693..6e6615df51 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -298,8 +298,9 @@ foreach ($fields as $field) { if ($custom_value[0]['is_password_type']) { $data[1] = '••••••••'; } else if ($field['is_link_enabled'] === '1') { - list($link_text, $link_url) = json_decode($custom_value[0]['description'], true); - + $custom_link_type = io_safe_output($custom_value[0]['description']); + $custom_link_type = json_decode($custom_link_type); + list($link_text, $link_url) = $custom_link_type; if (json_last_error() !== JSON_ERROR_NONE) { $link_text = ''; $link_url = ''; @@ -309,7 +310,7 @@ foreach ($fields as $field) { $link_text = $link_url; } - $data[1] = ''.$link_text.''; + $data[1] = ''.$link_text.''; } else { $custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']); $data[1] = $custom_value[0]['description']; From 7258188491d814791015a663c1396e7353d88417 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 11 Dec 2023 11:01:53 +0100 Subject: [PATCH 02/34] remove agents bulk operation pandora_enterprise#12299 --- .../godmode/massive/massive_delete_agents.php | 16 ++++++++++------ pandora_console/include/functions_api.php | 10 +++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index 1dc6397cc6..88d7e54ccb 100755 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -46,6 +46,7 @@ require_once $config['homedir'].'/include/functions_alerts.php'; require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_massive_operations.php'; +enterprise_include_once('include/functions_agents.php'); /** @@ -71,12 +72,15 @@ function process_manage_delete($id_agents) $array_id = explode('|', $id_agent); try { $node = new Node((int) $array_id[0]); - $node->connect(); - - $agent = new Agent((int) $array_id[1]); - $success = $agent->delete(); - - $node->disconnect(); + $api_call_delete = $node->callApi( + 'delete_agent', + 'set', + (int) $array_id[1], + null, + ['2'], + null, + true + ); $success = agent_delete_from_metaconsole( $array_id[1], diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 8f5fb66f54..7a06156fb4 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -2266,9 +2266,12 @@ function api_set_delete_agent($id, $thrash1, $other, $returnType) } $agent_by_alias = false; + $agent_by_id = false; if ($other['data'][0] === '1') { $agent_by_alias = true; + } else if ($other['data'][0] === '2') { + $agent_by_id = true; } if (is_metaconsole()) { @@ -2331,7 +2334,12 @@ function api_set_delete_agent($id, $thrash1, $other, $returnType) } } } else { - $idAgent = agents_get_agent_id($id, false); + if ($agent_by_id === true) { + $idAgent = $id; + } else { + $idAgent = agents_get_agent_id($id, false); + } + if (!util_api_check_agent_and_print_error($idAgent, 'string', 'AD')) { return; } From f5b4cf235968b32b2821f469fbc7c24caefcbe20 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 13 Dec 2023 10:45:48 -0600 Subject: [PATCH 03/34] CLI allow create events with event_custom_id --- pandora_server/lib/PandoraFMS/Core.pm | 8 +++++--- pandora_server/util/pandora_manage.pl | 13 +++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 84d3d51bd2..bcb492fa1e 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4273,13 +4273,15 @@ Generate an event. =cut ########################################################################## -#sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$$) { +#sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$$$) { sub pandora_event { my ($pa_config, $evento, $id_grupo, $id_agente, $severity, $id_alert_am, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, $comment, $id_extra, $tags, $critical_instructions, $warning_instructions, $unknown_instructions, $custom_data, - $module_data, $module_status, $server_id) = @_; + $module_data, $module_status, $server_id, $event_custom_id) = @_; + + $event_custom_id //= ""; my $agent = undef; if (defined($id_agente) && $id_agente != 0) { @@ -4332,7 +4334,7 @@ sub pandora_event { my $utimestamp = time (); my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime ($utimestamp)); - my $event_custom_id = undef; + $id_agentmodule = 0 unless defined ($id_agentmodule); # Validate events with the same event id diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index afcf8b9199..f953baa24e 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -200,7 +200,7 @@ sub help_screen{ help_screen_line('--enable_eacl', '', 'Enable enterprise ACL system'); help_screen_line('--disable_double_auth', '', 'Disable the double authentication for the specified user'); print "\nEVENTS:\n\n" unless $param ne ''; - help_screen_line('--create_event', " [ \n\t \n\t \n\t ]", 'Add event'); + help_screen_line('--create_event', " [ \n\t \n\t \n\t ]", 'Add event'); help_screen_line('--update_event_custom_id', " ", 'Update Event Custom ID'); help_screen_line('--validate_event', " \n\t []", 'Validate events'); help_screen_line('--validate_event_id', '', 'Validate event given a event id'); @@ -4439,7 +4439,7 @@ sub cli_delete_profile() { ############################################################################## sub cli_create_event() { - my ($event,$event_type,$group_name,$agent_name,$module_name,$event_status,$severity,$template_name, $user_name, $comment, $source, $id_extra, $tags, $custom_data,$force_create_agent,$c_instructions,$w_instructions,$u_instructions,$use_alias,$server_id) = @ARGV[2..21]; + my ($event,$event_type,$group_name,$agent_name,$module_name,$event_status,$severity,$template_name, $user_name, $comment, $source, $id_extra, $tags, $custom_data,$force_create_agent,$c_instructions,$w_instructions,$u_instructions,$use_alias,$server_id,$event_custom_id) = @ARGV[2..22]; $event_status = 0 unless defined($event_status); $severity = 0 unless defined($severity); @@ -4498,7 +4498,7 @@ sub cli_create_event() { print_log "[INFO] Adding event '$event' for agent '$agent_name' \n\n"; pandora_event ($conf, $event, $id_group, $id_agent, $severity, - $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, safe_input($source), $user_name, safe_input($comment), safe_input($id_extra), safe_input($tags), safe_input($c_instructions), safe_input($w_instructions), safe_input($u_instructions), $custom_data, undef, undef, $server_id); + $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, safe_input($source), $user_name, safe_input($comment), safe_input($id_extra), safe_input($tags), safe_input($c_instructions), safe_input($w_instructions), safe_input($u_instructions), $custom_data, undef, undef, $server_id, safe_input($event_custom_id)); } } else { if (! $agent_name) { @@ -4545,7 +4545,7 @@ sub cli_create_event() { print_log "[INFO] Adding event '$event' for agent '$agent_name' \n\n"; pandora_event ($conf, $event, $id_group, $id_agent, $severity, - $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, safe_input($source), $user_name, $comment, safe_input($id_extra), safe_input($tags), safe_input($c_instructions), safe_input($w_instructions), safe_input($u_instructions), $custom_data, undef, undef, $server_id); + $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, safe_input($source), $user_name, $comment, safe_input($id_extra), safe_input($tags), safe_input($c_instructions), safe_input($w_instructions), safe_input($u_instructions), $custom_data, undef, undef, $server_id, safe_input($event_custom_id)); } } @@ -7926,10 +7926,11 @@ sub pandora_manage_main ($$$) { {'name' => 'warning_instructions'}, {'name' => 'unknown_instructions'}, {'name' => 'use_alias'}, - {'name' => 'metaconsole'} + {'name' => 'metaconsole'}, + {'name' => 'event_custom_id'} ); - param_check($ltotal, 20, 17); + param_check($ltotal, 21, 18); check_values(\@fields); From ea935d3a9219305ce1d37ec61ed2c208c2cc10a9 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 13 Dec 2023 12:42:17 -0600 Subject: [PATCH 04/34] API allow create events with event_custom_id --- pandora_console/include/functions_api.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index bf1c1b3004..f6f522e6f1 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -13156,6 +13156,12 @@ function api_set_create_event($id, $trash1, $other, $returnType) $values['id_extra'] = ''; } + if ($other['data'][21] != '') { + $values['event_custom_id'] = $other['data'][21]; + }else{ + $values['event_custom_id'] = ''; + } + $custom_data = base64_decode($values['custom_data']); $custom_data = mysql_escape_string_sql($custom_data); @@ -13178,7 +13184,7 @@ function api_set_create_event($id, $trash1, $other, $returnType) $values['server_id'], $values['id_extra'], $ack_utimestamp, - $values['event_custom_id'] ?? null + $values['event_custom_id'] ); if ($other['data'][12] != '') { From 315d1a32236f52b9d403af8971e866162b6f8792 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 18 Dec 2023 13:50:54 +0100 Subject: [PATCH 05/34] add autorefresh to agent view --- pandora_console/godmode/users/configure_user.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 83e54f24c5..6b64cff6e7 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1556,6 +1556,7 @@ if (empty($doubleAuthElementsContent) === false) { $autorefresh_list_out = []; if (is_metaconsole() === false || is_centralized() === true) { $autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail'; + $autorefresh_list_out['operation/agentes/ver_agente'] = 'Agent view'; $autorefresh_list_out['operation/agentes/alerts_status'] = 'Alert detail'; $autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view'; $autorefresh_list_out['operation/gis_maps/render_view'] = 'Gis Map'; From 0d33a412ae5bde44b0491e5d2d84f1fb0fff7889 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Tue, 19 Dec 2023 08:56:54 -0600 Subject: [PATCH 06/34] Remove additional concatenation --- pandora_console/include/class/WebServerModuleDebug.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/WebServerModuleDebug.class.php b/pandora_console/include/class/WebServerModuleDebug.class.php index f09d1f3a68..872582e6a3 100644 --- a/pandora_console/include/class/WebServerModuleDebug.class.php +++ b/pandora_console/include/class/WebServerModuleDebug.class.php @@ -265,7 +265,7 @@ class WebServerModuleDebug extends Wizard ); // Set execution timeout. $executionForPerform .= sprintf( - $executionForPerform.' -m %d', + ' -m %d', $this->requestTimeout ); From f36d36a34fe48b06fb9b7cb0e21c9a580109343a Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Thu, 21 Dec 2023 11:20:57 -0600 Subject: [PATCH 07/34] Modify the place where maintenance lines are added --- pandora_server/util/pandora_db.pl | 39 ++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 68407ec51e..eb42cd16b2 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -79,6 +79,15 @@ sub log_message ($$;$) { } } +######################################################################## +# Print the given message and writes on error log. +######################################################################## +sub log_error_message ($$) { + my ($conf, $message) = @_; + log_message('',,"$message\n\n"); + log_error_writter($conf, "$message\n"); +} + ######################################################################## # Delete old data from the database. ######################################################################## @@ -1289,9 +1298,6 @@ sub pandoradb_main { # Maintain Referential integrity and other stuff pandora_checkdb_integrity ($conf, $dbh); - # Close and open error log blocks - handle_error_log_block($conf, $dbh); - # Move old data to the history DB if (defined ($history_dbh)) { undef ($history_dbh) unless defined (enterprise_hook ('pandora_historydb', [$dbh, $history_dbh, $conf->{'_history_db_days'}, $conf->{'_history_db_step'}, $conf->{'_history_db_delay'}, $conf->{'_history_db_string_days'}, $conf->{'_history_db_adv'}])); @@ -1372,15 +1378,23 @@ sub pandora_check_forgotten_discovery_tasks { sub handle_error_log_block { my ($conf, $dbh) = @_; my $is_open = get_db_value ($dbh,"SELECT `value` FROM `tconfig` WHERE `token` = 'open_error_log'"); - open (STDERR, ">> " . $conf->{'errorlog_file'}) or die " [ERROR] " . pandora_get_initial_product_name() . " can't write to Errorlog. Aborting : \n $! \n"; if (!defined ($is_open)) { db_do($dbh, "INSERT INTO `tconfig`(`token`, `value`) VALUES ('open_error_log', 1)"); } elsif ($is_open eq 1){ - print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks ends\n"; + log_error_writter($conf, strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks ends\n"); } - print STDERR strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks starts\n"; + log_error_writter($conf, strftime ("%Y-%m-%d %H:%M:%S", localtime()) . ' - ' . $conf->{'servername'} . " pandora_db: pandora_db maintenance tasks starts\n"); +} + +############################################################################### +# Print messages on error log file +############################################################################### +sub log_error_writter($$){ + my ($conf, $message) = @_; + open (STDERR, ">> " . $conf->{'errorlog_file'}) or die " [ERROR] " . pandora_get_initial_product_name() . " can't write to Errorlog. Aborting : \n $! \n"; + print STDERR $message; close (STDERR); } @@ -1417,17 +1431,20 @@ if (defined($conf{'_history_db_enabled'}) && $conf{'_history_db_enabled'} eq '1' } } +# Close and open error log blocks +handle_error_log_block(\%conf, $dbh); + # Only run on master servers. pandora_set_master(\%conf, $dbh); if ($conf{'_force'} == 0 && pandora_is_master(\%conf) == 0) { - log_message ('', " [*] Not a master server.\n\n"); + log_error_message (\%conf, " [*] Not a master server."); exit 1; } # Get a lock on the main database. my $db_lock = db_get_lock ($dbh, $conf{'dbname'} . '_pandora_db', $LOCK_TIMEOUT, 1); if ($db_lock == 0) { - log_message ('', " [*] Another instance of DB Tool seems to be running on the main database.\n\n"); + log_error_message (\%conf, " [*] Another instance of DB Tool seems to be running on the main database."); exit 1; } @@ -1435,7 +1452,7 @@ if ($db_lock == 0) { if (defined($history_dbh)) { my $history_lock = db_get_lock ($history_dbh, $conf{'_history_db_name'} . '_pandora_db', $LOCK_TIMEOUT, 1); if ($history_lock == 0) { - log_message ('', " [*] Another instance of DB Tool seems to be running on the history database.\n\n"); + log_error_message (\%conf, " [*] Another instance of DB Tool seems to be running on the history database."); exit 1; } } @@ -1443,14 +1460,14 @@ if (defined($history_dbh)) { # Get a lock merging. my $lock_merge = db_get_lock ($dbh, 'merge-working', $LOCK_TIMEOUT, 1); if ($lock_merge == 0) { - log_message ('', " [*] Merge is running.\n\n"); + log_error_message (\%conf, " [*] Merge is running."); exit 1; } # Get a lock on merging events. my $lock_merge_events = db_get_lock ($dbh, 'merging-events', $LOCK_TIMEOUT, 1); if ($lock_merge_events == 0) { - log_message ('', " [*] Merge events is running.\n\n"); + log_error_message (\%conf, " [*] Merge events is running."); exit 1; } From 6a7eca83df379369498c4429406bc9dc41a7c1b7 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 22 Dec 2023 12:16:34 +0100 Subject: [PATCH 08/34] #12539 message 200 modules agent --- .../operation/agentes/alerts_status.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index c262d8c4b3..9cba248063 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -535,6 +535,21 @@ echo ''; ui_require_css_file('cluetip', 'include/styles/js/'); ui_require_jquery_file('cluetip'); + +$system_higher = false; +$modules_agent = db_get_all_rows_sql(sprintf('SELECT id_agente FROM tagente_modulo WHERE id_agente = %s', $id_agente)); +if (is_array($modules_agent)) { + $all_modules = db_get_all_rows_sql('SELECT id_agente FROM tagente_modulo'); + $all_agents = db_get_all_rows_sql('SELECT id_agente FROM tagente'); + if (is_array($all_modules) && is_array($all_agents)) { + if ((count($all_modules) / count($all_agents)) >= 200) { + $system_higher = true; + } + } +} + +echo ''; + ?> "; @@ -2746,9 +2746,11 @@ function html_print_input_text_extended( ]; foreach ($attrs as $attribute => $default) { - if (array_key_exists($attribute, $attributes)) { + if (array_key_exists($attribute, $attributes) + || ($password === true && $attribute === 'value') + ) { continue; - } //end if + } /* * Remember, this next code have a $$ that for example there is a var as @@ -2758,7 +2760,7 @@ function html_print_input_text_extended( * */ - // Exact operator because we want to show "0" on the value + // Exact operator because we want to show "0" on the value. if ($attribute !== '') { $output .= $attribute.'="'.$$attribute.'" '; } else if ($default != '') { @@ -2789,6 +2791,12 @@ function html_print_input_text_extended( ], true ); + + echo "'; } if (!$return) { From d4c5d2f31637451339d191d720d325e00ccc68e2 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 23 Jan 2024 01:00:29 +0100 Subject: [PATCH 30/34] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4fd5136eee..e7c241251a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.775-240122 +Version: 7.0NG.775-240123 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 a84d1c1048..00e1bec872 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.775-240122" +pandora_version="7.0NG.775-240123" 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 1bdfa2c98d..40317705f1 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.775'; -use constant AGENT_BUILD => '240122'; +use constant AGENT_BUILD => '240123'; # 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 9d6bcf8f51..8ed67cacd8 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.775 -%define release 240122 +%define release 240123 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 5b9e48578d..e073b7a1b6 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240122 +%define release 240123 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 8ed84f4eb2..ca44c46126 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240122 +%define release 240123 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index e1ac0c3dd6..857491d509 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240122 +%define release 240123 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 710699686d..1491df0b07 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.775 -%define release 240122 +%define release 240123 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 54a64fa46d..0232a6bf8c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.775" -PI_BUILD="240122" +PI_BUILD="240123" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index efc085bfe6..74ffb7b496 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240122} +{240123} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2a05f4e9ce..8e094eedae 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.775 Build 240122") +#define PANDORA_VERSION ("7.0NG.775 Build 240123") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7600b129ae..b7d17d6756 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.775(Build 240122))" + VALUE "ProductVersion", "(7.0NG.775(Build 240123))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6ba70f63f8..4d832ca478 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.775-240122 +Version: 7.0NG.775-240123 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 69659ab510..95ee569569 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.775-240122" +pandora_version="7.0NG.775-240123" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 68a52be97d..6c993cc7ca 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 = 'PC240122'; +$build_version = 'PC240123'; $pandora_version = 'v7.0NG.775'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index a5765f9bb2..6d491a85cb 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 c74934e734..251e09b74e 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.775 -%define release 240122 +%define release 240123 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index dc859972e9..6c05f78ac2 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.775 -%define release 240122 +%define release 240123 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 18312cc95f..d9a71e864f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.775" -PI_BUILD="240122" +PI_BUILD="240123" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 9c9ad0d5a0..29545f538f 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.775 Build 240122"; +my $version = "7.0NG.775 Build 240123"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2d010312d9..2d1eec0b82 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.775 Build 240122"; +my $version = "7.0NG.775 Build 240123"; # save program name for logging my $progname = basename($0); From fc08e9b9b657df8c3b3e2454c1cb10f0f311c281 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 23 Jan 2024 11:27:15 +0100 Subject: [PATCH 31/34] #12792 fix 500 change agent inventory --- pandora_console/include/ajax/inventory.ajax.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/inventory.ajax.php b/pandora_console/include/ajax/inventory.ajax.php index 71fac8d0ec..207adde03d 100644 --- a/pandora_console/include/ajax/inventory.ajax.php +++ b/pandora_console/include/ajax/inventory.ajax.php @@ -26,7 +26,8 @@ * ============================================================================ */ - check_login(); +require_once $config['homedir'].'/include/functions_inventory.php'; +check_login(); if (is_ajax() === true) { $id_agent = get_parameter('id_agent', '0'); From 3026c9d50dc47aac8932b859f7b6fb8a2e6e0ff4 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 23 Jan 2024 16:27:07 +0100 Subject: [PATCH 32/34] #12786 fix wizard open out of index --- pandora_console/general/register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/register.php b/pandora_console/general/register.php index 759e319dbd..ed583c7ed4 100644 --- a/pandora_console/general/register.php +++ b/pandora_console/general/register.php @@ -100,7 +100,7 @@ if ($initial && users_is_admin()) { ); } -if (check_acl($config['id_user'], 0, 'AW')) { +if (check_acl($config['id_user'], 0, 'AW') && empty($sec2)) { $welcome = !$initial; try { $welcome_window = new WelcomeWindow($welcome); From 538177c3e5b34df01527948183722236b2dac274 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 23 Jan 2024 17:08:06 +0100 Subject: [PATCH 33/34] #12753 fixed vul command in ajax --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index cd22b55f1b..e328f4cd91 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3804,7 +3804,7 @@ function events_get_response_target( } $event = db_get_row('tevento', 'id_evento', $event_id); - $target = io_safe_output($event_response['target']); + $target = io_safe_output(db_get_value('target', 'tevent_response', 'id', $event_response['id'])); // Replace parameters response. if (isset($response_parameters) === true From dd252daaf2072a2435b67e788117bbe9d3c4f18f Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 24 Jan 2024 01:00:32 +0100 Subject: [PATCH 34/34] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e7c241251a..da5db137f5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.775-240123 +Version: 7.0NG.775-240124 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 00e1bec872..4617d8e745 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.775-240123" +pandora_version="7.0NG.775-240124" 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 40317705f1..4ec522db43 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.775'; -use constant AGENT_BUILD => '240123'; +use constant AGENT_BUILD => '240124'; # 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 8ed67cacd8..2786cafe56 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.775 -%define release 240123 +%define release 240124 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index e073b7a1b6..92cb781d5a 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240123 +%define release 240124 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index ca44c46126..56dc5c9c0c 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240123 +%define release 240124 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 857491d509..858147650c 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240123 +%define release 240124 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 1491df0b07..deff8bc50f 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.775 -%define release 240123 +%define release 240124 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 0232a6bf8c..9a94ff4cb4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.775" -PI_BUILD="240123" +PI_BUILD="240124" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 74ffb7b496..dd51dcf708 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240123} +{240124} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8e094eedae..22f49347f0 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.775 Build 240123") +#define PANDORA_VERSION ("7.0NG.775 Build 240124") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b7d17d6756..cf88101947 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.775(Build 240123))" + VALUE "ProductVersion", "(7.0NG.775(Build 240124))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4d832ca478..d23840e972 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.775-240123 +Version: 7.0NG.775-240124 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 95ee569569..4c11ce1bce 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.775-240123" +pandora_version="7.0NG.775-240124" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6c993cc7ca..60dd8bf9a1 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 = 'PC240123'; +$build_version = 'PC240124'; $pandora_version = 'v7.0NG.775'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 6d491a85cb..ab50a8ec91 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 251e09b74e..d76f4f73f5 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.775 -%define release 240123 +%define release 240124 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6c05f78ac2..fdafb2797e 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.775 -%define release 240123 +%define release 240124 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index effa474fba..2202c82563 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.775" -PI_BUILD="240123" +PI_BUILD="240124" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2ab5d89b6a..47f6f469ab 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.775 Build 240123"; +my $version = "7.0NG.775 Build 240124"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2d1eec0b82..7801143234 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.775 Build 240123"; +my $version = "7.0NG.775 Build 240124"; # save program name for logging my $progname = basename($0);