Merge remote-tracking branch 'origin/develop' into ent-7503-Calendarios-para-dias-especiales

This commit is contained in:
Daniel Barbero Martin 2021-11-03 08:04:15 +01:00
commit a1c7aebc2b
30 changed files with 95878 additions and 181598 deletions

183203
index.pot

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.758-211102
Version: 7.0NG.758-211103
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.758-211102"
pandora_version="7.0NG.758-211103"
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

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.758';
use constant AGENT_BUILD => '211102';
use constant AGENT_BUILD => '211103';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.758
%define release 211102
%define release 211103
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.758
%define release 211102
%define release 211103
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.758"
PI_BUILD="211102"
PI_BUILD="211103"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{211102}
{211103}
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.758 Build 211102")
#define PANDORA_VERSION ("7.0NG.758 Build 211103")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.758(Build 211102))"
VALUE "ProductVersion", "(7.0NG.758(Build 211103))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.758-211102
Version: 7.0NG.758-211103
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.758-211102"
pandora_version="7.0NG.758-211103"
package_pear=0
package_pandora=1

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC211102';
$build_version = 'PC211103';
$pandora_version = 'v7.0NG.758';
// Do not overwrite default timezone set if defined.

View File

@ -3848,13 +3848,28 @@ function modules_get_state_condition($state, $prefix='tae')
function modules_get_min_max_data($id_agent_module, $time_init=0)
{
$table = modules_get_table_data($id_agent_module);
$data = db_get_all_rows_sql(
'SELECT min(datos) as min, max(datos) as max
FROM '.$table.'
WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp >= '.$time_init
// Find the minimum and maximun value defined.
$sql = sprintf(
'SELECT `min`, `max` FROM %s
WHERE id_agente_modulo = %d',
'tagente_modulo',
$id_agent_module
);
$min_max = \db_get_row_sql($sql);
if ($min_max['min'] !== '0' || $min_max['max'] !== '0') {
$data[0]['min'] = $min_max['min'];
$data[0]['max'] = $min_max['max'];
} else {
// Search limits of the last two days.
$table = modules_get_table_data($id_agent_module);
$data = db_get_all_rows_sql(
'SELECT min(datos) as min, max(datos) as max
FROM '.$table.'
WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp >= '.$time_init
);
}
return $data;
}

File diff suppressed because it is too large Load Diff

View File

@ -281,6 +281,14 @@ final class Odometer extends Item
}
}
$sql = sprintf(
'SELECT min_warning, max_warning, min_critical, max_critical FROM %s
WHERE id_agente_modulo = %d',
'tagente_modulo',
$moduleId
);
$thresholds = \db_get_row_sql($sql);
if (\modules_get_unit($moduleId) === '%') {
$data['odometerType'] = 'percent';
} else {
@ -296,17 +304,25 @@ final class Odometer extends Item
}
$data['min_max_value'] = json_encode($minMax);
if ($thresholds['min_warning'] != 0 && $thresholds['min_warning'] > $minMax['max']) {
$thresholds['min_warning'] = $minMax['max'];
}
if ($thresholds['max_warning'] != 0 && $thresholds['max_warning'] > $minMax['max']) {
$thresholds['max_warning'] = $minMax['max'];
}
if ($thresholds['min_critical'] != 0 && $thresholds['min_critical'] > $minMax['max']) {
$thresholds['min_critical'] = $minMax['max'];
}
if ($thresholds['max_critical'] != 0 && $thresholds['max_critical'] > $minMax['max']) {
$thresholds['max_critical'] = $minMax['max'];
}
}
}
$sql = sprintf(
'SELECT min_warning, max_warning, min_critical, max_critical FROM %s
WHERE id_agente_modulo = %d',
'tagente_modulo',
$moduleId
);
$thresholds = \db_get_row_sql($sql);
$data['thresholds'] = json_encode($thresholds);
$data['status'] = \modules_get_color_status(modules_get_agentmodule_last_status($moduleId));
@ -323,53 +339,6 @@ final class Odometer extends Item
}
/**
* Insert or update an item in the database
*
* @param array $data Unknown input data structure.
*
* @return integer The modeled element data structure stored into the DB.
*
* @overrides Model::save.
*/
public function save(array $data=[]): int
{
if (empty($data) === false) {
if (empty($data['id']) === true) {
// Insert.
$save = static::encode($data);
$result = \db_process_sql_insert('tlayout_data', $save);
if ($result !== false) {
$item = static::fromDB(['id' => $result]);
$item->setData($item->toArray());
}
} else {
// Update.
$dataModelEncode = $this->encode($this->toArray());
$dataEncode = $this->encode($data);
$save = array_merge($dataModelEncode, $dataEncode);
$result = \db_process_sql_update(
'tlayout_data',
$save,
['id' => $save['id']]
);
// Invalidate the item's cache.
if ($result !== false && $result > 0) {
$item = static::fromDB(['id' => $save['id']]);
// Update the model.
if (empty($item) === false) {
$this->setData($item->toArray());
}
}
}
}
return $result;
}
/**
* Generates inputs for form (specific).
*

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.758';
$build = '211102';
$build = '211103';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.758
%define release 211102
%define release 211103
# 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.758
%define release 211102
%define release 211103
# 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.758
%define release 211102
%define release 211103
%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.758-211102
Version: 7.0NG.758-211103
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.758-211102"
pandora_version="7.0NG.758-211103"
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.758";
my $pandora_build = "211102";
my $pandora_build = "211103";
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.758";
my $pandora_build = "211102";
my $pandora_build = "211103";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.758
%define release 211102
%define release 211103
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.758
%define release 211102
%define release 211103
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.758 Build 211102";
my $version = "7.0NG.758 Build 211103";
# 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.758 Build 211102";
my $version = "7.0NG.758 Build 211103";
# save program name for logging
my $progname = basename($0);