diff --git a/extras/docker/build_and_push.sh b/extras/docker/build_and_push.sh
index 91e6fa15e5..c58a73bf8e 100755
--- a/extras/docker/build_and_push.sh
+++ b/extras/docker/build_and_push.sh
@@ -1,3 +1,4 @@
#!/bin/bash
docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \
+[ "$QA_ENV" == "" ] && \
docker push pandorafms/pandorafms:7
diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf
index fbea6eb404..f3657d3a7a 100644
--- a/pandora_agents/pc/AIX/pandora_agent.conf
+++ b/pandora_agents/pc/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, AIX version
+# Version 7.0NG.740, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf
index ded3ec4b9c..95fd1090ad 100644
--- a/pandora_agents/pc/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, FreeBSD Version
+# Version 7.0NG.740, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf
index 0d3e20d05e..04122feb30 100644
--- a/pandora_agents/pc/HP-UX/pandora_agent.conf
+++ b/pandora_agents/pc/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, HP-UX Version
+# Version 7.0NG.740, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf
index 5d951d984d..b083e7f3aa 100644
--- a/pandora_agents/pc/Linux/pandora_agent.conf
+++ b/pandora_agents/pc/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf
index 1c73d12fc9..4bb88c5b4e 100644
--- a/pandora_agents/pc/NT4/pandora_agent.conf
+++ b/pandora_agents/pc/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf
index fc59e308e4..a90b7227ca 100644
--- a/pandora_agents/pc/SunOS/pandora_agent.conf
+++ b/pandora_agents/pc/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, Solaris Version
+# Version 7.0NG.740, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf
index f12cb5089c..d750898b70 100644
--- a/pandora_agents/pc/Win32/pandora_agent.conf
+++ b/pandora_agents/pc/Win32/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
-# Version 7.0NG.738
+# Version 7.0NG.740
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf
index 863ab92907..6a663d6331 100644
--- a/pandora_agents/shellscript/aix/pandora_agent.conf
+++ b/pandora_agents/shellscript/aix/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.738, AIX version
+# Version 7.0NG.740, AIX version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
index f56402fbcc..99e4c62462 100644
--- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
+++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.738
+# Version 7.0NG.740
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena
diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
index 55576e58fd..7a9d2c4347 100644
--- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf
+++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.738, HPUX Version
+# Version 7.0NG.740, HPUX Version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf
index a584a597cb..a55d96a952 100644
--- a/pandora_agents/shellscript/linux/pandora_agent.conf
+++ b/pandora_agents/shellscript/linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738
+# Version 7.0NG.740
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
index 18db7a174f..a24a24d16e 100644
--- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf
+++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738
+# Version 7.0NG.740
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf
index d3266f091d..74d515cb4e 100644
--- a/pandora_agents/shellscript/openWRT/pandora_agent.conf
+++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738
+# Version 7.0NG.740
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf
index aa59a262c4..dc915ef18e 100644
--- a/pandora_agents/shellscript/solaris/pandora_agent.conf
+++ b/pandora_agents/shellscript/solaris/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.738, Solaris version
+# Version 7.0NG.740, Solaris version
# General Parameters
# ==================
diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf
index dedf2c366f..de7e97911b 100644
--- a/pandora_agents/unix/AIX/pandora_agent.conf
+++ b/pandora_agents/unix/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, AIX version
+# Version 7.0NG.740, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 00e5de0dc5..ce165fde19 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-agent-unix
-Version: 7.0NG.738-190913
+Version: 7.0NG.740-191029
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 4035bca720..a4a8dce448 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.738-190913"
+pandora_version="7.0NG.740-191029"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf
index 4624a5ceff..34dd1bf4fc 100644
--- a/pandora_agents/unix/Darwin/pandora_agent.conf
+++ b/pandora_agents/unix/Darwin/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf
index 0895974d7b..e4ad74ffe7 100644
--- a/pandora_agents/unix/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, FreeBSD Version
+# Version 7.0NG.740, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf
index bfd0612672..e55445fe13 100644
--- a/pandora_agents/unix/HP-UX/pandora_agent.conf
+++ b/pandora_agents/unix/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, HP-UX Version
+# Version 7.0NG.740, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf
index e1a83ed6e5..54ace6a811 100644
--- a/pandora_agents/unix/Linux/pandora_agent.conf
+++ b/pandora_agents/unix/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf
index b0841bd0f7..94e32e8056 100644
--- a/pandora_agents/unix/NT4/pandora_agent.conf
+++ b/pandora_agents/unix/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf
index 4d96ba223d..71e7d14192 100644
--- a/pandora_agents/unix/NetBSD/pandora_agent.conf
+++ b/pandora_agents/unix/NetBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, NetBSD Version
+# Version 7.0NG.740, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf
index c4a4c578d9..cc89dee501 100644
--- a/pandora_agents/unix/SunOS/pandora_agent.conf
+++ b/pandora_agents/unix/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.738, Solaris Version
+# Version 7.0NG.740, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 35a86a656b..4bbac522b1 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
-use constant AGENT_VERSION => '7.0NG.738';
-use constant AGENT_BUILD => '190913';
+use constant AGENT_VERSION => '7.0NG.740';
+use constant AGENT_BUILD => '191029';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@@ -239,6 +239,15 @@ my $tentacle_pid = undef;
# PID of udp_server
my $udp_server_pid = undef;
+# BrokerFlag
+my $BrokerFlag = 0;
+
+# Global loop counter.
+my $LoopCounter = 0;
+
+# Define a max value for loopCounter to avoid overflow.
+use constant MAX_LOOP_COUNTER => 1000000000;
+
################################################################################
# Print usage information and exit.
################################################################################
@@ -1385,6 +1394,7 @@ sub sleep_agent {
exit (0);
}
+ $LoopCounter = ($LoopCounter + 1) % MAX_LOOP_COUNTER;
return $iter_base_time;
}
@@ -1699,6 +1709,14 @@ sub exec_module {
}
# Check module interval
+ if ($BrokerFlag > 0) {
+ if ($LoopCounter == 0) {
+ $module->{'counter'} = $module->{'intensive_interval'};
+ } else {
+ $module->{'counter'} = (($LoopCounter -1 ) % $module->{'intensive_interval'});
+ }
+ }
+
if (++($module->{'counter'}) < $module->{'intensive_interval'}) {
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
return;
@@ -2985,7 +3003,6 @@ while (1) {
@BrokerPid = ();
my @broker_agents = read_config ('broker_agent');
foreach my $broker_agent (@broker_agents) {
-
# Create broker conf file if it does not exist
if (! -e "$ConfDir/${broker_agent}.conf") {
write_broker_conf($broker_agent);
@@ -2995,7 +3012,9 @@ while (1) {
# Broker agent
if ($main_agent == 0) {
-
+ # Mark broker flag.
+ $BrokerFlag = 1;
+
# Set the configuration file
$ConfFile = "${broker_agent}.conf";
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 965a1aa0d1..79f2310c11 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.738
-%define release 190913
+%define version 7.0NG.740
+%define release 191029
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 55bda1c48a..392fa174ce 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.738
-%define release 190913
+%define version 7.0NG.740
+%define release 191029
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index f9eaab41c0..cc4b78b51c 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
-PI_VERSION="7.0NG.738"
-PI_BUILD="190913"
+PI_VERSION="7.0NG.740"
+PI_BUILD="191029"
OS_NAME=`uname -s`
FORCE=0
@@ -162,7 +162,15 @@ uninstall () {
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
rm -Rf $PANDORA_BASE$PANDORA_REVENT_BIN 2> /dev/null
rm -f $DESTDIR/etc/logrotate.d/pandora_agent
-
+
+ # Remove systemd service if exists
+ if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
+ then
+ PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
+ rm -f $PANDORA_AGENT_SERVICE
+ systemctl reset-failed
+ fi
+
#Test if exist Pandora Server in this machine
if [ -d $PANDORA_BASE$PANDORA_TEMP/data_in ]
then
@@ -465,6 +473,22 @@ install () {
else
RCDIRS="/etc/rc2.d /etc/rc3.d"
fi
+
+ # Create systemd service
+ if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
+ then
+ echo "Creating systemd service for pandora_agent_daemon"
+
+ PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
+ EXEC_START='ExecStart='$PANDORA_BASE$PANDORA_BIN' '$PANDORA_BASE$PANDORA_CFG
+
+ rm -f $PANDORA_AGENT_SERVICE
+ cp pandora_agent_daemon.service $PANDORA_AGENT_SERVICE
+
+ sed -i "s|^ExecStart=.*$|$EXEC_START|g" $PANDORA_AGENT_SERVICE
+
+ systemctl daemon-reload
+ fi
fi
[ "$RCDIRS" ] && for RCDIR in $RCDIRS
do
diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf
index c74dadfff6..79660e5b5d 100644
--- a/pandora_agents/win32/bin/pandora_agent.conf
+++ b/pandora_agents/win32/bin/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
-# Version 7.0NG.738
+# Version 7.0NG.740
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 5b62310d00..730edbe5de 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
-{Pandora FMS Windows Agent v7.0NG.738}
+{Pandora FMS Windows Agent v7.0NG.740}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{190913}
+{191029}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc
index e7c751d367..7cbde21ca7 100644
--- a/pandora_agents/win32/modules/pandora_module.cc
+++ b/pandora_agents/win32/modules/pandora_module.cc
@@ -1422,48 +1422,48 @@ Pandora_Module::evaluatePreconditions () {
buffer[read] = '\0';
output += (char *) buffer;
}
-
- try {
- double_output = Pandora_Strutils::strtodouble (output);
- } catch (Pandora_Strutils::Invalid_Conversion e) {
- double_output = 0;
+
+ try {
+ double_output = Pandora_Strutils::strtodouble (output);
+ } catch (Pandora_Strutils::Invalid_Conversion e) {
+ double_output = 0;
+ }
+
+ if (dwRet == WAIT_OBJECT_0) {
+ break;
+ } else if(this->getTimeout() < GetTickCount() - tickbase) {
+ /* STILL_ACTIVE */
+ TerminateProcess(pi.hThread, STILL_ACTIVE);
+ pandoraLog ("evaluatePreconditions: %s timed out (retcode: %d)", this->module_name.c_str (), STILL_ACTIVE);
+ break;
+ }
}
- if (dwRet == WAIT_OBJECT_0) {
- break;
- } else if(this->getTimeout() < GetTickCount() - tickbase) {
- /* STILL_ACTIVE */
- TerminateProcess(pi.hThread, STILL_ACTIVE);
- pandoraLog ("evaluatePreconditions: %s timed out (retcode: %d)", this->module_name.c_str (), STILL_ACTIVE);
- break;
+ GetExitCodeProcess (pi.hProcess, &retval);
+
+ if (retval != 0) {
+ if (! TerminateJobObject (job, 0)) {
+ pandoraLog ("evaluatePreconditions: TerminateJobObject failed. (error %d)",
+ GetLastError ());
+ }
+ if (retval != STILL_ACTIVE) {
+ pandoraLog ("evaluatePreconditions: %s did not executed well (retcode: %d)",
+ this->module_name.c_str (), retval);
+ }
+ /* Close job, process and thread handles. */
+ CloseHandle (job);
+ CloseHandle (pi.hProcess);
+ CloseHandle (pi.hThread);
+ CloseHandle (new_stdout);
+ CloseHandle (out_read);
+ return 0;
}
- }
-
- GetExitCodeProcess (pi.hProcess, &retval);
-
- if (retval != 0) {
- if (! TerminateJobObject (job, 0)) {
- pandoraLog ("evaluatePreconditions: TerminateJobObject failed. (error %d)",
- GetLastError ());
- }
- if (retval != STILL_ACTIVE) {
- pandoraLog ("evaluatePreconditions: %s did not executed well (retcode: %d)",
- this->module_name.c_str (), retval);
- }
+
/* Close job, process and thread handles. */
CloseHandle (job);
CloseHandle (pi.hProcess);
CloseHandle (pi.hThread);
- CloseHandle (new_stdout);
- CloseHandle (out_read);
- return 0;
}
-
- /* Close job, process and thread handles. */
- CloseHandle (job);
- CloseHandle (pi.hProcess);
- CloseHandle (pi.hThread);
- }
CloseHandle (new_stdout);
CloseHandle (out_read);
@@ -1693,4 +1693,18 @@ Pandora_Module::getAsync () {
return this->async;
}
+/**
+ * Get current exections
+ */
+long
+Pandora_Module::getExecutions () {
+ return this->executions;
+}
+/**
+ * Set current execution (global) used for brokers.
+ */
+void
+Pandora_Module::setExecutions (long executions) {
+ this->executions = executions;
+}
diff --git a/pandora_agents/win32/modules/pandora_module.h b/pandora_agents/win32/modules/pandora_module.h
index c766766950..3b9d6c15a4 100644
--- a/pandora_agents/win32/modules/pandora_module.h
+++ b/pandora_agents/win32/modules/pandora_module.h
@@ -234,6 +234,8 @@ namespace Pandora_Modules {
int getTimeout ();
string getSave ();
bool getAsync ();
+ void setExecutions(long executions=0);
+ long getExecutions();
virtual string getXml ();
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 22d0d1eff5..823b486b0e 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.738(Build 190913)")
+#define PANDORA_VERSION ("7.0NG.740(Build 191029)")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc
index 275ee60724..b62fc1f70d 100644
--- a/pandora_agents/win32/pandora_windows_service.cc
+++ b/pandora_agents/win32/pandora_windows_service.cc
@@ -1849,7 +1849,7 @@ Pandora_Windows_Service::sendBufferedXml (string path) {
}
void
-Pandora_Windows_Service::pandora_run_broker (string config) {
+Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
Pandora_Agent_Conf *conf = NULL;
string server_addr;
unsigned char data_flag = 0;
@@ -1876,7 +1876,10 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
Pandora_Module *module;
module = this->broker_modules->getCurrentValue ();
-
+
+ /* Keep executions matching main agent */
+ module->setExecutions(executions);
+
/* Check preconditions */
if (module->evaluatePreconditions () == 0) {
pandoraDebug ("Preconditions not matched for module %s", module->getName ().c_str ());
@@ -2074,7 +2077,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
check_broker_agents(all_conf);
for (i=0;i ';
render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key');
- render_row($license['expiry_date'], 'Expires');
+ render_row($license['expiry_date'], $license['expiry_caption']);
render_row($license['limit'].' agents', 'Platform Limit');
render_row($license['count'].' agents', 'Current Platform Count');
render_row($license['count_enabled'].' agents', 'Current Platform Count (enabled: items)');
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index 704ab61d74..d7e416c951 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -219,14 +219,17 @@ CREATE TABLE IF NOT EXISTS `tdashboard` (
-- Table `tdatabase`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tdatabase` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `host` varchar(100) default '',
- `os_port` int(4) unsigned default '22',
- `os_user` varchar(100) default '',
- `db_port` int(4) unsigned default '3306',
+ `id` INT(10) unsigned NOT NULL auto_increment,
+ `host` VARCHAR(255) default '',
+ `label` VARCHAR(255) default '',
+ `os_port` INT UNSIGNED NOT NULL DEFAULT 22,
+ `os_user` VARCHAR(255) default '',
+ `db_port` INT UNSIGNED NOT NULL DEFAULT 3306,
`status` tinyint(1) unsigned default '0',
`action` tinyint(1) unsigned default '0',
- `last_error` varchar(255) default '',
+ `ssh_key` TEXT,
+ `ssh_pubkey` TEXT,
+ `last_error` TEXT,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
@@ -798,6 +801,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) D
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@@ -1243,19 +1247,39 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 31);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 32);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '739');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
-DELETE FROM `tconfig` WHERE `token` LIKE 'integria_enabled';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url';
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_user', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_pass', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_hostname', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_api_pass', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_req_timeout', 5);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_group', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_criticity', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_creator', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_owner', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_type', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_status', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_title', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_content', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_group', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_criticity', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_creator', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_owner', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_type', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_status', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_title', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_content', '');
-- ---------------------------------------------------------------------
-- Table `tconfig_os`
@@ -1454,6 +1478,7 @@ ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
+ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
@@ -1882,6 +1907,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
`linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_node_id` INT(10) NOT NULL default 0,
+ `cache_expiration` INTEGER UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`),
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
diff --git a/pandora_console/general/firts_task/HA_cluster_builder.php b/pandora_console/general/firts_task/HA_cluster_builder.php
index fa85e28381..6d82d94ad0 100644
--- a/pandora_console/general/firts_task/HA_cluster_builder.php
+++ b/pandora_console/general/firts_task/HA_cluster_builder.php
@@ -1,15 +1,25 @@
- true, 'message' => __('There are no HA clusters defined yet.') ]);
?>
@@ -44,8 +52,9 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
".__(' Pandora FMS Licence Information').'
'.__('Ignore new GIS data:').'
'; + $table_adv_gis = ''.__('Update new GIS data:').'
'; if ($new_agent) { $update_gis_data = true; } diff --git a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php index b40cf80855..47a5cc5a35 100644 --- a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php @@ -353,7 +353,7 @@ html_print_table($table); echo "