Merge branch 'develop' into ent-13604-selector-severity-priority-tiene-opciones-compuestas

This commit is contained in:
Pablo Aragon 2024-05-06 09:25:31 +02:00
commit 6a4f5a9205
31 changed files with 132 additions and 98 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.776-240503
Version: 7.0NG.776-240506
Architecture: all
Priority: optional
Section: admin

View File

@ -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

View File

@ -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;

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.776"
PI_BUILD="240503"
PI_BUILD="240506"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{240503}
{240506}
ViewReadme
{Yes}

View File

@ -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;

View File

@ -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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.776-240503
Version: 7.0NG.776-240506
Architecture: all
Priority: optional
Section: admin

View File

@ -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

View File

@ -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'];

View File

@ -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.

View File

@ -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;

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.776';
$build = '240503';
$build = '240506';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1389,7 +1389,15 @@ if ($autosearch) {
if ($result === false) {
$result = [];
} else {
$tablePagination = ui_pagination($count, false, $offset, 0, true, 'offset', false);
$tablePagination = ui_pagination(
$count,
'index.php?sec='.$section.'&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params,
$offset,
0,
true,
'offset',
false
);
}
} else {
// For each server defined and not disabled.
@ -1460,7 +1468,15 @@ if ($autosearch) {
$show_count = true;
}
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', $show_count);
$tablePagination = ui_pagination(
$count_modules,
'index.php?sec='.$section.'&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params,
$offset,
0,
true,
'offset',
$show_count
);
}
// Get number of elements of the pagination.
@ -2337,7 +2353,15 @@ if (empty($result) === false) {
$show_count = true;
}
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', $show_count);
$tablePagination = ui_pagination(
$count_modules,
'index.php?sec='.$section.'&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params,
$offset,
0,
true,
'offset',
$show_count
);
}
} else {
if (get_parameter('ag_group', false) !== false) {

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.776
%define release 240503
%define release 240506
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.776
%define release 240503
%define release 240506
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.776
%define release 240503
%define release 240506
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.776-240503
Version: 7.0NG.776-240506
Architecture: all
Priority: optional
Section: admin

View File

@ -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_cpan=0
package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.776";
my $pandora_build = "240503";
my $pandora_build = "240506";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.776";
my $pandora_build = "240503";
my $pandora_build = "240506";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -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}

View File

@ -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}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.776"
PI_BUILD="240503"
PI_BUILD="240506"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -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;

View File

@ -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);