Merge remote-tracking branch 'origin/develop' into new-vc-line-element

This commit is contained in:
Daniel Barbero Martin 2020-01-07 08:02:20 +01:00
commit 04d39a0f70
30 changed files with 37 additions and 35 deletions

View File

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

@ -55,7 +55,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.742'; use constant AGENT_VERSION => '7.0NG.742';
use constant AGENT_BUILD => '200102'; use constant AGENT_BUILD => '200107';
# 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;
@ -2882,7 +2882,7 @@ sub cron_valid_date {
my $utime; my $utime;
eval { eval {
local $SIG{__DIE__} = sub {}; local $SIG{__DIE__} = sub {};
$utime = timelocal(0, $min, $hour, $mday, $month, $year); $utime = strftime("%s", 0, $min, $hour, $mday, $month, $year);
}; };
if ($@) { if ($@) {
return 0; return 0;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.742 %define version 7.0NG.742
%define release 200102 %define release 200107
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.742 %define version 7.0NG.742
%define release 200102 %define release 200107
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.742" PI_VERSION="7.0NG.742"
PI_BUILD="200102" PI_BUILD="200107"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{200102} {200107}
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.742(Build 200102)") #define PANDORA_VERSION ("7.0NG.742(Build 200107)")
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.742(Build 200102))" VALUE "ProductVersion", "(7.0NG.742(Build 200107))"
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.742-200102 Version: 7.0NG.742-200107
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.742-200102" pandora_version="7.0NG.742-200107"
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 = 'PC200102'; $build_version = 'PC200107';
$pandora_version = 'v7.0NG.742'; $pandora_version = 'v7.0NG.742';
// 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.742'; $version = '7.0NG.742';
$build = '200102'; $build = '200107';
$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.742 %define version 7.0NG.742
%define release 200102 %define release 200107
# 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.742 %define version 7.0NG.742
%define release 200102 %define release 200107
# 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.742 %define version 7.0NG.742
%define release 200102 %define release 200107
%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.742-200102 Version: 7.0NG.742-200107
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.742-200102" pandora_version="7.0NG.742-200107"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

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.742"; my $pandora_version = "7.0NG.742";
my $pandora_build = "200102"; my $pandora_build = "200107";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -1660,7 +1660,9 @@ sub pandora_process_module ($$$$$$$$$;$) {
pandora_update_module_on_error ($pa_config, $module, $dbh); pandora_update_module_on_error ($pa_config, $module, $dbh);
return; return;
} }
my $last_try = ($1 == 0) ? 0 : timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900);
my $last_try = ($1 == 0) ? 0 : strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900);
my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0; my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0;
# Received stale data. Save module data if needed and return. # Received stale data. Save module data if needed and return.
@ -3823,7 +3825,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
# Check time threshold # Check time threshold
$alert->{'last_fired'} = '1970-01-01 00:00:00' unless defined ($alert->{'last_fired'}); $alert->{'last_fired'} = '1970-01-01 00:00:00' unless defined ($alert->{'last_fired'});
return unless ($alert->{'last_fired'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); return unless ($alert->{'last_fired'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
my $last_fired = ($1 > 0) ? timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900) : 0; my $last_fired = ($1 > 0) ? strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900) : 0;
my $utimestamp = time (); my $utimestamp = time ();
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime($utimestamp)); my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime($utimestamp));

View File

@ -309,7 +309,7 @@ sub process_xml_data ($$$$$) {
my $utimestamp = 0; my $utimestamp = 0;
eval { eval {
if ($timestamp =~ /(\d+)[\/|\-](\d+)[\/|\-](\d+) +(\d+):(\d+):(\d+)/) { if ($timestamp =~ /(\d+)[\/|\-](\d+)[\/|\-](\d+) +(\d+):(\d+):(\d+)/) {
$utimestamp = timelocal($6, $5, $4, $3, $2 -1 , $1 - 1900); $utimestamp = strftime("%s", $6, $5, $4, $3, $2 -1 , $1 - 1900);
} }
}; };
@ -837,7 +837,7 @@ sub process_module_data ($$$$$$$$$$) {
} }
my $utimestamp; my $utimestamp;
eval { eval {
$utimestamp = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); $utimestamp = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900);
}; };
if ($@) { if ($@) {
logger($pa_config, "Invalid timestamp '$timestamp' from module '$module_name' agent '$agent_name'.", 3); logger($pa_config, "Invalid timestamp '$timestamp' from module '$module_name' agent '$agent_name'.", 3);

View File

@ -32,7 +32,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.742"; my $pandora_version = "7.0NG.742";
my $pandora_build = "200102"; my $pandora_build = "200107";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -2382,7 +2382,7 @@ sub get_unix_time {
eval { eval {
use Time::Local; use Time::Local;
my ($mday,$mon,$year,$hour,$min,$sec) = split(/[\s$separator_dates$separator_hours]+/, $str_time); my ($mday,$mon,$year,$hour,$min,$sec) = split(/[\s$separator_dates$separator_hours]+/, $str_time);
$time = timelocal($sec,$min,$hour,$mday,$mon-1,$year); $time = strftime("%s", $sec,$min,$hour,$mday,$mon-1,$year);
}; };
if ($@) { if ($@) {
return 0; return 0;

View File

@ -1734,7 +1734,7 @@ sub cron_valid_date {
my $utime; my $utime;
eval { eval {
local $SIG{__DIE__} = sub {}; local $SIG{__DIE__} = sub {};
$utime = timelocal(0, $min, $hour, $mday, $month, $year); $utime = strftime("%s", 0, $min, $hour, $mday, $month, $year);
}; };
if ($@) { if ($@) {
return 0; return 0;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.742 %define version 7.0NG.742
%define release 200102 %define release 200107
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.742 %define version 7.0NG.742
%define release 200102 %define release 200107
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

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

View File

@ -216,7 +216,7 @@ sub process_module_data ($$$$$$$$$) {
$timestamp !~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/) { $timestamp !~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/) {
} }
my $utimestamp; my $utimestamp;
$utimestamp = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); $utimestamp = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900);
my %data_object; my %data_object;

View File

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

View File

@ -112,13 +112,13 @@ sub generate_xml_files ($$$$$$) {
my $time_from = get_conf_token ($conf, 'time_from', $time_now); my $time_from = get_conf_token ($conf, 'time_from', $time_now);
die ("[error] Invalid time_from: $time_from\n\n") die ("[error] Invalid time_from: $time_from\n\n")
unless ($time_from =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); unless ($time_from =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
my $utimestamp_from = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); my $utimestamp_from = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900);
# Get time_to # Get time_to
my $time_to = get_conf_token ($conf, 'time_to', $time_now); my $time_to = get_conf_token ($conf, 'time_to', $time_now);
die ("[error] Invalid time_to: $time_to\n\n") die ("[error] Invalid time_to: $time_to\n\n")
unless ($time_to =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/); unless ($time_to =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
my $utimestamp_to = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); my $utimestamp_to = strftime("%s", $6, $5, $4, $3, $2 - 1, $1 - 1900);
my %modules_src_pointers = init_src_pointers($modules); my %modules_src_pointers = init_src_pointers($modules);