Merge remote-tracking branch 'origin/develop' into 2615-Bug_Session_Timeout

This commit is contained in:
daniel 2018-11-21 16:52:20 +01:00
commit 322c76b5e1
26 changed files with 65 additions and 33 deletions

View File

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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.729'; use constant AGENT_VERSION => '7.0NG.729';
use constant AGENT_BUILD => '181120'; use constant AGENT_BUILD => '181121';
# 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.729 %define version 7.0NG.729
%define release 181120 %define release 181121
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.729 %define version 7.0NG.729
%define release 181120 %define release 181121
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.729" PI_VERSION="7.0NG.729"
PI_BUILD="181120" PI_BUILD="181121"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

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

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC181120'; $build_version = 'PC181121';
$pandora_version = 'v7.0NG.729'; $pandora_version = 'v7.0NG.729';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.729'; $version = '7.0NG.729';
$build = '181120'; $build = '181121';
$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.729 %define version 7.0NG.729
%define release 181120 %define release 181121
# 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.729 %define version 7.0NG.729
%define release 181120 %define release 181121
%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.729-181120 Version: 7.0NG.729-181121
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.729-181120" pandora_version="7.0NG.729-181121"
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.729"; my $pandora_version = "7.0NG.729";
my $pandora_build = "181120"; my $pandora_build = "181121";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -111,6 +111,7 @@ use warnings;
use DBI; use DBI;
use Encode; use Encode;
use Encode::CN;
use XML::Simple; use XML::Simple;
use HTML::Entities; use HTML::Entities;
use Time::Local; use Time::Local;

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.729"; my $pandora_version = "7.0NG.729";
my $pandora_build = "181120"; my $pandora_build = "181121";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -68,6 +68,7 @@ our @EXPORT = qw(
PROVISIONINGSERVER PROVISIONINGSERVER
MIGRATIONSERVER MIGRATIONSERVER
METACONSOLE_LICENSE METACONSOLE_LICENSE
OFFLINE_LICENSE
$DEVNULL $DEVNULL
$OS $OS
$OS_VERSION $OS_VERSION
@ -93,6 +94,7 @@ our @EXPORT = qw(
sqlWrap sqlWrap
is_numeric is_numeric
is_metaconsole is_metaconsole
is_offline
to_number to_number
clean_blank clean_blank
pandora_sendmail pandora_sendmail
@ -152,9 +154,12 @@ use constant MODULE_WARNING => 2;
use constant MODULE_UNKNOWN => 3; use constant MODULE_UNKNOWN => 3;
use constant MODULE_NOTINIT => 4; use constant MODULE_NOTINIT => 4;
# Value for a metaconsole license type # Mask for a metaconsole license type
use constant METACONSOLE_LICENSE => 0x01; use constant METACONSOLE_LICENSE => 0x01;
# Mask for an offline license type
use constant OFFLINE_LICENSE => 0x02;
# Alert modes # Alert modes
use constant RECOVERED_ALERT => 0; use constant RECOVERED_ALERT => 0;
use constant FIRED_ALERT => 1; use constant FIRED_ALERT => 1;
@ -1639,7 +1644,7 @@ sub is_metaconsole ($) {
my ($pa_config) = @_; my ($pa_config) = @_;
if (defined($pa_config->{"license_type"}) && if (defined($pa_config->{"license_type"}) &&
$pa_config->{"license_type"} == METACONSOLE_LICENSE && ($pa_config->{"license_type"} & METACONSOLE_LICENSE) &&
$pa_config->{"node_metaconsole"} == 0) { $pa_config->{"node_metaconsole"} == 0) {
return 1; return 1;
} }
@ -1647,6 +1652,20 @@ sub is_metaconsole ($) {
return 0; return 0;
} }
###############################################################################
# Returns 1 if a valid offline license is configured, 0 otherwise.
###############################################################################
sub is_offline ($) {
my ($pa_config) = @_;
if (defined($pa_config->{"license_type"}) &&
($pa_config->{"license_type"} & OFFLINE_LICENSE)) {
return 1;
}
return 0;
}
############################################################################### ###############################################################################
# Check if a given variable contents a number # Check if a given variable contents a number
############################################################################### ###############################################################################

View File

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

View File

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

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.729 PS181120"; my $version = "7.0NG.729 PS181121";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -1042,8 +1042,20 @@ else {
# Connect to the DB # Connect to the DB
my $dbh = db_connect ($conf{'dbengine'}, $conf{'dbname'}, $conf{'dbhost'}, $conf{'dbport'}, $conf{'dbuser'}, $conf{'dbpass'}); my $dbh = db_connect ($conf{'dbengine'}, $conf{'dbname'}, $conf{'dbhost'}, $conf{'dbport'}, $conf{'dbuser'}, $conf{'dbpass'});
my $history_dbh = ($conf{'_history_db_enabled'} eq '1') ? db_connect ($conf{'dbengine'}, $conf{'_history_db_name'}, my $history_dbh = undef;
$conf{'_history_db_host'}, $conf{'_history_db_port'}, $conf{'_history_db_user'}, $conf{'_history_db_pass'}) : undef; is_metaconsole(\%conf);
if ($conf{'_history_db_enabled'} eq '1') {
eval {
$history_dbh = db_connect ($conf{'dbengine'}, $conf{'_history_db_name'}, $conf{'_history_db_host'}, $conf{'_history_db_port'}, $conf{'_history_db_user'}, $conf{'_history_db_pass'});
};
if ($@) {
if (is_offline(\%conf)) {
log_message ('!', "Cannot connect to the history database. Skipping.");
} else {
die ("$@\n");
}
}
}
# Get a lock # Get a lock
my $lock = db_get_lock ($dbh, 'pandora_db'); my $lock = db_get_lock ($dbh, 'pandora_db');
@ -1055,13 +1067,13 @@ if ($lock == 0 && $conf{'_force'} == 0) {
# Main # Main
pandoradb_main(\%conf, $dbh, $history_dbh); pandoradb_main(\%conf, $dbh, $history_dbh);
# Cleanup and exit
db_disconnect ($history_dbh) if defined ($history_dbh);
db_disconnect ($dbh);
# Release the lock # Release the lock
if ($lock == 1) { if ($lock == 1) {
db_release_lock ($dbh, 'pandora_db'); db_release_lock ($dbh, 'pandora_db');
} }
exit 0; # Cleanup and exit
db_disconnect ($history_dbh) if defined ($history_dbh);
db_disconnect ($dbh);
exit 0;

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.729 PS181120"; my $version = "7.0NG.729 PS181121";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);