Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center

This commit is contained in:
fbsanchez 2021-06-28 10:13:51 +02:00
commit 771c51ef5d
30 changed files with 70 additions and 31 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.755-210625 Version: 7.0NG.755-210628
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.755-210625" pandora_version="7.0NG.755-210628"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.755" PI_VERSION="7.0NG.755"
PI_BUILD="210625" PI_BUILD="210628"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210625} {210628}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.755 Build 210625") #define PANDORA_VERSION ("7.0NG.755 Build 210628")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.755-210625 Version: 7.0NG.755-210628
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.755-210625" pandora_version="7.0NG.755-210628"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1172,7 +1172,7 @@ class AgentWizard extends HTML
[ [
'arguments' => [ 'arguments' => [
'type' => 'hidden', 'type' => 'hidden',
'value' => json_encode($candidateModules), 'value' => htmlspecialchars(json_encode($candidateModules)),
'return' => true, 'return' => true,
'name' => 'modules-definition', 'name' => 'modules-definition',
], ],

View File

@ -160,6 +160,21 @@ class Tree
} }
/**
* Show disabled modules
*
* @return string Sql disabled.
*/
protected function getDisabledFilter()
{
if (empty($this->filter['showDisabled'])) {
return ' tam.disabled = 0 AND ta.disabled = 0';
}
return ' 1 = 1';
}
protected function getAgentStatusFilter($status=self::TV_DEFAULT_AGENT_STATUS) protected function getAgentStatusFilter($status=self::TV_DEFAULT_AGENT_STATUS)
{ {
if ($status == self::TV_DEFAULT_AGENT_STATUS) { if ($status == self::TV_DEFAULT_AGENT_STATUS) {
@ -1094,6 +1109,7 @@ class Tree
$agent_filter = 'AND ta.id_agente = '.$this->id; $agent_filter = 'AND ta.id_agente = '.$this->id;
$tag_condition = $this->getTagCondition(); $tag_condition = $this->getTagCondition();
$tag_join = empty($tag_condition) && (!$this->L3forceTagCondition) ? '' : $this->getTagJoin(); $tag_join = empty($tag_condition) && (!$this->L3forceTagCondition) ? '' : $this->getTagJoin();
$show_disabled = $this->getDisabledFilter();
if ($this->avoid_condition === true) { if ($this->avoid_condition === true) {
$condition = ''; $condition = '';
@ -1107,6 +1123,10 @@ class Tree
tam.id_tipo_modulo, tam.id_modulo, tae.estado, tae.datos, tam.id_tipo_modulo, tam.id_modulo, tae.estado, tae.datos,
tam.parent_module_id AS parent, tatm.id AS alerts, tam.unit'; tam.parent_module_id AS parent, tatm.id AS alerts, tam.unit';
if ($show_disabled) {
$columns .= ', tam.disabled';
}
$sql = "SELECT $columns $sql = "SELECT $columns
FROM tagente_modulo tam FROM tagente_modulo tam
$tag_join $tag_join
@ -1119,7 +1139,8 @@ class Tree
LEFT JOIN talert_template_modules tatm LEFT JOIN talert_template_modules tatm
ON tatm.id_agent_module = tam.id_agente_modulo ON tatm.id_agent_module = tam.id_agente_modulo
$inner $inner
WHERE tam.disabled = 0 AND ta.disabled = 0 WHERE
$show_disabled
$condition $condition
$agent_filter $agent_filter
$group_acl $group_acl

View File

@ -180,6 +180,7 @@ class TreeService extends Tree
} else if ($this->type == 'services') { } else if ($this->type == 'services') {
$this->getSecondLevel(); $this->getSecondLevel();
} else if ($this->type == 'agent') { } else if ($this->type == 'agent') {
$this->filter['showDisabled'] = true;
$this->getThirdLevel(); $this->getThirdLevel();
} }
@ -433,6 +434,7 @@ class TreeService extends Tree
$tmp['showEventsBtn'] = 1; $tmp['showEventsBtn'] = 1;
$tmp['eventAgent'] = $item->agent()->id_agente(); $tmp['eventAgent'] = $item->agent()->id_agente();
$tmp['disabled'] = (bool) $item->agent()->disabled();
break; break;
case SERVICE_ELEMENT_MODULE: case SERVICE_ELEMENT_MODULE:
@ -495,6 +497,7 @@ class TreeService extends Tree
$tmp['showGraphs'] = 1; $tmp['showGraphs'] = 1;
$tmp['showEventsBtn'] = 1; $tmp['showEventsBtn'] = 1;
$tmp['eventAgent'] = $item->module()->id_agente(); $tmp['eventAgent'] = $item->module()->id_agente();
$tmp['disabled'] = $item->module()->disabled();
$html = '<img src="'; $html = '<img src="';
$html .= ui_get_full_url( $html .= ui_get_full_url(
@ -524,6 +527,7 @@ class TreeService extends Tree
$tmp['alias'] = $item->service()->name(); $tmp['alias'] = $item->service()->name();
$tmp['description'] = $item->service()->description(); $tmp['description'] = $item->service()->description();
$tmp['elementDescription'] = $item->description(); $tmp['elementDescription'] = $item->description();
$tmp['disabled'] = $item->service()->disabled();
if ($this->connectedToNode === false if ($this->connectedToNode === false
&& is_metaconsole() === true && is_metaconsole() === true

View File

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

View File

@ -508,6 +508,11 @@ var TreeController = {
// Content // Content
$content.addClass("node-content"); $content.addClass("node-content");
var disabled = false;
if (element.disabled == true) {
disabled = true;
$content.addClass("disabled");
}
switch (element.type) { switch (element.type) {
case "group": case "group":
if ( if (
@ -956,7 +961,10 @@ var TreeController = {
} }
} }
// If exist the detail container, show the data // If exist the detail container, show the data
if (typeof controller.detailRecipient !== "undefined") { if (
typeof controller.detailRecipient !== "undefined" &&
disabled == false
) {
if (element.type == "agent" || element.type == "module") { if (element.type == "agent" || element.type == "module") {
$content $content
.click(function(e) { .click(function(e) {
@ -990,7 +998,8 @@ var TreeController = {
if ( if (
typeof element.children != "undefined" && typeof element.children != "undefined" &&
element.children.length > 0 element.children.length > 0 &&
element.disabled == false
) { ) {
$node.removeClass("leaf-empty").addClass("leaf-closed"); $node.removeClass("leaf-empty").addClass("leaf-closed");
@ -1027,8 +1036,9 @@ var TreeController = {
element.searchChildren element.searchChildren
) { ) {
if ( if (
element.rootType == "group_edition" && (element.rootType == "group_edition" &&
typeof element.children == "undefined" typeof element.children == "undefined") ||
element.disabled == true
) { ) {
$node.addClass("leaf-empty"); $node.addClass("leaf-empty");
} else { } else {

View File

@ -179,3 +179,7 @@ div#tree-controller-recipient {
.tree-node > .node-content > div + div:not(.tree-node-counters) { .tree-node > .node-content > div + div:not(.tree-node-counters) {
margin-left: 3px; margin-left: 3px;
} }
.tree-node .disabled {
filter: opacity(0.3);
}

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.755 %define version 7.0NG.755
%define release 210625 %define release 210628
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.755 %define version 7.0NG.755
%define release 210625 %define release 210628
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.755-210625 Version: 7.0NG.755-210628
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.755-210625" pandora_version="7.0NG.755-210628"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.755 Build 210625"; my $version = "7.0NG.755 Build 210628";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.755 Build 210625"; my $version = "7.0NG.755 Build 210628";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);