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

This commit is contained in:
Daniel Barbero Martin 2021-04-30 08:28:17 +02:00
commit a20809b95d
29 changed files with 67 additions and 30 deletions

View File

@ -117,7 +117,7 @@ check_pre_pandora
check_repo_connection check_repo_connection
# Systemd # Systemd
execute_cmd "systemctl status" "Cheking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env plese check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8' execute_cmd "systemctl status" "Checking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env plese check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8'
# Check memomry greather or equal to 2G # Check memomry greather or equal to 2G
execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)' execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)'
@ -247,7 +247,15 @@ server_dependencies=" \
perl-Time-HiRes \ perl-Time-HiRes \
nfdump \ nfdump \
net-snmp-utils \ net-snmp-utils \
http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm" perl(NetAddr::IP) \
perl(Sys::Syslog) \
perl(DBI) \
perl(XML::Simple) \
perl(Geo::IP) \
perl(IO::Socket::INET6) \
perl(XML::Twig) \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
# SDK VMware perl dependencies # SDK VMware perl dependencies
@ -475,7 +483,7 @@ net.core.optmem_max = 81920
EO_KO EO_KO
execute_cmd "sysctl --system" "Applying Kernel optimization" [ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization"
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
chown pandora:apache /var/log/pandora chown pandora:apache /var/log/pandora

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.754-210429 Version: 7.0NG.754-210430
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.754-210429" pandora_version="7.0NG.754-210430"
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.754'; use constant AGENT_VERSION => '7.0NG.754';
use constant AGENT_BUILD => '210429'; use constant AGENT_BUILD => '210430';
# 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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
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.754" PI_VERSION="7.0NG.754"
PI_BUILD="210429" PI_BUILD="210430"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210429} {210430}
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.754(Build 210429)") #define PANDORA_VERSION ("7.0NG.754(Build 210430)")
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.754(Build 210429))" VALUE "ProductVersion", "(7.0NG.754(Build 210430))"
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.754-210429 Version: 7.0NG.754-210430
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.754-210429" pandora_version="7.0NG.754-210430"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

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

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.754'; $version = '7.0NG.754';
$build = '210429'; $build = '210430';
$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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
# 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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
# 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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
%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.754-210429 Version: 7.0NG.754-210430
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.754-210429" pandora_version="7.0NG.754-210430"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -473,6 +473,9 @@ log_window 3600
# Correlated Alerts, group cache ttl (in seconds). Set to 0 to disable. (PANDORA FMS ENTERPRISE ONLY). # Correlated Alerts, group cache ttl (in seconds). Set to 0 to disable. (PANDORA FMS ENTERPRISE ONLY).
#event_server_cache_ttl 10 #event_server_cache_ttl 10
# Log retrieving, items per request. (High values could make elasticsearch crash)
#elastic_query_size 10
# If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status. # If set to 1, an alert will not be fired if the last event it generated is in 'in-process' status.
event_inhibit_alerts 0 event_inhibit_alerts 0

View File

@ -45,7 +45,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.754"; my $pandora_version = "7.0NG.754";
my $pandora_build = "210429"; my $pandora_build = "210430";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash
@ -301,6 +301,7 @@ sub pandora_load_config {
$pa_config->{"eventserver"} = 1; # 4.0 $pa_config->{"eventserver"} = 1; # 4.0
$pa_config->{"event_window"} = 3600; # 4.0 $pa_config->{"event_window"} = 3600; # 4.0
$pa_config->{"log_window"} = 3600; # 7.741 $pa_config->{"log_window"} = 3600; # 7.741
$pa_config->{"elastic_query_size"} = 10; # 7.754 Elements per request (ELK)
$pa_config->{"event_server_cache_ttl"} = 10; # 7.754 $pa_config->{"event_server_cache_ttl"} = 10; # 7.754
$pa_config->{"preload_windows"} = 0; # 7.741 $pa_config->{"preload_windows"} = 0; # 7.741
$pa_config->{"icmpserver"} = 0; # 4.0 $pa_config->{"icmpserver"} = 0; # 4.0
@ -995,6 +996,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^log_window\s+([0-9]*)/i) { elsif ($parametro =~ m/^log_window\s+([0-9]*)/i) {
$pa_config->{'log_window'}= clean_blank($1); $pa_config->{'log_window'}= clean_blank($1);
} }
elsif ($parametro =~ m/^elastic_query_size\s+([0-9]*)/i) {
$pa_config->{'elastic_query_size'}= clean_blank($1);
}
elsif ($parametro =~ m/^preload_windows\s+([0-9]*)/i) { elsif ($parametro =~ m/^preload_windows\s+([0-9]*)/i) {
$pa_config->{'preload_windows'}= clean_blank($1); $pa_config->{'preload_windows'}= clean_blank($1);
} }

