diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 122d43ed05..aaba742659 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240503 +Version: 7.0NG.776-240506 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 03461beb0f..c2fa12960c 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.776-240503" +pandora_version="7.0NG.776-240506" 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 05d49335cb..b784189567 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.776'; -use constant AGENT_BUILD => '240503'; +use constant AGENT_BUILD => '240506'; # 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 037ebbe6bb..ee143f48f4 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.776 -%define release 240503 +%define release 240506 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 d3558b0026..543ecf5db8 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.776 -%define release 240503 +%define release 240506 %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 a7d6c6a620..bce5bc22c9 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.776 -%define release 240503 +%define release 240506 %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 db99b6fbf2..c195e54d12 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.776 -%define release 240503 +%define release 240506 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 250f327421..943cfc54f1 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.776 -%define release 240503 +%define release 240506 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 aae9e94d1a..cb23e3bd30 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240503" +PI_BUILD="240506" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 37d4289b18..435fd2861e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240503} +{240506} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 85da7bbecd..d02064850c 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.776 Build 240503") +#define PANDORA_VERSION ("7.0NG.776 Build 240506") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 44c1b8d6a1..c3df89f6c4 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.776(Build 240503))" + VALUE "ProductVersion", "(7.0NG.776(Build 240506))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e947bc0573..25ad1edcad 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240503 +Version: 7.0NG.776-240506 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 c6b8402407..570166590b 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.776-240503" +pandora_version="7.0NG.776-240506" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 38488fc9e4..557ec82e1b 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -69,38 +69,41 @@ function api_execute( if (empty($url) === true) { $url = 'http://'.$ip.$pandora_url.'/include/api.php?'; + } else { + $url_schema = parse_url($url); + $url = $url_schema['scheme'].'://'.$url_schema['host'].$pandora_url.'/include/api.php?'; + } - if (empty($op) === false) { - $data['op'] = $op; - } + if (empty($op) === false) { + $data['op'] = $op; + } - if (empty($op2) === false) { - $data['op2'] = $op2; - } + if (empty($op2) === false) { + $data['op2'] = $op2; + } - if (empty($id) === false) { - $data['id'] = $id; - } + if (empty($id) === false) { + $data['id'] = $id; + } - if (empty($id2) === false) { - $data['id2'] = $id2; - } + if (empty($id2) === false) { + $data['id2'] = $id2; + } - if (empty($return_type) === false) { - $data['return_type'] = $return_type; - } + if (empty($return_type) === false) { + $data['return_type'] = $return_type; + } - if (empty($other) === false) { - $data['other_mode'] = $other_mode; - $data['other'] = $other; - } + if (empty($other) === false) { + $data['other_mode'] = $other_mode; + $data['other'] = $other; + } - // If token is not reported,use old method. - if (empty($token) === true) { - $data['apipass'] = $apipass; - $data['user'] = $user; - $data['pass'] = $password; - } + // If token is not reported,use old method. + if (empty($token) === true) { + $data['apipass'] = $apipass; + $data['user'] = $user; + $data['pass'] = $password; } $url_protocol = parse_url($url)['scheme']; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9af4949d06..7a215f9070 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240503'; +$build_version = 'PC240506'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_forecast.php b/pandora_console/include/functions_forecast.php index 1f0d1e59d9..e4fb43a7c5 100644 --- a/pandora_console/include/functions_forecast.php +++ b/pandora_console/include/functions_forecast.php @@ -134,11 +134,14 @@ function forecast_projection_graph( // 3.1 Standard deviation for X: sqrt((Sum(Xi²)/Obs) - (avg X)²) // 3.2 Standard deviation for Y: sqrt((Sum(Yi²)/Obs) - (avg Y)²) // Linear correlation coefficient: - // Agent interval could be zero, 300 is the predefined + // Agent interval could be zero, 300 is the predefined. if ($sum_obs == 0) { $agent_interval = SECONDS_5MINUTES; } else { $agent_interval = ($sum_diff_dates / $sum_obs); + if ($agent_interval < 60) { + $agent_interval = SECONDS_1MINUTE; + } } // Could be a inverse correlation coefficient @@ -170,7 +173,7 @@ function forecast_projection_graph( $a = 0; } - // Data inicialization + // Data inicialization. $output_data = []; if ($prediction_period != false) { $limit_timestamp = ($last_timestamp + $prediction_period); @@ -199,50 +202,54 @@ function forecast_projection_graph( $time_format = 'M d'; } - // Aplying linear regression to module data in order to do the prediction - $idx = 0; - // Create data in graph format like - while ($in_range) { - $now = time(); + try { + // Aplying linear regression to module data in order to do the prediction. + $idx = 0; + // Create data in graph format like. + while ($in_range) { + $now = time(); - // Check that exec time is not greater than half max exec server time - if ($max_exec_time != false) { - if (($begin_time + ($max_exec_time / 2)) < $now) { - return false; - } - } - - $timestamp_f = ($current_ts * 1000); - - if ($csv) { - $output_data[$idx]['date'] = $current_ts; - $output_data[$idx]['data'] = ($a + ($b * $current_ts)); - } else { - $output_data[$idx][0] = $timestamp_f; - $output_data[$idx][1] = ($a + ($b * $current_ts)); - } - - // Using this function for prediction_date - if ($prediction_period == false) { - // These statements stop the prediction when interval is greater than 2 years - if (($current_ts - $last_timestamp) >= 94608000 - || $max_value == $min_value - ) { - return false; + // Check that exec time is not greater than half max exec server time. + if ($max_exec_time != false) { + if (($begin_time + ($max_exec_time / 2)) < $now) { + return false; + } } - // Found it - if (($max_value >= $output_data[$idx][1]) - && ($min_value <= $output_data[$idx][0]) - ) { - return ($current_ts + ($sum_diff_dates * $agent_interval)); - } - } else if ($current_ts > $limit_timestamp) { - $in_range = false; - } + $timestamp_f = ($current_ts * 1000); - $current_ts = ($current_ts + $agent_interval); - $idx++; + if ($csv) { + $output_data[$idx]['date'] = $current_ts; + $output_data[$idx]['data'] = ($a + ($b * $current_ts)); + } else { + $output_data[$idx][0] = $timestamp_f; + $output_data[$idx][1] = ($a + ($b * $current_ts)); + } + + // Using this function for prediction_date. + if ($prediction_period == false) { + // These statements stop the prediction when interval is greater than 2 years. + if (($current_ts - $last_timestamp) >= 94608000 + || $max_value == $min_value + ) { + return false; + } + + // Found it. + if (($max_value >= $output_data[$idx][1]) + && ($min_value <= $output_data[$idx][0]) + ) { + return ($current_ts + ($sum_diff_dates * $agent_interval)); + } + } else if ($current_ts > $limit_timestamp) { + $in_range = false; + } + + $current_ts = ($current_ts + $agent_interval); + $idx++; + } + } catch (\Exception $e) { + return false; } return $output_data; diff --git a/pandora_console/install.php b/pandora_console/install.php index d97bd64d26..1abad96ca9 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 7cc4e63064..2928d1e365 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.776 -%define release 240503 +%define release 240506 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 16ad3ac618..d58d1fc072 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.776 -%define release 240503 +%define release 240506 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5a42f571c6..bd176b3fc7 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240503" +PI_BUILD="240506" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 511a173cf1..c3d616f0a5 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.776 Build 240503"; +my $version = "7.0NG.776 Build 240506"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a74b93661d..131be6734d 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.776 Build 240503"; +my $version = "7.0NG.776 Build 240506"; # save program name for logging my $progname = basename($0);