Merge remote-tracking branch 'origin/develop' into ent-3013-ipam-modo-configuracion-de-vlan
Conflicts: pandora_server/lib/PandoraFMS/DataServer.pm Former-commit-id: 87b7d3a7591ed181be022b786deba8f090e43d49
This commit is contained in:
commit
4236b55694
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.730-190121
|
||||
Version: 7.0NG.730-190122
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.730-190121"
|
||||
pandora_version="7.0NG.730-190122"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.730';
|
||||
use constant AGENT_BUILD => '190121';
|
||||
use constant AGENT_BUILD => '190122';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.730"
|
||||
PI_BUILD="190121"
|
||||
PI_BUILD="190122"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190121}
|
||||
{190122}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.730(Build 190121)")
|
||||
#define PANDORA_VERSION ("7.0NG.730(Build 190122)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.730(Build 190121))"
|
||||
VALUE "ProductVersion", "(7.0NG.730(Build 190122))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.730-190121
|
||||
Version: 7.0NG.730-190122
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.730-190121"
|
||||
pandora_version="7.0NG.730-190122"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1868,3 +1868,17 @@ CREATE TABLE IF NOT EXISTS `tgis_map_layer_groups` (
|
|||
FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE,
|
||||
FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_matrix`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`source` varchar(60) default '',
|
||||
`destination` varchar(60) default '',
|
||||
`utimestamp` bigint(20) default 0,
|
||||
`bytes` int(18) unsigned default 0,
|
||||
`pkts` int(18) unsigned default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`source`, `destination`, `utimestamp`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190121';
|
||||
$build_version = 'PC190122';
|
||||
$pandora_version = 'v7.0NG.730';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.730';
|
||||
$build = '190121';
|
||||
$build = '190122';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -3378,3 +3378,17 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
|
|||
`group_search` int(10) unsigned default '0',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_matrix`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`source` varchar(60) default '',
|
||||
`destination` varchar(60) default '',
|
||||
`utimestamp` bigint(20) default 0,
|
||||
`bytes` int(18) unsigned default 0,
|
||||
`pkts` int(18) unsigned default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`source`, `destination`, `utimestamp`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.730-190121
|
||||
Version: 7.0NG.730-190122
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.730-190121"
|
||||
pandora_version="7.0NG.730-190122"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.730";
|
||||
my $pandora_build = "190121";
|
||||
my $pandora_build = "190122";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -29,6 +29,8 @@ use XML::Parser::Expat;
|
|||
use XML::Simple;
|
||||
use POSIX qw(setsid strftime);
|
||||
use IO::Uncompress::Unzip;
|
||||
use JSON qw(decode_json);
|
||||
use MIME::Base64;
|
||||
|
||||
# For Reverse Geocoding
|
||||
use LWP::Simple;
|
||||
|
@ -217,6 +219,10 @@ sub data_consumer ($$) {
|
|||
process_xml_server ($self->getConfig (), $file_name, $xml_data, $self->getDBH ());
|
||||
} elsif (defined($xml_data->{'connection_source'})) {
|
||||
enterprise_hook('process_xml_connections', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]);
|
||||
} elsif (defined($xml_data->{'network_matrix'})){
|
||||
process_xml_matrix_network(
|
||||
$self->getConfig(), $xml_data, $self->getDBH()
|
||||
);
|
||||
} else {
|
||||
process_xml_data ($self->getConfig (), $file_name, $xml_data, $self->getServerID (), $self->getDBH ());
|
||||
}
|
||||
|
@ -321,6 +327,7 @@ sub process_xml_data ($$$$$) {
|
|||
|
||||
# Get agent id
|
||||
my $agent_id = get_agent_id ($dbh, $agent_name);
|
||||
my $group_id = 0;
|
||||
if ($agent_id < 1) {
|
||||
if ($pa_config->{'autocreate'} == 0) {
|
||||
logger($pa_config, "ERROR: There is no agent defined with name $agent_name", 3);
|
||||
|
@ -329,7 +336,7 @@ sub process_xml_data ($$$$$) {
|
|||
|
||||
# Get OS, group and description
|
||||
my $os = pandora_get_os ($dbh, $data->{'os_name'});
|
||||
my $group_id = $pa_config->{'autocreate_group'};
|
||||
$group_id = $pa_config->{'autocreate_group'};
|
||||
if (! defined (get_group_name ($dbh, $group_id))) {
|
||||
if (defined ($data->{'group_id'}) && $data->{'group_id'} ne '') {
|
||||
$group_id = $data->{'group_id'};
|
||||
|
@ -965,5 +972,85 @@ sub unlink_modules {
|
|||
db_do($dbh, "UPDATE tagente_modulo SET parent_module_id = 0 WHERE id_agente_modulo = ?", $child_id);
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Process events in the XML.
|
||||
##########################################################################
|
||||
sub process_events_dataserver {
|
||||
my ($pa_config, $data, $agent_id, $group_id, $dbh) = @_;
|
||||
|
||||
return unless defined($data->{'events'});
|
||||
|
||||
foreach my $event (@{$data->{'events'}}) {
|
||||
next unless defined($event->{'event'}) && defined($event->{'event'}->[0]);
|
||||
my $event_info_encoded = $event->{'event'}->[0];
|
||||
|
||||
# Try to decode the base64 inside
|
||||
my $event_info;
|
||||
eval {
|
||||
$event_info = decode_json(decode_base64($event_info_encoded));
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
logger($pa_config, "Error processing base64 event data '$event_info_encoded'.", 5);
|
||||
next;
|
||||
}
|
||||
next unless defined($event_info->{'data'});
|
||||
|
||||
pandora_event(
|
||||
$pa_config,
|
||||
$event_info->{'data'},
|
||||
$group_id,
|
||||
$agent_id,
|
||||
defined($event_info->{'severity'}) ? $event_info->{'severity'} : 0,
|
||||
0,
|
||||
0,
|
||||
'system',
|
||||
0,
|
||||
$dbh
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Process events in the XML.
|
||||
##########################################################################
|
||||
sub process_xml_matrix_network {
|
||||
my ($pa_config, $data, $dbh) = @_;
|
||||
|
||||
my $utimestamp = $data->{'network_matrix'}->[0]->{'utimestamp'};
|
||||
my $content = $data->{'network_matrix'}->[0]->{'content'};
|
||||
return unless defined($utimestamp) && defined($content);
|
||||
|
||||
# Try to decode the base64 inside
|
||||
my $matrix_info;
|
||||
eval {
|
||||
$matrix_info = decode_json(decode_base64($content));
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
logger($pa_config, "Error processing base64 matrix data '$content'.", 5);
|
||||
return;
|
||||
}
|
||||
foreach my $source (keys %$matrix_info) {
|
||||
foreach my $destination (keys %{$matrix_info->{$source}}) {
|
||||
my $matrix_single_data = $matrix_info->{$source}->{$destination};
|
||||
$matrix_single_data->{'source'} = $source;
|
||||
$matrix_single_data->{'destination'} = $destination;
|
||||
$matrix_single_data->{'utimestamp'} = $utimestamp;
|
||||
eval {
|
||||
db_process_insert($dbh, 'id', 'tnetwork_matrix', $matrix_single_data);
|
||||
};
|
||||
if ($@) {
|
||||
logger($pa_config, "Error inserted matrix data. Source: $source, destination: $destination, utimestamp: $utimestamp.", 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.730";
|
||||
my $pandora_build = "190121";
|
||||
my $pandora_build = "190122";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.730
|
||||
%define release 190121
|
||||
%define release 190122
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.730"
|
||||
PI_BUILD="190121"
|
||||
PI_BUILD="190122"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.730 PS190121";
|
||||
my $version = "7.0NG.730 PS190122";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.730 PS190121";
|
||||
my $version = "7.0NG.730 PS190122";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue