Merge remote-tracking branch 'origin/develop' into ent-8676-consolas-visuales-en-consola-movil

This commit is contained in:
Daniel Barbero Martin 2022-03-21 09:06:44 +01:00
commit 0342f2a908
35 changed files with 92 additions and 38 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.760-220318
Version: 7.0NG.760-220321
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.760-220318"
pandora_version="7.0NG.760-220321"
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.760';
use constant AGENT_BUILD => '220318';
use constant AGENT_BUILD => '220321';
# 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.760
%define release 220318
%define release 220321
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.760"
PI_BUILD="220318"
PI_BUILD="220321"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220318}
{220321}
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.760 Build 220318")
#define PANDORA_VERSION ("7.0NG.760 Build 220321")
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.760(Build 220318))"
VALUE "ProductVersion", "(7.0NG.760(Build 220321))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -1,5 +1,7 @@
START TRANSACTION;
ALTER TABLE `tipam_vlan` ADD COLUMN `custom_id` bigint(20) unsigned DEFAULT NULL;
UPDATE `tuser_task` SET `parameters` = 'a:3:{i:0;a:2:{s:11:"description";s:11:"Description";s:4:"type";s:4:"text";}i:1;a:3:{s:11:"description";s:20:"Save to disk in path";s:4:"type";s:6:"string";s:13:"default_value";s:21:"_%_ATTACHMENT_PATH_%_";}i:2;a:3:{s:11:"description";s:14:"Active backups";s:4:"type";s:6:"number";s:13:"default_value";i:3;}}' WHERE `function_name` = 'cron_task_do_backup';
CREATE TABLE IF NOT EXISTS `tbackup` (
@ -14,4 +16,4 @@ CREATE TABLE IF NOT EXISTS `tbackup` (
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
COMMIT;
COMMIT;

View File

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

View File

@ -4166,11 +4166,24 @@ function events_get_response_target(
}
// Parse the event custom data.
if (!empty($event['custom_data'])) {
if (empty($event['custom_data']) === false) {
$custom_data = json_decode(base64_decode($event['custom_data']));
foreach ($custom_data as $key => $value) {
$target = str_replace('_customdata_'.$key.'_', $value, $target);
}
if (strpos($target, '_customdata_json_') !== false) {
$target = str_replace('_customdata_json_', json_encode($custom_data), $target);
}
if (strpos($target, '_customdata_text_') !== false) {
$text = '';
foreach ($custom_data as $key => $value) {
$text .= $key.': '.$value.PHP_EOL;
}
$target = str_replace('_customdata_text_', $text, $target);
}
}
// This will replace the macro with the current logged user.

View File

@ -4139,7 +4139,7 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
if ($critical_percentage >= $status_data['linked_layout_status_as_service_critical'] && $critical_percentage !== 0) {
return VISUAL_MAP_STATUS_CRITICAL_BAD;
} else if ($critical_percentage >= $status_data['linked_layout_status_as_service_warning'] && $warning_percentage !== 0) {
} else if ($warning_percentage >= $status_data['linked_layout_status_as_service_warning'] && $warning_percentage !== 0) {
return VISUAL_MAP_STATUS_WARNING;
} else {
return VISUAL_MAP_STATUS_NORMAL;

View File

@ -399,7 +399,10 @@ class ModuleIconWidget extends Widget
'class' => 'flex-row flex-end w100p',
'direct' => 1,
'block_content' => [
['label' => $image],
[
'label' => $image,
'arguments' => ['type' => 'image-item'],
],
],
];

View File

@ -389,7 +389,10 @@ class ModuleStatusWidget extends Widget
'class' => 'flex-row flex-end w100p',
'direct' => 1,
'block_content' => [
['label' => $image],
[
'label' => $image,
'arguments' => ['type' => 'image-item'],
],
],
];

View File

@ -537,7 +537,10 @@ final class Group extends Item
'class' => 'flex-row flex-end w100p',
'direct' => 1,
'block_content' => [
['label' => $images],
[
'label' => $images,
'arguments' => ['type' => 'image-item'],
],
],
];

View File

@ -190,7 +190,10 @@ final class Icon extends Item
'class' => 'flex-row flex-end w100p',
'direct' => 1,
'block_content' => [
['label' => $images],
[
'label' => $images,
'arguments' => ['type' => 'image-item'],
],
],
];

View File

@ -351,7 +351,10 @@ final class StaticGraph extends Item
'class' => 'flex-row flex-end w100p',
'direct' => 1,
'block_content' => [
['label' => $images],
[
'label' => $images,
'arguments' => ['type' => 'image-item'],
],
],
];

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.760
%define release 220318
%define release 220321
# 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.760
%define release 220318
%define release 220321
# 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.760
%define release 220318
%define release 220321
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -4039,6 +4039,7 @@ CREATE TABLE IF NOT EXISTS `tipam_vlan` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(250) NOT NULL,
`description` TEXT,
`custom_id` bigint(20) UNSIGNED DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.760-220318
Version: 7.0NG.760-220321
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.760-220318"
pandora_version="7.0NG.760-220321"
package_cpan=0
package_pandora=1

View File

@ -66,8 +66,8 @@ sub new ($$$) {
# Call the constructor of the parent class
my $self = $class->SUPER::new($config, ALERTSERVER, \&PandoraFMS::AlertServer::data_producer, \&PandoraFMS::AlertServer::data_consumer, $dbh);
bless $self, $class;
return $self;
bless $self, $class;
return $self;
}
################################################################################
@ -91,6 +91,24 @@ sub data_producer ($) {
my @tasks;
my @rows;
my $n_servers = get_db_value($dbh,
'SELECT COUNT(*) FROM `tserver` WHERE `server_type` = ? AND `status` = 1',
ALERTSERVER
);
my $i = 0;
my %servers = map { $_->{'name'} => $i++; } get_db_rows($dbh,
'SELECT `name` FROM `tserver` WHERE `server_type` = ? AND `status` = 1 ORDER BY `name` ASC',
ALERTSERVER
);
if ($n_servers eq 0) {
$n_servers = 1;
}
# Retrieve alerts to be evaluated.
my $server_type_id = $servers{$pa_config->{'servername'}};
# Make a local copy of locked alerts.
$AlertSem->down ();
@ -98,9 +116,14 @@ sub data_producer ($) {
$AlertSem->up ();
# Check the execution queue.
if (pandora_is_master($pa_config) == 1) {
@rows = get_db_rows ($dbh, 'SELECT id, utimestamp FROM talert_execution_queue ORDER BY utimestamp ASC');
}
my $sql = sprintf(
'SELECT id, utimestamp FROM talert_execution_queue
WHERE `id` %% %d = %d ORDER BY utimestamp ASC',
$n_servers,
$server_type_id
);
@rows = get_db_rows($dbh, $sql);
# Queue alerts.
foreach my $row (@rows) {

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.760";
my $pandora_build = "220318";
my $pandora_build = "220321";
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.760";
my $pandora_build = "220318";
my $pandora_build = "220321";
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.760
%define release 220318
%define release 220321
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.760"
PI_BUILD="220318"
PI_BUILD="220321"
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.760 Build 220318";
my $version = "7.0NG.760 Build 220321";
# 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.760 Build 220318";
my $version = "7.0NG.760 Build 220321";
# save program name for logging
my $progname = basename($0);