diff --git a/pandora_agents/Dockerfile b/pandora_agents/Dockerfile index 945a74b1c9..69117e2ca7 100644 --- a/pandora_agents/Dockerfile +++ b/pandora_agents/Dockerfile @@ -9,6 +9,7 @@ RUN yum -y install \ epel-release \ unzip \ perl \ + python3 \ sed \ "perl(Sys::Syslog)" diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index f3657d3a7a..b242e667c1 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.740, AIX version +# Version 7.0NG.742, 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 95fd1090ad..4fd4b92596 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.740, FreeBSD Version +# Version 7.0NG.742, 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 04122feb30..e0af4e7490 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.740, HP-UX Version +# Version 7.0NG.742, 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 b083e7f3aa..fe67398b8a 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.740, GNU/Linux +# Version 7.0NG.742, 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 4bb88c5b4e..092436f485 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.740, GNU/Linux +# Version 7.0NG.742, 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 a90b7227ca..a2162ac29f 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.740, Solaris Version +# Version 7.0NG.742, 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 d750898b70..e582bbd963 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.740 +# Version 7.0NG.742 # 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 6a663d6331..80762acbb7 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.740, AIX version +# Version 7.0NG.742, 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 99e4c62462..4ac18ede49 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.740 +# Version 7.0NG.742 # 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 7a9d2c4347..925081e62c 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.740, HPUX Version +# Version 7.0NG.742, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index a55d96a952..68ced2a378 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.740 +# Version 7.0NG.742 # 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 a24a24d16e..495c2516d4 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.740 +# Version 7.0NG.742 # 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 74d515cb4e..f18f326a05 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.740 +# Version 7.0NG.742 # 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 dc915ef18e..e319d9695f 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.740, Solaris version +# Version 7.0NG.742, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index de7e97911b..604509d18d 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.740, AIX version +# Version 7.0NG.742, 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 30bb717737..9287366df9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.740-191122 +Version: 7.0NG.742-200107 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 ac1792f927..c4c8f18bca 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.740-191122" +pandora_version="7.0NG.742-200107" 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 34dd1bf4fc..1daa7b6ddc 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.740, GNU/Linux +# Version 7.0NG.742, 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 e4ad74ffe7..e8d62cc68f 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.740, FreeBSD Version +# Version 7.0NG.742, 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 e55445fe13..05770c02aa 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.740, HP-UX Version +# Version 7.0NG.742, 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 54ace6a811..3aafa0fc85 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.740, GNU/Linux +# Version 7.0NG.742, 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 94e32e8056..a99efbc9c8 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.740, GNU/Linux +# Version 7.0NG.742, 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 71e7d14192..228d95c9f1 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.740, NetBSD Version +# Version 7.0NG.742, 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 cc89dee501..7fc6e08f1d 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.740, Solaris Version +# Version 7.0NG.742, 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 3296156e53..f2f18db563 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -54,8 +54,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.740'; -use constant AGENT_BUILD => '191122'; +use constant AGENT_VERSION => '7.0NG.742'; +use constant AGENT_BUILD => '200107'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -2882,7 +2882,7 @@ sub cron_valid_date { my $utime; eval { local $SIG{__DIE__} = sub {}; - $utime = timelocal(0, $min, $hour, $mday, $month, $year); + $utime = strftime("%s", 0, $min, $hour, $mday, $month, $year); }; if ($@) { return 0; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index eebd281636..c6218b2fa9 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.740 -%define release 191122 +%define version 7.0NG.742 +%define release 200107 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel Requires: fileutils textutils unzip Requires: util-linux procps grep Requires: /sbin/ip /bin/awk -Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) +Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny) # Required by plugins #Requires: sh-utils sed passwd net-tools rpm AutoReq: 0 diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 51ca3872f1..ace132ceb5 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.740 -%define release 191122 +%define version 7.0NG.742 +%define release 200107 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -19,7 +19,7 @@ Prefix: /usr/share BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildArch: noarch PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd -Requires: coreutils unzip perl +Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny) AutoReq: 0 Provides: %{name}-%{version} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index d0d49023a3..229357e516 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.740" -PI_BUILD="191122" +PI_VERSION="7.0NG.742" +PI_BUILD="200107" OS_NAME=`uname -s` FORCE=0 @@ -89,7 +89,7 @@ fi [ "$4" ] && PANDORA_PERL_PATH=$4 # Check for Perl 5.6.x or higher available -PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[12][0-9]' | grep perl` +PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[1-3][0-9]' | grep perl` if [ -z "$PERL_VERSION" ] then diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 79660e5b5d..3e519fa738 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.740 +# Version 7.0NG.742 # 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 2fc3287a56..2192edbf41 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.740} +{Pandora FMS Windows Agent v7.0NG.742} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191122} +{200107} ViewReadme {Yes} diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index 7cbde21ca7..59e8af0a5b 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -1708,3 +1708,17 @@ void Pandora_Module::setExecutions (long executions) { this->executions = executions; } + +/** + * Checks if the module has intensive conditions. + * + * @return true if the module's intensive condition list is not empty, false if it is. + */ +bool +Pandora_Module::isIntensive () { + if (this->intensive_condition_list == NULL || this->intensive_condition_list->size () <= 0) { + return false; + } + + return true; +} diff --git a/pandora_agents/win32/modules/pandora_module.h b/pandora_agents/win32/modules/pandora_module.h index 3b9d6c15a4..f38cac5f80 100644 --- a/pandora_agents/win32/modules/pandora_module.h +++ b/pandora_agents/win32/modules/pandora_module.h @@ -303,6 +303,7 @@ namespace Pandora_Modules { time_t getTimestamp (); void setIntensiveMatch (unsigned char intensive_match); unsigned char getIntensiveMatch (); + bool isIntensive (); }; } diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 289598ecf3..077f429aca 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.740(Build 191122)") +#define PANDORA_VERSION ("7.0NG.742(Build 200107)") 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 b62fc1f70d..73d0a5d482 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -1918,16 +1918,19 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) { } /* Evaluate intensive conditions */ - intensive_match = module->evaluateIntensiveConditions (); - if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { - module->setNoOutput (); - this->broker_modules->goNext (); - continue; - } - module->setIntensiveMatch (intensive_match); - - if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { - module->setTimestamp (this->run_time); + if (module->isIntensive()) { + intensive_match = module->evaluateIntensiveConditions (); + if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { + module->setNoOutput (); + this->broker_modules->goNext (); + continue; + } + + if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { + module->setTimestamp (this->run_time); + } + + module->setIntensiveMatch (intensive_match); } /* Evaluate module conditions */ @@ -2038,16 +2041,19 @@ Pandora_Windows_Service::pandora_run (int forced_run) { } /* Evaluate intensive conditions */ - intensive_match = module->evaluateIntensiveConditions (); - if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { - module->setNoOutput (); - this->modules->goNext (); - continue; - } - module->setIntensiveMatch (intensive_match); - - if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { - module->setTimestamp (this->run_time); + if (module->isIntensive()) { + intensive_match = module->evaluateIntensiveConditions (); + if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { + module->setNoOutput (); + this->modules->goNext (); + continue; + } + + if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { + module->setTimestamp (this->run_time); + } + + module->setIntensiveMatch (intensive_match); } /* Evaluate module conditions */ diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5056749b6c..638d0b72b6 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.740(Build 191122))" + VALUE "ProductVersion", "(7.0NG.742(Build 200107))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9fcbbebf3d..6f122a5ad2 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.740-191122 +Version: 7.0NG.742-200107 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 32acc651b2..2467811716 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/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.740-191122" +pandora_version="7.0NG.742-200107" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 546ee463fa..6d41459d90 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -22,6 +22,17 @@ function dbmanager_query($sql, &$error, $dbconnection) } $sql = html_entity_decode($sql, ENT_QUOTES); + + // Extract the text in quotes to add html entities before query db. + $patttern = '/(?:"|\')+([^"\']*)(?:"|\')+/m'; + $sql = preg_replace_callback( + $patttern, + function ($matches) { + return '"'.io_safe_input($matches[1]).'"'; + }, + $sql + ); + if ($config['mysqli']) { $result = mysqli_query($dbconnection, $sql); if ($result === false) { diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index ba66cae68e..3896a10155 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -312,7 +312,7 @@ function main_net_tools() $ips = db_get_all_rows_sql( sprintf( 'SELECT ip FROM taddress WHERE id_a IN (%s)', - join($ids) + join(',', $ids) ) ); diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index a8cce0b8de..6b70ae21e8 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -65,17 +65,13 @@ function quickShell() ui_require_css_file('discovery'); // Settings. - // WebSocket host, where to connect. - if (isset($config['ws_host']) === false) { - config_update_value('ws_host', $_SERVER['SERVER_ADDR']); - } - + // WebSocket host, where client should connect. if (isset($config['ws_port']) === false) { config_update_value('ws_port', 8080); } if (empty($config['ws_proxy_url']) === true) { - $ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port']; + $ws_url = 'http://'.$_SERVER['SERVER_ADDR'].':'.$config['ws_port']; } else { preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches); if (isset($_SERVER['HTTPS']) === true) { @@ -313,7 +309,7 @@ function quickShellSettings() } // Parser. - if (get_parameter('qs_update', false) !== false) { + if (get_parameter('update_config', false) !== false) { // Gotty settings. Internal communication (WS). $gotty = get_parameter( 'gotty', @@ -381,14 +377,6 @@ function quickShellSettings() } } - // Interface. - ui_print_page_header( - __('QuickShell settings'), - '', - false, - 'quickshell_settings' - ); - if ($changes > 0) { $msg = __('%d Updated', $changes); if ($critical > 0) { @@ -401,100 +389,105 @@ function quickShellSettings() ui_print_success_message($msg); } - // Form. - $wiz = new Wizard(); + // Form. Using old style. + echo '
'; + echo ''.__('Quickshell').''; - $wiz->printForm( - [ - 'form' => [ - 'action' => '#', - 'class' => 'wizard', - 'method' => 'post', - ], - 'inputs' => [ - [ - 'label' => __('Gotty path').ui_print_help_tip( - __('Leave blank if using an external Gotty service'), - true - ), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty', - 'value' => $config['gotty'], - ], - ], - [ - 'label' => __('Gotty host'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_host', - 'value' => $config['gotty_host'], - ], - ], - [ - 'label' => __('Gotty ssh port'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_ssh_port', - 'value' => $config['gotty_ssh_port'], - ], - ], - [ - 'label' => __('Gotty telnet port'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_telnet_port', - 'value' => $config['gotty_telnet_port'], - ], - ], - [ - 'toggle' => true, - 'toggle_name' => 'Advanced', - 'block_content' => [ - [ - 'label' => __('Gotty user').ui_print_help_tip( - __('Optional, set a user to access gotty service'), - true - ), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_user', - 'value' => $config['gotty_user'], - ], - ], - [ - 'label' => __('Gotty password').ui_print_help_tip( - __('Optional, set a password to access gotty service'), - true - ), - 'arguments' => [ - 'type' => 'password', - 'name' => 'gotty_pass', - 'value' => io_output_password($config['gotty_pass']), - ], - ], - ], - ], - [ - 'arguments' => [ - 'type' => 'hidden', - 'name' => 'qs_update', - 'value' => 1, - ], - ], - [ - 'arguments' => [ - 'type' => 'submit', - 'label' => __('Update'), - 'attributes' => 'class="sub next"', - ], - ], - ], - ], - false, + $t = new StdClass(); + $t->data = []; + $t->width = '100%'; + $t->class = 'databox filters'; + $t->data = []; + $t->style = []; + $t->style[0] = 'font-weight: bold; width: 40%;'; + + $t->data[0][0] = __('Gotty path'); + $t->data[0][1] = html_print_input_text( + 'gotty', + $config['gotty'], + '', + 30, + 100, true ); + $t->data[1][0] = __('Gotty host'); + $t->data[1][1] = html_print_input_text( + 'gotty_host', + $config['gotty_host'], + '', + 30, + 100, + true + ); + + $t->data[2][0] = __('Gotty ssh port'); + $t->data[2][1] = html_print_input_text( + 'gotty_ssh_port', + $config['gotty_ssh_port'], + '', + 30, + 100, + true + ); + + $t->data[3][0] = __('Gotty telnet port'); + $t->data[3][1] = html_print_input_text( + 'gotty_telnet_port', + $config['gotty_telnet_port'], + '', + 30, + 100, + true + ); + + $hidden = new StdClass(); + $hidden->data = []; + $hidden->width = '100%'; + $hidden->class = 'databox filters'; + $hidden->data = []; + $hidden->style[0] = 'font-weight: bold;width: 40%;'; + + $hidden->data[0][0] = __('Gotty user').ui_print_help_tip( + __('Optional, set a user to access gotty service'), + true + ); + $hidden->data[0][1] = html_print_input_text( + 'gotty_user', + $config['gotty_user'], + '', + 30, + 100, + true + ); + + $hidden->data[1][0] = __('Gotty password').ui_print_help_tip( + __('Optional, set a password to access gotty service'), + true + ); + $hidden->data[1][1] = html_print_input_password( + 'gotty_pass', + io_output_password($config['gotty_pass']), + '', + 30, + 100, + true + ); + + html_print_table($t); + + ui_print_toggle( + [ + 'content' => html_print_table($hidden, true), + 'name' => __('Advanced options'), + 'clean' => false, + 'main_class' => 'no-border-imp', + 'container_class' => 'no-border-imp', + ] + ); + + echo '
'; + } @@ -523,19 +516,4 @@ if (empty($agent_id) === false } } -extensions_add_godmode_menu_option( - // Name. - __('QuickShell settings'), - // Acl. - 'PM', - // FatherId. - 'gextensions', - // Icon. - 'images/ehorus/terminal.png', - // Version. - 'N/A', - // SubfatherId. - null -); - extensions_add_godmode_function('quickShellSettings'); diff --git a/pandora_console/extras/mr/33.sql b/pandora_console/extras/mr/33.sql index bfe1777e63..3a25268e6d 100644 --- a/pandora_console/extras/mr/33.sql +++ b/pandora_console/extras/mr/33.sql @@ -1,5 +1,6 @@ START TRANSACTION; +ALTER TABLE `treport_template` ADD COLUMN `agent_regex` varchar(600) NOT NULL default ''; ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0; INSERT INTO `ttipo_modulo` VALUES @@ -16,10 +17,45 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; + ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; + +UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != ''; +UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != ''; +UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0; +UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != ''; +UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != ''; +UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != ''; +UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != ''; +UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99'; +UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != ''; +UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0; +UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != ''; +UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != ''; +UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != ''; + +ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; +ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; + CREATE TABLE `tremote_command` ( `id` SERIAL, `name` varchar(150) NOT NULL, @@ -48,6 +84,12 @@ CREATE TABLE `tremote_command_target` ( INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); + ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; +ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10); + + +ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`); +ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`); COMMIT; diff --git a/pandora_console/extras/mr/34.sql b/pandora_console/extras/mr/34.sql new file mode 100644 index 0000000000..446709ab10 --- /dev/null +++ b/pandora_console/extras/mr/34.sql @@ -0,0 +1,10 @@ +START TRANSACTION; + +ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; + +ALTER TABLE `tevent_response` ADD COLUMN `command_timeout` int(5) unsigned NOT NULL DEFAULT 90; + +COMMIT; 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 9d182b0a54..ca415cd52a 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 @@ -579,6 +579,39 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0; +ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source'; +ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent'; +ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default ''; +ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL; +ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL; + +UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != ''; +UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != ''; +UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0; +UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != ''; +UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != ''; +UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != ''; +UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != ''; +UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99'; +UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != ''; +UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0; +UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != ''; +UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != ''; +UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != ''; -- ----------------------------------------------------- -- Table `tevent_alert` @@ -627,6 +660,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; +ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; + -- ----------------------------------------------------- -- Table `tevent_alert_action` -- ----------------------------------------------------- @@ -728,6 +764,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` ( `footer` MEDIUMTEXT default NULL, `custom_font` varchar(200) default NULL, `metaconsole` tinyint(1) DEFAULT 0, + `agent_regex` varchar(600) NOT NULL default '', + PRIMARY KEY(`id_report`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; @@ -804,6 +842,8 @@ ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0', MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300', MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; -- ---------------------------------------------------------------------- -- Table `tnews` @@ -931,6 +971,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0'; +ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`); -- --------------------------------------------------------------------- -- Table `tmetaconsole_event_history` @@ -1291,13 +1332,13 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; 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', 33); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 34); 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', '741'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '742'); 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_api_password'; @@ -1358,6 +1399,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; +ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10); ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; -- --------------------------------------------------------------------- @@ -1561,6 +1603,8 @@ ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0', MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1', MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1'; +ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` @@ -1736,6 +1780,7 @@ ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0 -- Table `tevent_response` -- --------------------------------------------------------------------- ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0; +ALTER TABLE tevent_response ADD COLUMN command_timeout int(5) unsigned NOT NULL DEFAULT 90; -- --------------------------------------------------------------------- -- Table `tmodule` @@ -1906,6 +1951,7 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tusuario_perfil ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL default '0'; +ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`); -- --------------------------------------------------------------------- -- Table `tautoconfig` @@ -2357,7 +2403,7 @@ CREATE TABLE `tvisual_console_elements_cache` ( CREATE TABLE IF NOT EXISTS `tcredential_store` ( `identifier` varchar(100) NOT NULL, `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, - `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', + `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM', `username` text, `password` text, `extra_1` text, diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 368accd39b..b0bc0bf1d1 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -13,6 +13,8 @@ require_once 'include/functions_messages.php'; require_once 'include/functions_servers.php'; require_once 'include/functions_notifications.php'; +require_once 'include/ajax/order_interpreter.php'; +ui_require_css_file('order_interpreter'); // Check permissions // Global errors/warnings checking. @@ -99,7 +101,8 @@ if ($config['menu_type'] == 'classic') { if ($acl_head_search) { // Search bar. - $search_bar = '
'; + $search_bar = ''; + ''; if (!isset($config['search_keywords'])) { $search_bar .= ''; } else { @@ -110,7 +113,7 @@ if ($config['menu_type'] == 'classic') { } } - $search_bar .= ''; + $search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" + onkeyup="showinterpreter()" class="search_input"/>'; + + $search_bar .= '
'; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; $search_bar .= ""; $search_bar .= '
'; @@ -622,7 +627,7 @@ if ($config['menu_type'] == 'classic') { }); } - // Resize event + // Resize event. window.addEventListener("resize", function() { attatch_to_image(); }); @@ -630,7 +635,86 @@ if ($config['menu_type'] == 'classic') { var fixed_header = ; var new_chat = ; + + function showinterpreter(){ + document.onclick = function(e) { + $('#result_order').hide(); + $('#keywords').addClass('search_input'); + $('#keywords').removeClass('results-found'); + $('#keywords').value = ''; + $('#keywords').attr('placeholder','Enter keywords to search'); + } + + if(event.keyCode == 13 && $("#result_items li.active").length != 0 ) + { + window.location = $('#result_items').find("li.active a").attr('href'); + } + var code = event.key; + switch (code){ + case 'ArrowDown': + if($("#result_items li.active").length!=0) + { + var storeTarget = $('#result_items').find("li.active").next(); + $("#result_items li.active").removeClass("active"); + storeTarget.focus().addClass("active"); + + } + else + { + $('#result_items').find("li:first").focus().addClass("active"); + } + return; + + case 'ArrowUp': + if($("#result_items li.active")) + { + var storeTarget = $('#result_items').find("li.active").prev(); + $("#result_items li.active").removeClass("active"); + storeTarget.focus().addClass("active"); + } + else + { + $('#result_items').find("li:first").focus().addClass("active"); + } + return; + + case 'ArrowRight': + return; + case 'ArrowLeft': + return; + + } + + if( $('#keywords').val() === ''){ + $('#keywords').addClass('search_input'); + $('#keywords').removeClass('results-found'); + $('#result_order').hide(); + $('#keywords').attr('placeholder','Enter keywords to search'); + }else { + $.ajax({ + type: "POST", + url: "ajax.php", + dataType: "html", + data: { + page: 'include/ajax/order_interpreter', + method: 'getResult', + text: $('#keywords').val(), + }, + success: function (data) { + $('#result_order').html(data); + console.log(data); + }, + error: function (data) { + console.error("Fatal error in AJAX call to interpreter order", data) + } + }); + $('#keywords').removeClass('search_input'); + $('#keywords').addClass('results-found'); + $('#result_order').show(); + + } + } /** * Loads modal from AJAX to add feedback. */ diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 816533aab0..2410094c41 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -82,12 +82,18 @@ if (!empty($page) && !empty($sec)) { } $login_body_style = ''; +$login_body_class = ''; // Overrides the default background with the defined by the user. if (!empty($config['login_background'])) { $background_url = 'images/backgrounds/'.$config['login_background']; $login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\""; } +// Support for Internet Explorer and Microsoft Edge browsers +if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) { + $login_body_class = "class='login_body_trident'"; +} + // Get alternative custom in case of db fail. $custom_fields = [ 'custom_logo_login', @@ -111,7 +117,7 @@ foreach ($custom_fields as $field) { // Get the custom icons. $docs_logo = ui_get_docs_logo(); $support_logo = ui_get_support_logo(); -echo '
'; +echo '
'; echo '
'; echo '
    '; diff --git a/pandora_console/general/news_dialog.php b/pandora_console/general/news_dialog.php index 37ca016edf..9ab685d39f 100644 --- a/pandora_console/general/news_dialog.php +++ b/pandora_console/general/news_dialog.php @@ -40,7 +40,7 @@ if (!empty($news)) { // Prints news dialog template echo '
'; // Learn mode / Normal mode. $table_adv_module_mode = '

'.__('Module definition').':

'; @@ -667,7 +669,7 @@ $table_adv_status .= html_print_checkbox_switch( $disabled, true ); -$table_adv_status .= '

'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'

'; +$table_adv_status .= '

'.__('Disabled mode').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'

'; $table_adv_status .= '
'; // Url address. @@ -774,11 +776,14 @@ if ($config['activate_gis']) { } +if (enterprise_installed()) { + $advanced_div = '
'; +} else { + $advanced_div = '