View File

@ -297,7 +297,10 @@ sub locate_agent {
# Locate agent first in tmetaconsole_agent # Locate agent first in tmetaconsole_agent
return undef if (! defined ($field) || $field eq ''); return undef if (! defined ($field) || $field eq '');
my $rs = enterprise_hook('get_metaconsole_agent_from_alias', [$dbh, $field, $relative]); my $rs = enterprise_hook('get_metaconsole_agent_from_id', [$dbh, $field]);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
$rs = enterprise_hook('get_metaconsole_agent_from_alias', [$dbh, $field, $relative]);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
$rs = enterprise_hook('get_metaconsole_agent_from_addr', [$dbh, $field, $relative]); $rs = enterprise_hook('get_metaconsole_agent_from_addr', [$dbh, $field, $relative]);
@ -322,7 +325,10 @@ sub get_agent {
return undef if (! defined ($field) || $field eq ''); return undef if (! defined ($field) || $field eq '');
my $rs = get_agent_from_alias($dbh, $field, $relative); my $rs = get_agent_from_id($dbh, $field);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
$rs = get_agent_from_alias($dbh, $field, $relative);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
$rs = get_agent_from_addr($dbh, $field); $rs = get_agent_from_addr($dbh, $field);
@ -378,6 +384,17 @@ sub get_agent_from_name ($$;$) {
return get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE tagente.nombre = ?', safe_input($name)); return get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE tagente.nombre = ?', safe_input($name));
} }
##########################################################################
# Return the agent given the agent id.
##########################################################################
sub get_agent_from_id ($$) {
my ($dbh, $id) = @_;
return undef if (! defined ($id) || $id eq '');
return get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE tagente.id_agente = ?', $id);
}
########################################################################## ##########################################################################
=head2 C<< pandora_generate_alerts (I<$pa_config> I<$data> I<$status> I<$agent> I<$module> I<$utimestamp> I<$dbh> I<$timestamp> I<$extra_macros> I<$last_data_value>) >> =head2 C<< pandora_generate_alerts (I<$pa_config> I<$data> I<$status> I<$agent> I<$module> I<$utimestamp> I<$dbh> I<$timestamp> I<$extra_macros> I<$last_data_value>) >>

View File

@ -280,6 +280,11 @@ sub process_xml_data ($$$$$) {
$timezone_offset = 0; $timezone_offset = 0;
} }
# If set by server, do not use offset.
if ($pa_config->{'use_xml_timestamp'} eq '0') {
$timezone_offset = 0;
}
# Parent Agent Name # Parent Agent Name
my $parent_id = 0; # Default value for unknown parent my $parent_id = 0; # Default value for unknown parent
my $parent_agent_name = $data->{'parent_agent_name'}; my $parent_agent_name = $data->{'parent_agent_name'};

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.754"; my $pandora_version = "7.0NG.754";
my $pandora_build = "210429"; my $pandora_build = "210430";
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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
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.754 %define version 7.0NG.754
%define release 210429 %define release 210430
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.754" PI_VERSION="7.0NG.754"
PI_BUILD="210429" PI_BUILD="210430"
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.754 PS210429"; my $version = "7.0NG.754 PS210430";
# 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.754 PS210429"; my $version = "7.0NG.754 PS210430";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);