diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e7c241251a..b57934fc50 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-240125 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..cc3cf84853 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-240125" 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..b0f1c9f54c 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 => '240125'; # 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..516ef3ec99 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 240125 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..c0ff5e3f44 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 240125 %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..14870a78ed 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 240125 %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..1e88ca4c7e 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 240125 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..515dc4ea4d 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 240125 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..20f63af782 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="240125" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 74ffb7b496..81661ca1bf 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240123} +{240125} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8e094eedae..91adc36bc7 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 240125") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b7d17d6756..5ac5a2e47f 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 240125))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4d832ca478..971ba8b024 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-240125 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..6e7853f74f 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-240125" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 6f09d889f7..d06ff90118 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -283,8 +283,14 @@ function mainInsertData() secondText: '', currentText: '', closeText: ''}); - - $("#text-date").datepicker({dateFormat: ""}); + + $('#text-data').datepicker ({ + dateFormat: '', + changeMonth: true, + changeYear: true, + showAnim: 'slideDown', + firstDay: "", + }); $.datepicker.setDefaults($.datepicker.regional[ ""]); }); 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); diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 9e6f6ee180..07db7327a5 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -83,6 +83,23 @@ $table->data[3][] = html_print_label_input_block( html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true) ); +$table->data[4][] = html_print_label_input_block( + __('Netflow interval').ui_print_help_tip(__('It is necessary to restart the server if the value is changed.'), true), + html_print_select( + [ + '600' => __('10 min'), + '1800' => __('30 min'), + '3600' => __('60 min'), + ], + 'netflow_interval', + $config['netflow_interval'], + '', + '', + 0, + true + ) +); + $table->data[4][] = html_print_label_input_block( __('Enable Sflow'), html_print_checkbox_switch_extended( diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 09835fe150..2344116cb1 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1557,6 +1557,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'; diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 007ba77d89..851a22040b 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -1335,6 +1335,15 @@ if ($perform_event_response === true) { } $command = $event_response['target']; + + // Prevent OS command injection. + $prev_command = get_events_get_response_target($event_id, $event_response, $server_id); + + if ($command !== $prev_command) { + echo __('unauthorized'); + return; + } + $command_timeout = ($event_response !== false) ? $event_response['command_timeout'] : 90; if (enterprise_installed() === true) { if ($event_response !== false 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'); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6c993cc7ca..0cbf1c15e8 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 = 'PC240125'; $pandora_version = 'v7.0NG.775'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9eb19be28d..dc7bb103db 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1624,6 +1624,10 @@ function config_update_config() $error_update[] = __('Netflow max lifetime'); } + if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) { + $error_update[] = __('Netflow interval'); + } + if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) { $error_update[] = __('Name resolution for IP address'); } @@ -3060,6 +3064,10 @@ function config_process_config() config_update_value('netflow_max_lifetime', '5'); } + if (!isset($config['netflow_interval'])) { + config_update_value('netflow_interval', 1800); + } + if (!isset($config['sflow_interval'])) { config_update_value('sflow_interval', SECONDS_10MINUTES); } 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 diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index bb6a785812..111b7af918 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2738,8 +2738,8 @@ function html_print_input_text_extended( if ($hide_div_eye !== false) { echo ""; @@ -2756,9 +2756,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 @@ -2768,7 +2770,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 != '') { @@ -2799,6 +2801,12 @@ function html_print_input_text_extended( ], true ); + + echo "'; } if (!$return) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c8a794cc1d..d73950e989 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -15969,8 +15969,8 @@ function reporting_translate_sla_status_for_graph($status) */ function reporting_header_table_for_pdf($title='', $description='') { - $result_pdf = ''; - $result_pdf .= ''; + // $result_pdf = ''; + $result_pdf = '
'; $result_pdf .= ''; $result_pdf .= '
'; $result_pdf .= $title; diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css index 9a69ea8c56..4e3da3194c 100644 --- a/pandora_console/include/styles/events.css +++ b/pandora_console/include/styles/events.css @@ -569,3 +569,19 @@ div.container-filter-buttons { .ui-dialog.modal-sound .ui-widget-header { display: flex !important; } + +.responsive_button_sound_events { + margin-right: 25% !important; +} + +@media (max-width: 1640px) { + .responsive_button_sound_events { + margin-right: 10% !important; + } +} + +@media (max-width: 1420px) { + .responsive_button_sound_events { + margin-right: 10px !important; + } +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8a361b187b..8a30f050be 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -776,6 +776,10 @@ select:-internal-list-box { width: 80%; } +.w85p { + width: 85%; +} + .w88p { width: 88%; } @@ -12116,6 +12120,10 @@ div.relative > div > div#ui-datepicker-div { width: 400px; } +.container-div-input-password { + display: block !important; +} + #message_dialog_connection { height: auto !important; } diff --git a/pandora_console/install.php b/pandora_console/install.php index 6d491a85cb..1e2252fbae 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
'responsive_button_sound_events', 'icon' => 'sound', - 'style' => 'margin-right: 25% !important', 'minimize-arrow' => true, 'span_style' => 'width: 100%', ], diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 240363e351..4b7e8b0da0 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -6,7 +6,7 @@ %define debug_package %{nil} %define name pandorafms_console %define version 7.0NG.775 -%define release 240123 +%define release 240125 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 4bc4adcc85..ca4ab9657e 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -6,7 +6,7 @@ %define debug_package %{nil} %define name pandorafms_console %define version 7.0NG.775 -%define release 240123 +%define release 240125 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index e6969db9dc..977a58e4fe 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.775 -%define release 240123 +%define release 240125 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 8fc17246d5..280bf8423b 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -91,7 +91,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('sound_alert', 'include/sounds/air_shock_alarm.wav'), ('sound_critical', 'include/sounds/Star_Trek_emergency_simulation.wav'), ('sound_warning', 'include/sounds/negativebeep.wav'), -('netflow_interval', '3600'), +('netflow_interval', '1800'), ('netflow_daemon', '/usr/bin/nfcapd'), ('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_max_resolution', '50'), diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 31213f6c47..4ea2ca557b 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.775-240123 +Version: 7.0NG.775-240125 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index dae47c3d07..ef81d3e503 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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-240125" package_cpan=0 package_pandora=1 diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index bddb11a293..1945cbd08f 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -816,3 +816,5 @@ madeserver_autofit 7d # Model sensitivity. A lower value triggers less anomalies (PANDORA FMS ENTERPRISE ONLY). madeserver_sensitivity 0.1 +# Encoding to use on mail subject (MIME-Header by default) +# mail_subject_encoding MIME-Header-ISO_2022_JP \ No newline at end of file diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index eb23fcce89..b25686ee4b 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -46,7 +46,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.775"; -my $pandora_build = "240123"; +my $pandora_build = "240125"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash @@ -140,7 +140,7 @@ sub pandora_get_sharedconfig ($$) { # Netflow configuration options $pa_config->{"activate_netflow"} = pandora_get_tconfig_token ($dbh, 'activate_netflow', 0); $pa_config->{"netflow_path"} = pandora_get_tconfig_token ($dbh, 'netflow_path', '/var/spool/pandora/data_in/netflow'); - $pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 3600); + $pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 1800); $pa_config->{"netflow_daemon"} = pandora_get_tconfig_token ($dbh, 'netflow_daemon', '/usr/bin/nfcapd'); # Sflow configuration options @@ -589,6 +589,8 @@ sub pandora_load_config { $pa_config->{"madeserver"} = 0; # 774. + $pa_config->{"mail_subject_encoding"} = 'MIME-Header'; # 776. + # Check for UID0 if ($pa_config->{"quiet"} != 0){ if ($> == 0){ @@ -691,6 +693,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^mail_in_separate\s+([0-9]*)/i) { $pa_config->{'mail_in_separate'}= clean_blank($1); } + elsif ($parametro =~ m/^mail_subject_encoding\s(.*)/i) { + $pa_config->{'mail_subject_encoding'}= clean_blank($1); + } elsif ($parametro =~ m/^snmp_logfile\s(.*)/i) { $pa_config->{'snmp_logfile'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 2bd9b4ef98..21ba802908 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -7191,10 +7191,18 @@ Puts all autodisable agents with all modules unknown on disabled mode sub pandora_disable_autodisable_agents ($$) { my ($pa_config, $dbh) = @_; - my $sql = 'SELECT id_agente FROM tagente - WHERE disabled=0 AND - tagente.unknown_count>0 AND - tagente.modo=2'; + + my $sql = 'SELECT id_agente + FROM ( + SELECT tm.id_agente, count(*) as sync_modules, ta.unknown_count + FROM tagente_modulo tm + JOIN tagente ta ON ta.id_agente = tm.id_agente + WHERE ta.disabled = 0 + AND NOT ((id_tipo_modulo >= 21 AND id_tipo_modulo <= 23) OR id_tipo_modulo = 100) + GROUP BY tm.id_agente + ) AS subquery + WHERE subquery.unknown_count >= subquery.sync_modules;'; + my @agents_autodisabled = get_db_rows ($dbh, $sql); return if ($#agents_autodisabled < 0); diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index c0ee332f64..b417e44efd 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -1533,7 +1533,7 @@ sub get_agent_addr_id ($$$) { ######################################################################## sub db_do ($$;@) { my ($dbh, $query, @values) = @_; - + #DBI->trace( 3, '/tmp/dbitrace.log' ); eval { $dbh->do($query, undef, @values); diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 02ea63cb23..020d69c4b3 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.775"; -my $pandora_build = "240123"; +my $pandora_build = "240125"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 580344542c..543ea45556 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -748,6 +748,7 @@ sub pandora_sendmail { my $subject = $_[2]; my $message = $_[3]; my $content_type = $_[4]; + my $encoding = $pa_config->{"mail_subject_encoding"} || 'MIME-Header'; $subject = decode_entities ($subject); @@ -758,7 +759,7 @@ sub pandora_sendmail { my %mail = ( To => $to_address, Message => $message, - Subject => encode('MIME-Header', $subject), + Subject => encode($encoding, $subject), 'X-Mailer' => $pa_config->{"rb_product_name"}, Smtp => $pa_config->{"mta_address"}, Port => $pa_config->{"mta_port"}, diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 251e09b74e..829d5ae091 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 240125 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6c05f78ac2..c697aa9c8f 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 240125 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d9a71e864f..03fa6a84d0 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="240125" MODE=$1 if [ $# -gt 1 ]; then @@ -191,7 +191,36 @@ install () { esac shift done - + + # Alternative destdir has been selected + if [ ! -z "$DESTDIR" ] + then + # Files from previous installation were found + if [ -d "/usr/lib/perl5/PandoraFMS" ] + then + GREEN='\033[01;32m' + NONE='\033[0m' + + echo -e -n "Files from a previous installation were found in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE}. " + read -p "That directory will be deleted in order to preserve integrity. Do you wish to proceed? (y/N): " USERAPPROVAL + + if [ "${USERAPPROVAL,,}" = "y" ]; then + rm -rf "/usr/lib/perl5/PandoraFMS" + echo -e "Previous PandoraFMS directory deleted successfully" + else + echo -e -n "Files in ${GREEN}/usr/lib/perl5/PandoraFMS/${NONE} will not be deleted. This may cause issues. " + read -p "Do you want to proceed with the installation anyway? (y/N): " USERAPPROVAL + + if [ "${USERAPPROVAL,,}" = "y" ]; then + echo "Proceeding with the installation anyway. This may cause problems in the future due to the existence of files from previous installations." + else + echo "Installation aborted. You chose not to proceed." + exit 1 + fi + fi + fi + fi + if [ "$LINUX" = YES ] then echo "$DISTRO distribution detected" diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2ab5d89b6a..66e75586cb 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 240125"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2d1eec0b82..b154b38ada 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 240125"; # save program name for logging my $progname = basename($0); diff --git a/pandora_server/util/plugin/wizard_wmi_module.pl b/pandora_server/util/plugin/wizard_wmi_module.pl index 23e49a7f83..fa25c26d0b 100755 --- a/pandora_server/util/plugin/wizard_wmi_module.pl +++ b/pandora_server/util/plugin/wizard_wmi_module.pl @@ -172,5 +172,5 @@ foreach my $k (keys %{$fields_values}){ # Get operation result my $result = eval $operation; if (defined($result)){ - print $result . "\n"; + print $result, "\n"; }