From 1de44686a17a1a73205cfbfb4b5c1a0fd6de8928 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 21 Feb 2024 15:26:08 +0100 Subject: [PATCH 01/56] check for agent name not empty --- pandora_server/util/pandora_manage.pl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 50540e43ab..79315af00f 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -1228,11 +1228,11 @@ sub param_error ($$) { } ############################################################################### -# Print a 'not exists' error and exit the program. +# Print a 'does not exist' error and exit the program. ############################################################################### sub notexists_error ($$) { - print (STDERR "[ERROR] Error: The $_[0] '$_[1]' not exists.\n\n"); - logger( $conf, "($progname) [ERROR] Error: The $_[0] '$_[1]' not exists.", 10); + print (STDERR "[ERROR] Error: The $_[0] '$_[1]' does not exist.\n\n"); + logger( $conf, "($progname) [ERROR] Error: The $_[0] '$_[1]' does not exist.", 10); exit 1; } @@ -3429,6 +3429,11 @@ sub cli_agent_update() { my @id_agents; my $id_agent; + # Check for mandatory fields. + if ($field eq 'agent_name' && !$new_value) { + + } + if (defined $use_alias and $use_alias eq 'use_alias') { @id_agents = get_agent_ids_from_alias($dbh,$agent_name); foreach my $id (@id_agents) { @@ -3459,6 +3464,10 @@ sub cli_agent_update() { $new_value = $id_parent; } elsif($field eq 'agent_name') { + if (!$new_value) { + print_log "[ERROR] Agent name cannot be empty\n\n"; + exit; + } my $agent_exists = get_agent_id($dbh,$new_value); non_exist_check($agent_exists,'agent',$new_value); $field = 'nombre'; @@ -4104,7 +4113,7 @@ sub cli_exec_from_file() { elsif($c == 3) { $file = $opt; if(!(-e $file)) { - print_log "[ERROR] File '$file' not exists or cannot be opened\n\n"; + print_log "[ERROR] File '$file' does not exist or cannot be opened\n\n"; exit; } } @@ -4952,7 +4961,7 @@ sub cli_validate_alert() { if (defined $use_alias and $use_alias eq 'use_alias') { my @id_agents = get_agent_ids_from_alias($dbh,$agent_id); if(!@id_agents) { - print (STDERR "[ERROR] Error: The agent '$agent_id' not exists.\n\n"); + print (STDERR "[ERROR] Error: The agent '$agent_id' does not exist.\n\n"); } foreach my $id (@id_agents) { @@ -5946,7 +5955,7 @@ sub cli_get_bad_conf_files() { $missings++; } elsif ($result == -1) { - print_log "[WARN] File not exists /conf/".$file."\n\n"; + print_log "[WARN] File does not exist /conf/".$file."\n\n"; $bad_files++; last; } From 8a43fbfd1f1504ff8c812fac1bd476041c04e024 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 21 Feb 2024 15:27:01 +0100 Subject: [PATCH 02/56] check for agent name not empty --- pandora_server/util/pandora_manage.pl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 79315af00f..ec73dd827c 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -3429,11 +3429,6 @@ sub cli_agent_update() { my @id_agents; my $id_agent; - # Check for mandatory fields. - if ($field eq 'agent_name' && !$new_value) { - - } - if (defined $use_alias and $use_alias eq 'use_alias') { @id_agents = get_agent_ids_from_alias($dbh,$agent_name); foreach my $id (@id_agents) { From 1dc733c7bb56bd53b1fb1c2908d0348e5e918c6a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 28 Feb 2024 09:37:12 +0100 Subject: [PATCH 03/56] #12158 correction words --- pandora_console/godmode/setup/setup_ITSM.php | 12 ++++++------ pandora_console/godmode/setup/setup_general.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/setup/setup_ITSM.php b/pandora_console/godmode/setup/setup_ITSM.php index 899a73a985..376d9111ad 100644 --- a/pandora_console/godmode/setup/setup_ITSM.php +++ b/pandora_console/godmode/setup/setup_ITSM.php @@ -180,7 +180,7 @@ $button_test .= html_print_image( 'images/status_sets/default/severity_normal.png', true ); -$button_test .= ' '.__('Connection its OK').''; +$button_test .= ' '.__('Connection is OK').''; $button_test .= ''; $button_test .= ' '; $row['control'] = html_print_label_input_block( - __('Test connection pandora to ITSM'), + __('Test connection PFMS to Pandora ITSM'), $button_test, ['div_class' => 'ITSM-remote-setup-ITSM_token'] ); @@ -206,8 +206,8 @@ if (empty($itsm_public_url) === true) { } $row['publicUrl'] = html_print_label_input_block( - __('URL conect to API %s', get_product_name()).ui_print_help_tip( - __('Full URL to your Pandora (e.g., http://192.168.1.20).'), + __('URL connect to API %s', get_product_name()).ui_print_help_tip( + __('Full URL to your Pandora FMS (e.g., http://192.168.1.20).'), true ), html_print_input_text( @@ -221,7 +221,7 @@ $row['publicUrl'] = html_print_label_input_block( ); $row['agentsSync'] = html_print_label_input_block( - __('Number Agents to synchronize').ui_print_help_tip( + __('Number of Agents to synchronize').ui_print_help_tip( __('Number of agents that will synchronize at the same time, minimum 10 max 1000'), true ), @@ -261,7 +261,7 @@ $button_test_pandora .= html_print_image( 'images/status_sets/default/severity_normal.png', true ); -$button_test_pandora .= ' '.__('Connection its OK').''; +$button_test_pandora .= ' '.__('Connection is OK').''; $button_test_pandora .= '