diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 520eaff838..c4c9d8e42e 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.727, AIX version +# Version 7.0NG.728, 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 c81ad7428b..53b7e5ed5d 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.727, FreeBSD Version +# Version 7.0NG.728, 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 50fc5ba4be..f12d0518f2 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.727, HP-UX Version +# Version 7.0NG.728, 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 82830cf957..9c36a4211c 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.727, GNU/Linux +# Version 7.0NG.728, 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 ea633488e4..5870e5283a 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.727, GNU/Linux +# Version 7.0NG.728, 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 c8a2153376..e6e468401e 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.727, Solaris Version +# Version 7.0NG.728, 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 6a01d22b4b..e1feeacc4e 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.727 +# Version 7.0NG.728 # 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 27cbee7dfb..8d9e405b99 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.727, AIX version +# Version 7.0NG.728, 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 6eaf0415c2..f428ddf5e1 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.727 +# Version 7.0NG.728 # 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 906269e8bb..6f1eded2ef 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.727, HPUX Version +# Version 7.0NG.728, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index b2cdc0e920..26b099a519 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.727 +# Version 7.0NG.728 # 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 82363fdb43..4f23ce219e 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.727 +# Version 7.0NG.728 # 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 2b4f58566b..8f272695ac 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.727 +# Version 7.0NG.728 # 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 a1c4130f17..cce42277f7 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.727, Solaris version +# Version 7.0NG.728, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 0d640badaa..476c53874f 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.727, AIX version +# Version 7.0NG.728, 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 3640efdea4..93d8cf3cbf 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-181022 +Version: 7.0NG.728-181025 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 17c585dc0d..0e6d0fb01e 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.727-181022" +pandora_version="7.0NG.728-181025" 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 53dd20cf4f..ac53da9443 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.727, GNU/Linux +# Version 7.0NG.728, 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 3590ee6551..12f0f7d805 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.727, FreeBSD Version +# Version 7.0NG.728, 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 aa1dcb1592..3339e5443d 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.727, HP-UX Version +# Version 7.0NG.728, 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 fc55d1d872..58fb118e99 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.727, GNU/Linux +# Version 7.0NG.728, 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 7a47602abc..a47ae7137b 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.727, GNU/Linux +# Version 7.0NG.728, 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 42d8c19a25..701ee400e7 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.727, NetBSD Version +# Version 7.0NG.728, 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 625bc89848..95152aadf3 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.727, Solaris Version +# Version 7.0NG.728, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/collections/.empty b/pandora_agents/unix/collections/.empty deleted file mode 100644 index 8d1c8b69c3..0000000000 --- a/pandora_agents/unix/collections/.empty +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f24407df38..cc1eb4ee08 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.727'; -use constant AGENT_BUILD => '181022'; +use constant AGENT_VERSION => '7.0NG.728'; +use constant AGENT_BUILD => '181025'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 268d4809be..d0ec7f42a0 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.727 -%define release 181022 +%define version 7.0NG.728 +%define release 181025 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -95,7 +95,7 @@ if [ ! -e /etc/pandora/plugins ]; then fi if [ ! -e /etc/pandora/collections ]; then - ln -s /usr/share/pandora_agent/collections /etc/pandora + mkdir -p /etc/pandora/collections fi mkdir -p /var/spool/pandora/data_out diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 46c6ca011d..b37f906bea 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.727 -%define release 181022 +%define version 7.0NG.728 +%define release 181025 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -88,7 +88,7 @@ if [ ! -e /etc/pandora/plugins ]; then fi if [ ! -e /etc/pandora/collections ]; then - ln -s /usr/share/pandora_agent/collections /etc/pandora + mkdir /etc/pandora/collections fi cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 77c8ca8552..981a8e3d68 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.727" -PI_BUILD="181022" +PI_VERSION="7.0NG.728" +PI_BUILD="181025" OS_NAME=`uname -s` FORCE=0 @@ -388,8 +388,8 @@ install () { ln -s $PANDORA_BASE_REAL$PANDORA_HOME/plugins $PANDORA_BASE$PANDORA_CFG - echo "Copying Pandora FMS Agent collections to $PANDORA_BASE$PANDORA_HOME/collections..." - cp -r collections $PANDORA_BASE$PANDORA_HOME + echo "Creating the collections directory in to $PANDORA_BASE$PANDORA_HOME/collections..." + mkdir -p $PANDORA_BASE$PANDORA_HOME/collections chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections ln -s $PANDORA_BASE_REAL$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG diff --git a/pandora_agents/win32/bin/collections/.empty b/pandora_agents/win32/bin/collections/.empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 0901ac5234..bb4d1a6923 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.727 +# Version 7.0NG.728 # 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 31e08f7921..7019fcf229 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.727} +{Pandora FMS Windows Agent v7.0NG.728} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181022} +{181025} ViewReadme {Yes} diff --git a/pandora_agents/win32/misc/cron.cc b/pandora_agents/win32/misc/cron.cc index d712c2685c..2d3e5e0440 100644 --- a/pandora_agents/win32/misc/cron.cc +++ b/pandora_agents/win32/misc/cron.cc @@ -227,7 +227,7 @@ int Cron::getResetValue (int position) { * @return false if should not execute */ bool Cron::shouldExecuteAt (time_t date) { - return this->utimestamp < date; + return this->utimestamp <= date; } /** diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 433930f10f..54c6b626f9 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.727(Build 181022)") +#define PANDORA_VERSION ("7.0NG.728(Build 181025)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f1986cb8e2..640dedbb35 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.727(Build 181022))" + VALUE "ProductVersion", "(7.0NG.728(Build 181025))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 17b6956d8a..86769b7615 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-181022 +Version: 7.0NG.728-181025 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 c381d332fe..f940e5bbb5 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.727-181022" +pandora_version="7.0NG.728-181025" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 5cfcc331d0..b930462fe5 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -48,7 +48,7 @@ function createXMLData($agent, $agentModule, $time, $data) { $data ); - $file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . str_replace($time, " ", "_") . ".data"; + $file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . strtotime($time) . ".data"; return (bool) @file_put_contents($file_name, $xml); } @@ -115,7 +115,7 @@ function mainInsertData() { $utimestamp = strtotime($date . " " . $time) - get_fixed_offset(); $timestamp = date(DATE_FORMAT . " " . TIME_FORMAT, $utimestamp); $result = createXMLData($agent, $agentModule, $timestamp, $data); - + if ($result) { $done++; } diff --git a/pandora_console/extensions/realtime_graphs/ajax.php b/pandora_console/extensions/realtime_graphs/ajax.php index 7c3eb0c3b5..caea2bda86 100644 --- a/pandora_console/extensions/realtime_graphs/ajax.php +++ b/pandora_console/extensions/realtime_graphs/ajax.php @@ -77,6 +77,15 @@ switch($graph) { if (count($data_array) > 1) { $data = $data_array[1]; } + // Redefine boolean data + switch ($data) { + case "up(1)": + $data = 1; + break; + case "down(0)": + $data = 0; + break; + } } } break; diff --git a/pandora_console/extras/mr/22.sql b/pandora_console/extras/mr/22.sql index b8e352738e..d0a099460b 100644 --- a/pandora_console/extras/mr/22.sql +++ b/pandora_console/extras/mr/22.sql @@ -2,4 +2,6 @@ START TRANSACTION; ALTER TABLE `tusuario` DROP COLUMN `flash_chart`; -COMMIT; \ No newline at end of file +ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; + +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 f645cb19b9..8980cf0982 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 @@ -1741,6 +1741,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; + -- --------------------------------------------------------------------- -- Table `tlayout_template_data` -- --------------------------------------------------------------------- diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index c2ecec56da..bab96a8fb2 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -210,6 +210,7 @@ if (!empty($all_data)) { echo '
'; $table = new stdClass(); + $table->class = "databox data"; $table->width = '100%'; //Don't specify px $table->data = array (); $table->size = array (); @@ -274,7 +275,12 @@ if (!empty($all_data)) { . human_time_comparation($session['utimestamp'], 'tiny'); $data[3] = $session_ip_origen; $description = str_replace(array(',', ', '), ', ', $session['descripcion']); - $data[4] = '
' . io_safe_output($description) . '
'; + if(strlen($description)>100){ + $data[4] = '
' . io_safe_output(substr($description, 0, 150).'...') . '
'; + } + else{ + $data[4] = '
' . io_safe_output($description) . '
'; + } array_push ($table->data, $data); } diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 4af38ec669..658f7dd9fc 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -233,7 +233,7 @@ foreach ($result as $row) { $data[2] = ui_print_help_tip(date($config["date_format"], $row["utimestamp"]), true) . ui_print_timestamp($row["utimestamp"], true); $data[3] = $row["ip_origen"]; - $data[4] = $row["descripcion"]; + $data[4] = io_safe_output($row["descripcion"]); if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { $data[5] = enterprise_hook("cell1EntepriseAudit", array($row["id_sesion"])); diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index e27c014a1f..7e1e8bd2f7 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -541,7 +541,7 @@ if (!empty($interfaces_list)) { $table->data[0][1] = ''; $table->data[0][2] = ''.__('Modules').''; - $table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px;'); + $table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;'); $table->data[1][1] = html_print_image('images/darrowright.png', true); $table->data[1][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;'); $table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 49a9a85d9a..36b67da66f 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1772,13 +1772,15 @@ if (!empty($duplicate_module)) { // DUPLICATE agent module ! // ===================== if ($enable_module) { $result = modules_change_disabled($enable_module, 0); - + $modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$enable_module.""); + $modulo_nombre = $modulo_nombre['nombre']; + if ($result === NOERR) { enterprise_hook('config_agents_enable_module_conf', array($id_agente, $enable_module)); - db_pandora_audit("Module management", 'Enable ' . $enable_module); + db_pandora_audit("Module management", 'Enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } else { - db_pandora_audit("Module management", 'Fail to enable ' . $enable_module); + db_pandora_audit("Module management", 'Fail to enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } ui_print_result_message ($result, @@ -1787,13 +1789,15 @@ if ($enable_module) { if ($disable_module) { $result = modules_change_disabled($disable_module, 1); - + $modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$disable_module.""); + $modulo_nombre = $modulo_nombre['nombre']; + if ($result === NOERR) { enterprise_hook('config_agents_disable_module_conf', array($id_agente, $disable_module)); - db_pandora_audit("Module management", 'Disable ' . $disable_module); + db_pandora_audit("Module management", 'Disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } else { - db_pandora_audit("Module management", 'Fail to disable ' . $disable_module); + db_pandora_audit("Module management", 'Fail to disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } ui_print_result_message ($result, diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index dc606ad1f5..ff06f4c4f7 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -139,7 +139,7 @@ if (($policy_page) || (isset($agent))) { echo ''; } echo ''; - echo __("Type"); + echo __("

Type

"); html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' ); html_print_input_hidden ('edit_module', 1); echo ''; @@ -607,7 +607,7 @@ foreach ($modules as $module) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) $table->colspan[$i - 1][0] = 10; else - $table->colspan[$i - 1][0] = 8; + $table->colspan[$i - 1][0] = 9; $data = array (); } diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 1bf189c660..f9347c8b9b 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -34,6 +34,11 @@ if (is_ajax ()) { // Decrypt passwords in the component. $component['plugin_pass'] = io_output_password($component['plugin_pass']); + + $component['str_warning'] = io_safe_output($component['str_warning']); + $component['str_critical'] = io_safe_output($component['str_critical']); + $component['warning_inverse'] = (bool)$component['warning_inverse']; + $component['critical_inverse'] = (bool)$component['critical_inverse']; echo io_json_mb_encode ($component); return; diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 3bad38b982..a80ba40a23 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -179,9 +179,23 @@ if ($create_action) { db_pandora_audit("Command management", "Fail try to create alert action", false, false); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No name specified'); + } + + if ($id_alert_command == "") { + $messageAction = __('No command specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } if ($update_action) { diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 09e868f951..9ca4ea501a 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -307,9 +307,22 @@ if ($create_command) { db_pandora_audit("Command management", "Fail try to create alert command", false, false); } - ui_print_result_message ($result, + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No name specified'); + } + + if ($command == "") { + $messageAction = __('No command specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 9a6badcc24..4df1ec4be5 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -126,9 +126,24 @@ if ($create_alert) { "Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"); } - $messageAction = ui_print_result_message ($id, - __('Successfully created'), __('Could not be created'), '', true); + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + if ($id_alert_template == "") { + $messageAction = __('No template specified'); + } + + if ($id_agent_module == "") { + $messageAction = __('No module specified'); + } + + $messageAction = ui_print_result_message ($id, + __('Successfully created'), $messageAction, '', true); + + if ($id !== false) { $action_select = get_parameter('action_select'); diff --git a/pandora_console/godmode/alerts/alert_special_days.php b/pandora_console/godmode/alerts/alert_special_days.php index 03ce7a90ca..e5fbf4d21e 100644 --- a/pandora_console/godmode/alerts/alert_special_days.php +++ b/pandora_console/godmode/alerts/alert_special_days.php @@ -136,6 +136,7 @@ if ($create_special_day) { $date_check = db_get_value_filter ('date', 'talert_special_days', $filter); if ($date_check == $date) { $result = ''; + $messageAction = __('Could not be created, it already exists'); } else { $result = alerts_create_alert_special_day ($date, $same_day, $values); @@ -149,10 +150,16 @@ if ($create_special_day) { else { db_pandora_audit("Command management", "Fail try to create special day", false, false); } - - ui_print_result_message ($result, + + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } if ($update_special_day) { @@ -194,6 +201,7 @@ if ($update_special_day) { $date_check = db_get_value_filter ('date', 'talert_special_days', $filter); if ($date_check == $date) { $result = ''; + $messageAction = __('Could not be updated, it already exists'); } else { $result = alerts_update_alert_special_day ($id, $values); @@ -213,9 +221,15 @@ if ($update_special_day) { db_pandora_audit("Command management", "Fail to update special day " . $id, false, false); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be updated'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully updated'), - __('Could not be updated')); + $messageAction); } if ($delete_special_day) { diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 5fc232490a..b75b26561f 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -428,9 +428,21 @@ if ($create_template) { json_encode($values)); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No template name specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); + + /* Go to previous step in case of error */ if ($result === false) $step = $step - 1; diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 8725c713aa..047eb08b75 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -274,7 +274,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types, 'module_type', '' 'width:100%'); $table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' . html_print_checkbox_extended("force_type", 'type', '', '', false, - '', 'style="margin-right: 40px;"', true); + 'style="margin-right: 40px;"', true, ''); $modules = array (); if ($module_type != '') { diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index a7056636b0..949d13269a 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -271,7 +271,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types, $table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' . html_print_checkbox_extended ("force_type", 'type', '', '', false, - '', 'style="margin-right: 40px;"', true); + 'style="margin-right: 40px;"', true, ''); $modules = array (); if ($module_type != '') { diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 152369943c..eaeae908cb 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -125,7 +125,7 @@ $table->data[4][1] .= html_print_input_text ('max_warning', $max_warning, '', 5, 15, true) . ''; $table->data[4][1] .= ''.__('Str.').'  '; $table->data[4][1] .= html_print_input_text ('str_warning', $str_warning, - '', 5, 15, true) . ''; + '', 5, 64, true) . ''; $table->data[4][1] .= '
'.__('Inverse interval').''; $table->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true); @@ -142,7 +142,7 @@ $table->data[5][1] .= html_print_input_text ('max_critical', $max_critical, '', 5, 15, true) . ''; $table->data[5][1] .= ''.__('Str.').'  '; $table->data[5][1] .= html_print_input_text ('str_critical', $str_critical, - '', 5, 15, true) . ''; + '', 5, 64, true) . ''; $table->data[5][1] .= '
'.__('Inverse interval').''; $table->data[5][1] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true); diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 564c179f67..957720f59c 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -195,7 +195,8 @@ if ($add_module) { "')"); if (count($id_agent_modules) > 0 && $id_agent_modules != '') { - $order = db_get_row_sql("SELECT `field_order` from tgraph_source ORDER BY `field_order` DESC"); + $order = db_get_row_sql("SELECT `field_order` from tgraph_source WHERE id_graph=$id_graph ORDER BY `field_order` DESC"); + $order = $order['field_order']; foreach($id_agent_modules as $id_agent_module){ $order++; @@ -207,8 +208,13 @@ if ($add_module) { } if ($delete_module) { + $id_graph = get_parameter('id'); + $deleteGraph = get_parameter('delete'); + $order_val = db_get_value('field_order', 'tgraph_source', 'id_gs', $deleteGraph); $result = db_process_sql_delete('tgraph_source', array('id_gs' => $deleteGraph)); + db_process_sql ('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val); + } if ($change_weight) { diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index d323727aa6..b935f4fc13 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -222,7 +222,7 @@ $table->data[36][0] = __('Include agents manually disabled'); $table->data[36][1] = __('Yes').'   '.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).'  '; $table->data[36][1] .= __('No').'   '.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true); -$table->data[37][0] = __('audit log directory') . +$table->data[37][0] = __('Audit log directory') . ui_print_help_tip (__("Directory where audit log is stored."), true); $table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 00a968fc04..fa471659b6 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -83,13 +83,8 @@ $table_behaviour->data[$row][1] = html_print_checkbox('paginate_module', 1, $row++; $table_behaviour->data[$row][0] = __('Display data of proc modules in other format'); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('render_proc', 1, '', - $config["render_proc"], true) . - '  '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('render_proc', 0, '', - $config["render_proc"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('render_proc', 1, + $config['render_proc'], true); $row++; $table_behaviour->data[$row][0] = __('Display text proc modules have state is ok'); @@ -103,13 +98,8 @@ $row++; //Daniel maya 02/06/2016 Display menu with click --INI $table_behaviour->data[$row][0] = __('Click to display lateral menus'). ui_print_help_tip(__('When enabled, the lateral menus are shown when left clicking them, instead of hovering over them'), true); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('click_display', 1, '', - $config["click_display"], true) . - '  '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('click_display', 0, '', - $config["click_display"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('click_display', 1, + $config['click_display'], true); $row++; //Daniel maya 02/06/2016 Display menu with click --END @@ -126,13 +116,8 @@ if (enterprise_installed()) { $table_behaviour->data[$row][0] = __('Classic menu mode'). ui_print_help_tip(__('Text menu options always visible, don\'t hide'), true); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('classic_menu', 1, '', - $config["classic_menu"], true) . - '  '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('classic_menu', 0, '', - $config["classic_menu"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('classic_menu', 1, + $config['classic_menu'], true); $row++; echo "
"; @@ -398,41 +383,31 @@ if(enterprise_installed()) { $row++; } -$table_styles->data[$row][0] = __('Disable logo in graphs'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) . - '  '; +if (enterprise_installed()){ + $table_styles->data[$row][0] = __('Disable logo in graphs'); + $table_styles->data[$row][1] = html_print_checkbox('fixed_graph', 1, + $config['fixed_graph'], true); + $row++; +} + /* Hello there! :) We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. */ - -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button_extended ('fixed_graph', 0, '', $config["fixed_graph"], $open, '','',true, $open,'visualmodal'); -$row++; $table_styles->data[$row][0] = __('Disable helps'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('disable_help', 1, '', $config["disable_help"], true) . - '  '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('disable_help', 0, '', $config["disable_help"], true); +$table_styles->data[$row][1] = html_print_checkbox('disable_help', 1, + $config['disable_help'], true); $row++; $table_styles->data[$row][0] = __('Fixed header'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) . - '  '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true); +$table_styles->data[$row][1] = html_print_checkbox('fixed_header', 1, + $config['fixed_header'], true); $row++; $table_styles->data[$row][0] = __('Fixed menu'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) . - '  '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true); +$table_styles->data[$row][1] = html_print_checkbox('fixed_menu', 1, + $config['fixed_menu'], true); $row++; // For 5.1 Autohidden menu feature @@ -441,11 +416,8 @@ $table_styles->data['autohidden'][1] = html_print_checkbox('autohidden_menu', 1, $config['autohidden_menu'], true); $table_styles->data[$row][0] = __('Visual effects and animation'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('visual_animation', 1, '', $config["visual_animation"], true) . - '  '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('visual_animation', 0, '', $config["visual_animation"], true); +$table_styles->data[$row][1] = html_print_checkbox('visual_animation', 1, + $config['visual_animation'], true); echo "
"; echo "" . __('Style configuration') . ""; @@ -465,10 +437,8 @@ $table_gis->data = array (); $table_gis->data[$row][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); -$table_gis->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'  '; -$table_gis->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true); +$table_gis->data[$row][1] = html_print_checkbox('gis_label', 1, +$config['gis_label'], true); $row++; $listIcons = gis_get_array_list_icons(); @@ -558,10 +528,8 @@ $row++; $table_font->data[$row][0] = __('Show unit along with value in reports') . ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true); -$table_font->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('simple_module_value', 1, '', $config["simple_module_value"], true).'  '; -$table_font->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('simple_module_value', 0, '', $config["simple_module_value"], true); +$table_font->data[$row][1] = html_print_checkbox('simple_module_value', 1, +$config['simple_module_value'], true); $row++; echo "
"; @@ -647,8 +615,8 @@ $table_chars->data[$row][1] = html_print_input_text ('custom_graph_width', $row++; $table_chars->data[$row][0] = __('Use round corners'); -$table_chars->data[$row][1] = __('Yes').' '.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'  '; -$table_chars->data[$row][1] .= __('No').' '.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true); +$table_chars->data[$row][1] = html_print_checkbox('round_corner', 1, +$config['round_corner'], true); $row++; $table_chars->data[$row][0] = __('Type of module charts'); @@ -876,14 +844,8 @@ $table_other->data['custom_report_front-footer'][1] = html_print_textarea('custo $table_other->data[$row][0] = __('Show QR Code icon in the header'); -$table_other->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('show_qr_code_header', 1, '', - $config["show_qr_code_header"], true) . - '  '; -$table_other->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('show_qr_code_header', 0, '', - $config["show_qr_code_header"], true); - +$table_other->data[$row][1] = html_print_checkbox('show_qr_code_header', 1, +$config['show_qr_code_header'], true); $row++; $table_other->data[$row][0] = __('Custom graphviz directory') . @@ -903,13 +865,8 @@ $row++; $table_other->data[$row][0] = __('Show only the group name'); $table_other->data[$row][0] .= ui_print_help_tip( __('Show the group name instead the group icon.'), true); -$table_other->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('show_group_name', 1, '', - $config["show_group_name"], true) . - '  '; -$table_other->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('show_group_name', 0, '', - $config["show_group_name"], true); + html_print_checkbox('show_group_name', 1, + $config['show_group_name'], true); $row++; $table_other->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true); diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 2762891d1e..7334985178 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -153,6 +153,8 @@ if ($create_user) { } if (html_print_csrf_error()) return; + $user_is_admin = (int) get_parameter ('is_admin', 0); + $values = array (); $values['id_user'] = (string) get_parameter ('id_user'); $values['fullname'] = (string) get_parameter ('fullname'); @@ -163,7 +165,7 @@ if ($create_user) { $values['email'] = (string) get_parameter ('email'); $values['phone'] = (string) get_parameter ('phone'); $values['comments'] = (string) get_parameter ('comments'); - $values['is_admin'] = (int) get_parameter ('is_admin', 0); + $values['is_admin'] = $user_is_admin; $values['language'] = get_parameter ('language', 'default'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); @@ -191,9 +193,9 @@ if ($create_user) { $values['last_pass_change'] = date ("Y/m/d H:i:s", get_system_time()); if(defined('METACONSOLE')) { $values['metaconsole_access'] = get_parameter ('metaconsole_access', 'basic'); - $values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0'); + $values['metaconsole_agents_manager'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_agents_manager', '0')); $values['metaconsole_assigned_server'] = get_parameter ('metaconsole_assigned_server', ''); - $values['metaconsole_access_node'] = get_parameter ('metaconsole_access_node', '0'); + $values['metaconsole_access_node'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_access_node', '0')); } } $values["not_login"] = (bool)get_parameter ('not_login', false); @@ -718,12 +720,11 @@ $(document).ready (function () { $('input:radio[name="is_admin"]').change(function() { if($('#radiobtn0002').prop('checked')) { $('#user_configuration_table-metaconsole_agents_manager').show(); - $('#user_configuration_table-metaconsole_assigned_server').show(); $('#user_configuration_table-metaconsole_access_node').show(); } else { $('#user_configuration_table-metaconsole_agents_manager').hide(); - $('#user_configuration_table-metaconsole_assigned_server').hide(); + $('#user_configuration_table-metaconsole_assigned_server').show(); $('#user_configuration_table-metaconsole_access_node').hide(); } }); diff --git a/pandora_console/images/groups_small/application_osx.png b/pandora_console/images/groups_small/application_osx.png new file mode 100644 index 0000000000..14a1a6e2b6 Binary files /dev/null and b/pandora_console/images/groups_small/application_osx.png differ diff --git a/pandora_console/images/groups_small/database.png b/pandora_console/images/groups_small/database.png new file mode 100644 index 0000000000..57b46d4136 Binary files /dev/null and b/pandora_console/images/groups_small/database.png differ diff --git a/pandora_console/images/tip_border.png b/pandora_console/images/tip_border.png new file mode 100755 index 0000000000..a7a9663a31 Binary files /dev/null and b/pandora_console/images/tip_border.png differ diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 070ce03a2a..f50b5b9d87 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -38,6 +38,9 @@ $get_event_name = (bool) get_parameter ('get_event_name'); $meta = get_parameter ('meta', 0); $history = get_parameter ('history', 0); $table_events = get_parameter('table_events', 0); +$total_events = (bool)get_parameter('total_events'); +$total_event_graph = (bool)get_parameter('total_event_graph'); +$graphic_event_group = (bool)get_parameter('graphic_event_group'); if ($get_event_name) { $event_id = get_parameter ('event_id'); @@ -605,4 +608,37 @@ if ($get_list_events_agents) { echo $returned_list; return; } + +if ($total_events) { + global $config; + + $sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento '; + if ($config['event_view_hr']) { + $sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - ' . $config['event_view_hr'] * SECONDS_1HOUR . ')'; + } + + $system_events = db_get_value_sql($sql_count_event); + echo $system_events; + return; +} + +if ($total_event_graph) { + global $config; + + require_once($config["homedir"] . '/include/functions_graph.php'); + + $prueba = grafico_eventos_total("", 280, 150, false, true); + echo $prueba; + return; +} + +if ($graphic_event_group) { + global $config; + + require_once($config["homedir"] . '/include/functions_graph.php'); + + $prueba = grafico_eventos_grupo(280, 150, "", false, true); + echo $prueba; + return; +} ?> diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 0a8e18e120..ed8fa76db7 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,8 +22,8 @@ /** * Pandora build version and version */ -$build_version = 'PC181022'; -$pandora_version = 'v7.0NG.727'; +$build_version = 'PC181025'; +$pandora_version = 'v7.0NG.728'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 7101f960de..45f0a22db6 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -14,7 +14,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null) { +function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = "utf8") { global $config; if ($host === null) @@ -42,6 +42,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, } db_change_cache_id ($db, $host); + mysqli_set_charset($connect_id, $charset); + mysqli_select_db($connect_id, $db); } else { @@ -52,6 +54,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, db_change_cache_id ($db, $host); + @mysql_set_charset($connect_id, $charset); + mysql_select_db($db, $connect_id); } @@ -1198,47 +1202,6 @@ function mysql_db_get_type_field_table($table, $field) { } } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function mysql_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = mysql_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - if ($config["mysqli"]) { - $config['history_db_connection'] = mysqli_connect_db ($config['history_db_host'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_name'], $config['history_db_port'], false); - } - else { - $config['history_db_connection'] = mysql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - } - if ($config['history_db_connection'] !== false) { - $history_count = mysql_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} - function mysql_get_fields($table) { global $config; diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index a651eeffa7..4e7cec79f4 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -1476,42 +1476,6 @@ function oracle_list_all_field_table($table_name, $return_mode = 'array') { } } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function oracle_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = oracle_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - $config['history_db_connection'] = oracle_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - if ($config['history_db_connection'] !== false) { - $history_count = oracle_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} - /** * Process a file with an oracle schema sentences. * Based on the function which installs the pandoradb.sql schema. diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index 7b1bd56ec0..1b74f21b07 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -1055,40 +1055,5 @@ function postgresql_db_get_type_field_table($table, $field) { return pg_field_type($result, $field); } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function postgresql_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = postgresql_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - $config['history_db_connection'] = postgresql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - if ($config['history_db_connection'] !== false) { - $history_count = postgresql_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 3a25255ad8..830028ae7a 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1369,10 +1369,11 @@ function is_metaconsole() { * * @return bool */ -function is_management_allowed() { +function is_management_allowed($hkey = '') { global $config; return ( (is_metaconsole() && $config["centralized_management"]) - || (!is_metaconsole() && !$config["centralized_management"])); + || (!is_metaconsole() && !$config["centralized_management"]) + || (!is_metaconsole() && $config["centralized_management"]) && $hkey == hash('sha256', db_get_value ('value', 'tupdate_settings', 'token', 'customer_key'))); } /** @@ -3128,16 +3129,23 @@ function series_type_graph_array($data, $show_elements_graph){ if (isset($show_elements_graph['labels']) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0)){ - $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']] . ' ' ; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; } else{ if(strpos($key, 'baseline') !== false){ - $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . - $value['module_name'] . ' Baseline '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .'Baseline '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . 'Baseline '; } else{ - $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . - $value['module_name'] . ': '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; } } @@ -3173,6 +3181,11 @@ function series_type_graph_array($data, $show_elements_graph){ !$show_elements_graph['fullscale'] && strpos($key, 'max') !== false){ $data_return['series_type'][$key] = $type_graph; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; + $data_return['legend'][$key] = $name_legend; if($show_elements_graph['type_mode_graph']){ $data_return['legend'][$key] .= @@ -3234,6 +3247,10 @@ function series_type_graph_array($data, $show_elements_graph){ __('Percentil') . ' ' . $config['percentil'] . 'º ' . __('of module') . ' '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; $data_return['legend'][$key] .= $name_legend; $data_return['legend'][$key] .= remove_right_zeros( number_format( diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index fe61fc675e..1f05227779 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -28,13 +28,14 @@ require_once($config['homedir'] . '/include/functions_users.php'); * * @param int $id_agent The agent id. * @param boolean $show_disabled Show the agent found althought it is disabled. By default false. + * @param boolean $force_meta * * @return boolean The result to check if the agent is in the DB. */ -function agents_check_agent_exists($id_agent, $show_disabled = true) { +function agents_check_agent_exists($id_agent, $show_disabled = true, $force_meta = false) { $agent = db_get_value_filter( 'id_agente', - 'tagente', + $force_meta ? 'tmetaconsole_agent' : 'tagente', array('id_agente' => $id_agent, 'disabled' => !$show_disabled) ); @@ -2729,17 +2730,18 @@ function agents_count_agents_filter ($filter = array(), $access = "AR") { * * @param int Id agent * @param string ACL access bit + * @param boolean $force_meta * * @return True if user has access, false if user has not permissions and * null if id agent does not exist */ -function agents_check_access_agent ($id_agent, $access = "AR") { +function agents_check_access_agent ($id_agent, $access = "AR", $force_meta = false) { global $config; - if (users_access_to_agent($id_agent, $access)) return true; + if (users_access_to_agent($id_agent, $access, false, $force_meta)) return true; // If agent exist return false - if (agents_check_agent_exists($id_agent)) return false; + if (agents_check_agent_exists($id_agent, true, $force_meta)) return false; // Return null otherwise return null; } diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index c3870164b3..479929c619 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -30,7 +30,6 @@ include_once($config['homedir'] . "/include/functions_network_components.php"); include_once($config['homedir'] . "/include/functions_netflow.php"); include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_planned_downtimes.php"); -include_once($config['homedir'] . "/include/functions_db.php"); enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); @@ -100,7 +99,7 @@ function returnError($typeError, $returnType = 'string') { break; default: returnData("string", - array('type' => 'string', 'data' => __($typeError))); + array('type' => 'string', 'data' => __($returnType))); break; } } @@ -9278,18 +9277,27 @@ function api_get_agent_id($trash1, $trash2, $data, $returnType) { * Agent alias for a given id * * @param int $id_agent + * @param int $id_node Only for metaconsole + * @param $thrash1 Don't use. + * @param $returnType * **/ -// http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora -function api_get_agent_alias($id_agent, $trash1, $trash2, $returnType) { - if (defined ('METACONSOLE')) { - return; +// http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora +// http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora +function api_get_agent_alias($id_agent, $id_node, $trash1, $returnType) { + $table_agent_alias = 'tagente'; + $force_meta=false; + + if (is_metaconsole()) { + $table_agent_alias = 'tmetaconsole_agent'; + $force_meta = true; + $id_agent = db_get_value_sql("SELECT id_agente FROM tmetaconsole_agent WHERE id_tagente = $id_agent AND id_tmetaconsole_setup = $id_node"); } - if (!util_api_check_agent_and_print_error($id_agent, $returnType)) return; + if (!util_api_check_agent_and_print_error($id_agent, $returnType, 'AR', $force_meta)) return; $sql = sprintf('SELECT alias - FROM tagente + FROM ' . $table_agent_alias . ' WHERE id_agente = %d', $id_agent); $value = db_get_value_sql($sql); @@ -9521,8 +9529,11 @@ function api_set_create_event($id, $trash1, $other, $returnType) { return; } $id_agent = $agent_cache['id_tagente']; + } + $values['id_agente'] = $id_agent; + if (!util_api_check_agent_and_print_error($id_agent, 'string', 'AR')) { if (is_metaconsole()) metaconsole_restore_db(); return; @@ -11302,6 +11313,7 @@ function api_get_cluster_status($id_cluster, $trash1, $trash2, $returnType) { if ($value === false) { returnError('id_not_found', $returnType); + return; } $data = array('type' => 'string', 'data' => $value); @@ -11319,6 +11331,7 @@ function api_get_cluster_id_by_name($cluster_name, $trash1, $trash2, $returnType $value = cluster_get_id_by_name($cluster_name); if(($value === false) || ($value === null)){ returnError('id_not_found', $returnType); + return; } $cluster_group = clusters_get_group($value); @@ -11473,10 +11486,10 @@ function api_get_cluster_items ($cluster_id){ // AUX FUNCTIONS ///////////////////////////////////////////////////////////////////// -function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR") { +function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR", $force_meta = false) { global $config; - $check_agent = agents_check_access_agent($id_agent, $access); + $check_agent = agents_check_access_agent($id_agent, $access, $force_meta); if ($check_agent === true) return true; if ($check_agent === false || !check_acl($config['id_user'], 0, $access)) { @@ -11488,282 +11501,8 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access = return false; } -function api_get_user_info($thrash1, $thrash2, $other, $returnType) { - if (defined ('METACONSOLE')) { - return; - } - - $separator = ';'; - - $other = json_decode(base64_decode($other['data']),true); - - $sql = 'select * from tusuario where id_user = "'.$other[0]['id_user'].'" and password = "'.$other[0]['password'].'"'; - - $user_info = db_get_all_rows_sql($sql); - - if (count($user_info) > 0 and $user_info !== false) { - $data = array('type' => 'array', 'data' => $user_info); - returnData($returnType, $data, $separator); - } - else { - return 0; - } -} -/* - -This function receives different parameters to process one of these actions the logging process in our application from the records in the audit of pandora fms, to avoid concurrent access of administrator users, and optionally to prohibit access to non-administrator users: - -Parameter 0 - -The User ID that attempts the action is used to check the status of the application for access. - -Parameter 1 - -Login, logout, exclude, browse. - -These requests receive a response that we can treat as we consider, this function only sends answers, does not perform any action in your application, you must customize them. - -Login action: free (register our access), taken, denied (if you are not an administrator user and parameter four is set to 1, register the expulsion). - -Browse action: It has the same answers as login, but does not register anything in the audit. - -Logout action: It records the deslogeo but does not send a response. - -All other actions do not return a response, - -Parameter 2 - -IP address of the application is also used to check the status of the application for access. - -Parameter 3 - -Name of the application, it is also used to check the status of the application for access. - -Parameter 4 - -If you mark 1 you will avoid the access to the non-administrators users, returning the response `denied' and registering that expulsion in the audit of pandora fms. - -*/ - - - -function api_set_access_process($thrash1, $thrash2, $other, $returnType) { - if (defined ('METACONSOLE')) { - return; - } - - $other['data'] = explode('|',$other['data']); - - $sql = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario != "'.$other['data'][0].'" order by utimestamp DESC limit 1'; - $audit_concurrence = db_get_all_rows_sql($sql); - $sql_user = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario = "'.$other['data'][0].'" order by utimestamp DESC limit 1'; - $audit_concurrence_user = db_get_all_rows_sql($sql_user); - $sql2 = 'select id_usuario,utimestamp,accion from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logoff%" and id_usuario = "'.$audit_concurrence[0]['id_usuario'].'" order by utimestamp DESC limit 1'; - $audit_concurrence_2 = db_get_all_rows_sql($sql2); - - //The user trying to log in is an administrator - if(users_is_admin($other['data'][0])){ - //The admin user is trying to login - if($other['data'][1] == 'login'){ - // Check if there is an administrator user logged in prior to our last login - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ - // Check if the administrator user logged in later to us has unlogged and left the node free - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ - // The administrator user logged in later has not yet unlogged - returnData('string', array('type' => 'string', 'data' => 'taken')); - } - else{ - // The administrator user logged in later has already unlogged - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - else{ - // There is no administrator user who has logged in since then to log us in. - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'free')); - } - - } - elseif ($other['data'][1] == 'logout') { - // The administrator user wants to log out - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); - } - elseif ($other['data'][1] == 'exclude') { - // The administrator user has ejected another administrator user who was logged in - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2] , $audit_concurrence[0]['id_usuario']); - - } - //The admin user is trying to browse - elseif ($other['data'][1] == 'browse') { - // Check if there is an administrator user logged in prior to our last login - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ - // Check if the administrator user logged in later to us has unlogged and left the node free - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ - // The administrator user logged in later has not yet unlogged - returnData('string', array('type' => 'string', 'data' => $audit_concurrence[0]['id_usuario'])); - } - else{ - // The administrator user logged in later has already unlogged - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - else{ - // There is no administrator user who has logged in since then to log us in. - returnData('string', array('type' => 'string', 'data' => 'free')); - } - - } - elseif ($other['data'][1] == 'cancelled'){ - //The administrator user tries to log in having another administrator logged in, but instead of expelling him he cancels his log in. - db_pandora_audit($other['data'][3].' cancelled access', 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'cancelled')); - } - -} -else{ - - if($other['data'][4] == 1){ - //The user trying to log in is not an administrator and is not allowed no admin access - db_pandora_audit($other['data'][3].' denied access', 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'denied')); - } - else{ - //The user trying to log in is not an administrator and is allowed no admin access - if($other['data'][1] == 'login'){ - //The user trying to login is not admin, can enter without concurrent use filter - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'free')); - - } - elseif ($other['data'][1] == 'logout') { - //The user trying to logoff is not admin - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); - } - elseif ($other['data'][1] == 'browse'){ - //The user trying to browse in an app page is not admin, can enter without concurrent use filter - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - } -} - - -function api_get_traps($thrash1, $thrash2, $other, $returnType) { - - if (defined ('METACONSOLE')) { - return; - } - - $other['data'] = explode('|',$other['data']); - - $other['data'][1] = date("Y-m-d H:i:s",$other['data'][1]); - - $sql = 'SELECT * from ttrap where timestamp >= "'.$other['data'][1].'"'; - - // $sql = 'SELECT * from ttrap where source = "'.$other['data'][0].'" and timestamp >= "'.$other['data'][1].'"'; - - if($other['data'][4]){ - $other['data'][4] = date("Y-m-d H:i:s",$other['data'][4]); - $sql .= ' and timestamp <= "'.$other['data'][4].'"'; - } - - if($other['data'][2]){ - $sql .= ' limit '.$other['data'][2]; - } - - if($other['data'][3]){ - $sql .= ' offset '.$other['data'][3]; - } - - if($other['data'][5]){ - $sql .= ' and status = 0'; - } - - if(sizeof($other['data']) == 0){ - $sql = 'SELECT * from ttrap'; - } - - - $traps = db_get_all_rows_sql($sql); - - if($other['data'][6]){ - - foreach ($traps as $key => $value) { - - if(!strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'false'){ - unset($traps[$key]); - } - - if(strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'true'){ - unset($traps[$key]); - } - - } - - } - - $traps_json = json_encode($traps); - - if (count($traps) > 0 and $traps !== false) { - returnData('string', array('type' => 'string', 'data' => $traps_json)); - } - else { - return 0; - } - -} - -function api_set_validate_traps ($id, $thrash2, $other, $thrash3) { - - if (defined ('METACONSOLE')) { - return; - } - - if($id == 'all'){ - $result = db_process_sql_update('ttrap',array('status' => 1)); - } - else{ - $result = db_process_sql_update('ttrap', - array('status' => 1), array('id_trap' => $id)); - } - - if (is_error($result)) { - // TODO: Improve the error returning more info - returnError('error_update_trap', __('Error in trap update.')); - } - else { - returnData('string', - array('type' => 'string', - 'data' => __('Validated traps.'))); - } - } - - function api_set_delete_traps ($id, $thrash2, $other, $thrash3) { - - if (defined ('METACONSOLE')) { - return; - } - - if($id == 'all'){ - $result = db_process_sql ('delete from ttrap'); - } - else{ - $result = db_process_sql_delete('ttrap',array('id_trap' => $id)); - } - - if (is_error($result)) { - // TODO: Improve the error returning more info - returnError('error_delete_trap', __('Error in trap delete.')); - } - else { - returnData('string', - array('type' => 'string', - 'data' => __('Deleted traps.'))); - } - } ?> diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 39ecde4b40..eca1a67eeb 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -43,13 +43,13 @@ function db_select_engine() { } } -function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true) { +function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = "utf8") { global $config; static $error = 0; switch ($config["dbtype"]) { case "mysql": - $return = mysql_connect_db($host, $db, $user, $pass, $port); + $return = mysql_connect_db($host, $db, $user, $pass, $port, $charset); break; case "postgresql": $return = postgresql_connect_db($host, $db, $user, $pass, $port); @@ -1656,28 +1656,12 @@ function db_get_type_field_table($table, $field) { } /** - * Get the element count of a table. + * Get the columns of a table. * - * @param string $sql SQL query to get the element count. + * @param string $table table to retrieve columns. * - * @return int Return the number of elements in the table. + * @return array with column names. */ -function db_get_table_count($table, $search_history_db = false) { - global $config; - - switch ($config["dbtype"]) { - case "mysql": - return mysql_db_get_table_count($table, $search_history_db); - break; - case "postgresql": - return postgresql_db_get_table_count($table, $search_history_db); - break; - case "oracle": - return oracle_db_get_table_count($table, $search_history_db); - break; - } -} - function db_get_fields($table) { global $config; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 39c5fa59ae..ce5d2f0c42 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -850,25 +850,14 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret if ($filter == '') { $filter = '1 = 1'; } - - switch ($config["dbtype"]) { - case "mysql": - case "postgresql": - $sql = sprintf ("SELECT DISTINCT tevento.* - FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent - WHERE %s %s - ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit); - break; - case "oracle": - $sql = sprintf ("SELECT * - FROM tevento - WHERE %s %s AND rownum <= %d - ORDER BY utimestamp DESC", $agent_condition, $filter, $limit); - break; - } + + $sql = sprintf ("SELECT DISTINCT tevento.* + FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent + WHERE %s %s + ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit); $result = db_get_all_rows_sql ($sql); - + if ($result === false) { if ($return) { $returned = ui_print_info_message (__('No events'), '', true); @@ -997,8 +986,6 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret $data[4] = "". agents_get_alias($event["id_agente"]). ""; - - // ui_print_agent_name ($event["id_agente"], true, 25, '', true); // for System or SNMP generated alerts } elseif ($event["event_type"] == "system") { @@ -1162,7 +1149,7 @@ function events_print_type_description ($type, $return = false) { break; case "going_down_critical": case "going_up_critical": //This is to be backwards compatible - $output .= __('Going down to critical state'); + $output .= __('Going up to critical state'); break; case "going_up_normal": case "going_down_normal": //This is to be backwards compatible @@ -1863,15 +1850,20 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor // Substitute each macro if (strpos($target, '_agent_address_') !== false) { if ($meta) { - $server = metaconsole_get_connection_by_id ($server_id); - metaconsole_connect($server); - } - - $target = str_replace('_agent_address_', $event['id_agente'], $target); - - if($meta) { - metaconsole_restore_db_force(); + $agente_table_name = 'tmetaconsole_agent'; + $filter = array( + 'id_tagente' => $event['id_agente'], + 'id_tmetaconsole_setup' => $server_id + ); + } else { + $agente_table_name = 'tagente'; + $filter = array('id_agente' => $event['id_agente']); } + + $ip = db_get_value_filter('direccion', $agente_table_name, $filter); + // If agent has not an ip, display N/A + if ($ip === false) $ip = __('N/A'); + $target = str_replace('_agent_address_', $ip, $target); } if (strpos($target, '_agent_id_') !== false) { $target = str_replace('_agent_id_', $event['id_agente'], $target); @@ -2677,13 +2669,14 @@ function events_page_comments ($event, $childrens_ids = array()) { } break; } - - if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) { - $comments_form = '
'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%;"', true); + + if (((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) && $config["show_events_in_local"] == false || $config["event_replication"] == false) { + $comments_form = '
'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); + $comments_form .= '
'.html_print_button(__('Add comment'),'comment_button',false,'event_comment();','class="sub next"',true).'

'; } else { - $comments_form = ''; + $comments_form = ui_print_message(__( 'If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')); } $comments = '
'.$comments_form.html_print_table($table_comments, true).'
'; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5549b56b6f..b91f23c88a 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2188,19 +2188,26 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re if ($data_agents == false) { $groups = implode(',', array_keys(users_get_groups(false, 'AR', false))); + $p_table = "tagente"; + $s_table = "tagent_secondary_group"; + if (is_metaconsole()) { + $p_table = "tmetaconsole_agent"; + $s_table = "tmetaconsole_agent_secondary_group"; + } $data = db_get_row_sql(sprintf('SELECT SUM(critical_count) AS Critical, SUM(warning_count) AS Warning, SUM(normal_count) AS Normal, SUM(unknown_count) AS Unknown %s - FROM tagente ta LEFT JOIN tagent_secondary_group tasg + FROM %s ta LEFT JOIN %s tasg ON ta.id_agente = tasg.id_agent WHERE ta.disabled = 0 AND %s (ta.id_grupo IN (%s) OR tasg.id_group IN (%s))', $show_not_init ? ', SUM(notinit_count) "Not init"' : '', + $p_table, $s_table, empty($id_agent) ? '' : "ta.id_agente = $id_agent AND", $groups, $groups @@ -2765,10 +2772,8 @@ function graph_events_validated($width = 300, $height = 200, $extra_filters = ar * @param integer width pie graph width * @param integer height pie graph height * @param string url - * @param bool if the graph required is or not for metaconsole - * @param bool if the graph required is or not for history table */ -function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = false, $history = false, $noWaterMark = true) { +function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $noWaterMark = true, $time_limit = false) { global $config; global $graphic_type; @@ -2798,26 +2803,17 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $url = str_replace( 'SELECT_id_agente_modulo', 'SELECT id_agente_modulo', $url); - - // Choose the table where search if metaconsole or not - if ($meta) { - if ($history) { - $event_table = 'tmetaconsole_event_history'; - } - else { - $event_table = 'tmetaconsole_event'; - } - $field_extra = ', agent_name'; - $groupby_extra = ', server_id'; - } - else { - $event_table = 'tevento'; - $field_extra = ''; - $groupby_extra = ''; - } + $event_table = 'tevento'; + $field_extra = ''; + $groupby_extra = ''; // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); + + if ($time_limit && $config['event_view_hr']) { + $tags_condition .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . + $config['event_view_hr'] * SECONDS_1HOUR . ")"; + } //This will give the distinct id_agente, give the id_grupo that goes //with it and then the number of times it occured. GROUP BY statement @@ -2851,13 +2847,8 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $system_events += $row["count"]; } else { - if ($meta) { - $name = mb_substr (io_safe_output($row['agent_name']), 0, 25)." (".$row["count"].")"; - } - else { - $alias = agents_get_alias($row["id_agente"]); - $name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")"; - } + $alias = agents_get_alias($row["id_agente"]); + $name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")"; $data[$name] = $row["count"]; } } @@ -2868,14 +2859,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $name = __('SYSTEM')." (".$system_events.")"; $data[$name] = $system_events; } - - /* - if ($other_events > 0) { - $name = __('Other')." (".$other_events.")"; - $data[$name] = $other_events; - } - */ - + // Sort the data arsort($data); if ($noWaterMark) { @@ -2898,7 +2882,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = * * @param string filter Filter for query in DB */ -function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true) { +function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true, $time_limit = false) { global $config; global $graphic_type; @@ -2907,23 +2891,25 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWat // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); $filter .= $tags_condition; - + if ($time_limit && $config['event_view_hr']) { + $filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")"; + } + $data = array (); $legend = array (); $total = 0; - - $where = ''; + + $where = "WHERE 1=1"; if (!users_is_admin()) { $where = 'WHERE event_type NOT IN (\'recon_host_detected\', \'system\',\'error\', \'new_agent\', \'configuration_change\')'; } - + $sql = sprintf("SELECT criticity, COUNT(id_evento) events FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent %s %s GROUP BY criticity ORDER BY events DESC", $where , $filter); - $criticities = db_get_all_rows_sql ($sql, false, false); if (empty($criticities)) { @@ -3150,9 +3136,9 @@ function graph_custom_sql_graph ($id, $width, $height, $ttl, $homeurl, "white", + true, false, - false, - "c1c1c1" + "#c1c1c1" ); break; case 'sql_graph_hbar': // horizontal bar @@ -3173,7 +3159,7 @@ function graph_custom_sql_graph ($id, $width, $height, $ttl, $homeurl, 'white', - 'c1c1c1' + '#c1c1c1' ); break; case 'sql_graph_pie': // Pie diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index eb0b730649..67f9ec9f29 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -666,6 +666,7 @@ function planned_downtimes_stop ($downtime) { function planned_downtimes_created ($values) { global $config; + $check_group = (bool) db_get_value ('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']); $check = (bool) db_get_value ('name', 'tplanned_downtime', 'name', $values['name']); $datetime_from = strtotime ($values['once_date_from'] . ' ' . $values['once_time_from']); @@ -702,6 +703,11 @@ function planned_downtimes_created ($values) { 'message' => __('Not created. Error inserting data') . ". " . __('The end day must be higher than the start day')); } + else if (!$check_group && $values['id_group'] != 0) { + return array('return' => false, + 'message' => __('Not created. Error inserting data') . ". " + . __('Group not exist')); + } else { if (trim(io_safe_output($values['name'])) != '') { if (!$check) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 74ab7e73d8..41c7ec46de 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -9802,7 +9802,7 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ return (float) (100 - ($bad_period / $period_reduced) * 100); } -function reporting_get_stats_servers($tiny = true) { +function reporting_get_stats_servers() { global $config; $server_performance = servers_get_performance(); @@ -9838,21 +9838,20 @@ function reporting_get_stats_servers($tiny = true) { $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; - if ($tiny) { + if (isset($server_performance ["total_network_modules"])) { $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Remote modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_remote_modules"]) . ''; + $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_network_modules"]) . ''; - /* Hello there! :) -We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( -You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. -*/ - - $tdata[2] = '' . format_numeric($server_performance ["remote_modules_rate"], 2) . ''; + $tdata[2] = '' . + format_numeric($server_performance["network_modules_rate"], 2) . + ''; + + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){ - $tdata[4] = "
"; + $tdata[4] = "
"; } else{ $tdata[4] = ' '; @@ -9861,134 +9860,105 @@ You can of course remove the warnings, that's why we include the source and do n $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; } - else { - if (isset($server_performance ["total_network_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_network_modules"]) . ''; - - $tdata[2] = '' . - format_numeric($server_performance["network_modules_rate"], 2) . - ''; - - - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){ - $tdata[4] = "
"; - } - else{ - $tdata[4] = ' '; - } - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_plugin_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_plugin_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["plugin_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_prediction_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_prediction_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["prediction_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_wmi_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); - $tdata[1] = '' . format_numeric($server_performance ["total_wmi_modules"]) . ''; - - $tdata[2] = '' . format_numeric($server_performance ["wmi_modules_rate"], 2) . ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_web_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); - $tdata[1] = '' . - format_numeric($server_performance ["total_web_modules"]) . - ''; - - $tdata[2] = '' . - format_numeric($server_performance ["web_modules_rate"], 2) . - ''; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - + + if (isset($server_performance ["total_plugin_modules"])) { $tdata = array(); - $tdata[0] = '
'; - $table_srv->colspan[count($table_srv->data)][0] = 4; - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; + $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_plugin_modules"]) . ''; + $tdata[2] = '' . format_numeric($server_performance ["plugin_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; - switch ($config["dbtype"]) { - case "mysql": - $system_events = db_get_value_sql( - 'SELECT SQL_NO_CACHE COUNT(id_evento) - FROM tevento'); - break; - case "postgresql": - case "oracle": - $system_events = db_get_value_sql( - 'SELECT COUNT(id_evento) - FROM tevento'); - break; - } - - - - $tdata = array(); - $tdata[0] = html_print_image('images/lightning_go.png', true, - array('title' => __('Total events'), 'width' => '25px')); - $tdata[1] = '' . - format_numeric($system_events) . ''; - - /* Hello there! :) -We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( -You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. -*/ - - if($system_events > 50000 && !enterprise_installed()){ - $tdata[2] = "
"; - } - - else{ - $tdata[3] = " "; - } - $table_srv->colspan[count($table_srv->data)][1] = 2; $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; } + if (isset($server_performance ["total_prediction_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_prediction_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["prediction_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_wmi_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); + $tdata[1] = '' . format_numeric($server_performance ["total_wmi_modules"]) . ''; + + $tdata[2] = '' . format_numeric($server_performance ["wmi_modules_rate"], 2) . ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_web_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); + $tdata[1] = '' . + format_numeric($server_performance ["total_web_modules"]) . + ''; + + $tdata[2] = '' . + format_numeric($server_performance ["web_modules_rate"], 2) . + ''; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec '; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + $tdata = array(); + $tdata[0] = '
'; + $table_srv->colspan[count($table_srv->data)][0] = 4; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + $tdata = array(); + $tdata[0] = html_print_image('images/lightning_go.png', true, + array('title' => __('Total events'), 'width' => '25px')); + $tdata[1] = '' . + html_print_image('images/spinner.gif',true) . ''; + + /* Hello there! :) +We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( +You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. +*/ + + if($system_events > 50000 && !enterprise_installed()){ + $tdata[2] = "
"; + } else { + $tdata[3] = " "; + } + $table_srv->colspan[count($table_srv->data)][1] = 2; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + $output = '
' . __('Server performance') . '' . html_print_table($table_srv, true) . '
'; - + + $output .= ''; + return $output; } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 8f8da81808..7f92495e89 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -383,7 +383,7 @@ function reporting_html_SLA($table, $item, $mini) { } } - if(isset($item['data'])){ + if(!(!isset($item['data']) && $hide_notinit_agent == 1)) { $table1 = new stdClass(); $table1->width = '99%'; @@ -473,12 +473,22 @@ function reporting_html_SLA($table, $item, $mini) { foreach ($item['data'] as $sla) { if(isset($sla)){ $the_first_men_time = get_agent_first_time(io_safe_output($sla['agent'])); - if (!$hide_notinit_agent) { - //first_table - $row = array(); - $row[] = $sla['agent']; - $row[] = $sla['module']; + //first_table + $row = array(); + $row[] = $sla['agent']; + $row[] = $sla['module']; + + if(is_numeric($sla['dinamic_text'])){ + $row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " . + sla_truncate($sla['min'], $config['graph_precision']); + } + else{ + $row[] = $sla['dinamic_text']; + } + $row[] = round($sla['sla_limit'], 2) . "%"; + + if (!$hide_notinit_agent) { if(is_numeric($sla['dinamic_text'])){ $row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " . sla_truncate($sla['min'], $config['graph_precision']); @@ -647,6 +657,12 @@ function reporting_html_SLA($table, $item, $mini) { $table->colspan['checks_global']['cell'] = 2; $table->data['checks_global']['cell'] = html_print_table($table3, true); } + else { + $table->colspan['error']['cell'] = 3; + $table->data['error']['cell'] = + __('There are no Agent/Modules defined'); + } + if (!empty($item['charts'])) { $table1 = new stdClass(); $table1->width = '99%'; @@ -2321,7 +2337,7 @@ function reporting_html_availability(&$table, $item) { global $config; - if (!empty($item["data"])) { + if (!empty($item["data"]) || $hide_notinit_agent !=1) { $table1 = new stdClass(); $table1->width = '99%'; $table1->data = array (); diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 2f2e899143..fb3305c323 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -468,8 +468,6 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals enterprise_include_once ('meta/include/functions_ui_meta.php'); include_graphs_dependencies(); - $strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); - $is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente)); if ($is_extra === ENTERPRISE_NOT_HOOK) { @@ -483,9 +481,13 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals return; } + // Get the agent info $agent = db_get_row ("tagente", "id_agente", $id_agente); - - if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) { + if ($agent == false) return; + + // Check all groups + $groups = agents_get_all_groups_agent($id_agente, $agent["id_grupo"], is_metaconsole()); + if (! check_acl_one_of_groups ($config["id_user"], $groups, "AR") && ! check_acl_one_of_groups ($config["id_user"], $groups, "AW") && !$is_extra) { db_pandora_audit("ACL Violation", "Trying to access Agent General Information"); require_once ("general/noaccess.php"); @@ -522,7 +524,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals $hashdata = $user.$pwd_deserialiced['auth_token']; $hashdata = md5($hashdata); - $url = $server_data["server_url"] . "/index.php?" . + $url = "//" . $server_data["server_url"] . "/index.php?" . "sec=estado&" . "sec2=operation/agentes/ver_agente&" . "id_agente=" . $agent["id_agente"] . "&" . @@ -608,7 +610,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals $go_to_agent = '
'; if($agent["id_os"] != 100){ - $go_to_agent .= ''; + $go_to_agent .= ''; $go_to_agent .= html_print_submit_button (__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true); } else{ diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 92b7f81f18..94b618334b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1961,6 +1961,23 @@ function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png', $is echo $output; } +function ui_print_help_tip_border ($text, $return = false, $img = 'images/tip_border.png', $is_relative = false) { + $output = + '' . + html_print_image ( + $img, + true, + array('title' => $text), + false, + $is_relative && is_metaconsole() + ) . + ''; + + if ($return) + return $output; + echo $output; +} + /** * Powerful debug function that also shows a backtrace. * diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 56d809da67..81e9549fdd 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -476,20 +476,20 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['background_row_2']['items'] = array('background', 'datos'); $form_items['background_row_2']['html'] = '' . __('Original Size') . ' - ' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub"', true) . ''; + ' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub vs_button_ghost"', true) . ''; $form_items['background_row_3'] = array(); $form_items['background_row_3']['items'] = array('background', 'datos'); $form_items['background_row_3']['html'] = '' . __('Aspect ratio') . ' - ' . html_print_button(__('Width proportional'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub"', true) . ''; + ' . html_print_button(__('Proportional Width'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub vs_button_ghost"', true) . ''; $form_items['background_row_4'] = array(); $form_items['background_row_4']['items'] = array('background', 'datos'); $form_items['background_row_4']['html'] = ' - ' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub"', true) . ''; + ' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub vs_button_ghost"', true) . ''; $form_items['percentile_bar_row_1'] = array(); diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 8a412dc505..1063c26122 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2236,17 +2236,25 @@ function pandoraFlotArea( graph_id, values, legend, } $('#overview_' + graph_id).css('display', 'none'); - + if (menu) { var parent_height; $('#menu_overview_' + graph_id).click(function() { $('#overview_' + graph_id).toggle(); }); - $("#menu_export_csv_"+graph_id) - .click(function (event) { - event.preventDefault(); + $("#menu_export_csv_"+graph_id).click(function (e) { + e.preventDefault(); plot.exportDataCSV(); + var es_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + if(es_firefox){ + $("#dialog").css('visibility', 'visible').dialog(); + } + delete data_base[0].threshold; + plot = $.plot($('#' + graph_id), data_base, + $.extend(true, {}, options, { + legend: { show: true } + })); }); $('#menu_threshold_' + graph_id).click(function() { diff --git a/pandora_console/include/help/en/help_eventview.php b/pandora_console/include/help/en/help_eventview.php index 58bcc49d5a..4d2a5c8d1a 100644 --- a/pandora_console/include/help/en/help_eventview.php +++ b/pandora_console/include/help/en/help_eventview.php @@ -11,7 +11,7 @@

Validate

"Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validated event
- "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Event not validated + "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?>
- Event not validated
@@ -27,7 +27,8 @@

Actions

"Validate event", "alt" => "Validate event")); ?> - Validate event
"Delete event", "alt" => "Delete event")); ?> - Delete event
- "Create incident from event", "alt" => "Create incident from event")); ?> - Create incident from event + "Show more", "alt" => "Show more")); ?> - Show more
+ "In progress", "alt" => "In progress")); ?> - In progress
 
diff --git a/pandora_console/include/help/en/help_module_macros.php b/pandora_console/include/help/en/help_module_macros.php index 855da023e3..705b6f92e9 100644 --- a/pandora_console/include/help/en/help_module_macros.php +++ b/pandora_console/include/help/en/help_module_macros.php @@ -30,43 +30,43 @@ This macros can be used in module alerts.

-

Si el módulo es de tipo analisis de módulo web:

+

IF THE MODULE IS A WEB MODULE ANALYSIS TYPE:

- Las macros dinámicas tendrán un formato especial que empieza por @ y tendrán estas posibles sustituciones: +Dynamic macros will have a special format starting with @ and will have these possible substitutions:

  1. - @DATE_FORMAT (fecha/hora actual con formato definido por el usuario) + @DATE_FORMAT (current date/time with user-defined format)
  2. - @DATE_FORMAT_nh (horas) + @DATE_FORMAT_nh (hours)
  3. - @DATE_FORMAT_nm (minutos) + @DATE_FORMAT_nm (minutes)
  4. - @DATE_FORMAT_nd (días) + @DATE_FORMAT_nd (days)
  5. - @DATE_FORMAT_ns (segundos) + @DATE_FORMAT_ns (seconds)
  6. - @DATE_FORMAT_nM (mes) + @DATE_FORMAT_nM (month)
  7. - @DATE_FORMAT_nY (años) + @DATE_FORMAT_nY (years)

- Donde “n” puede ser un numero sin signo (positivo) o negativo. +Where "n" can be a number without a sign (positive) or negative.

- Y FORMAT sigue el standard de strftime de perl: +And FORMAT follows the standard of perl's strftime: http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm

- Ejemplos: + Examples:

 	@DATE_%Y-%m-%d %H:%M:%S
diff --git a/pandora_console/include/help/es/help_eventview.php b/pandora_console/include/help/es/help_eventview.php
index a01bf52eae..94dc475b43 100644
--- a/pandora_console/include/help/es/help_eventview.php
+++ b/pandora_console/include/help/es/help_eventview.php
@@ -11,7 +11,7 @@
 

Validar

"Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validar evento
- "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Evento no validado + "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?>
- Evento no validado
@@ -27,7 +27,8 @@

Acciones

"Validate event", "alt" => "Validate event")); ?> - Validar evento
"Delete event", "alt" => "Delete event")); ?> - Borrar evento
- "Create incident from event", "alt" => "Create incident from event")); ?> - Crear incidente del evento + "Mostrar más", "alt" => "Mostrar más")); ?> - Mostrar más
+ "En progreso", "alt" => "En progreso")); ?> - En progreso
 
diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 83418f97c1..3a8f29d6c0 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -87,15 +87,16 @@ function inner_minimap_box(param_x, param_y) { return false; } -function set_center(id) { - pos_x = (width_svg / 2) - translation[0]; - pos_y = (height_svg / 2) - translation[1]; +function set_center(id, event) { + pos_x = (width_svg / 2) - (translation[0] / scale); + pos_y = (height_svg / 2) - (translation[1] / scale); var params = []; params.push("set_center=1"); params.push("id=" + id); params.push("x=" + pos_x); params.push("y=" + pos_y); + params.push("scale=" + scale); params.push("page=operation/agentes/pandora_networkmap.view"); jQuery.ajax({ data: params.join("&"), @@ -2720,7 +2721,7 @@ function init_graph(parameter_object) { } window.scale_minimap = 4.2; window.translation = [0, 0]; - window.scale = 0.5; + window.scale = (typeof (z_dash) != "undefined") ? z_dash : 0.5; window.node_radius = 40; if (typeof (parameter_object.node_radius) != "undefined") { window.node_radius = parameter_object.node_radius; diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index f31ebb56d6..459776c5b2 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -91,8 +91,8 @@ function configure_modules_form () { $("#text-ff_event").attr ("value", 0); $("#text-post_process").attr("value", 0); $("#text-unit").attr("value", ''); - $("#text-critical_inverse").attr ("value", 0); - $("#text-warning_inverse").attr ("value", 0); + $("#checkbox-critical_inverse").attr ("value", 0); + $("#checkbox-warning_inverse").attr ("value", 0); $("#textarea_critical_instructions").attr ("value", ''); $("#textarea_warning_instructions").attr ("value", ''); $("#textarea_unknown_instructions").attr ("value", ''); @@ -138,8 +138,8 @@ function configure_modules_form () { $("#checkbox-history_data").check (); else $("#checkbox-history_data").uncheck (); - - $("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]); + + $("#dynamic_interval_select").val (data["dynamic_interval"]); $("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]); $("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]); @@ -157,8 +157,8 @@ function configure_modules_form () { $("#text-ff_event").attr ("value", (data["min_ff_event"] == 0) ? 0 : data["min_ff_event"]); $("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]); $("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]) - $("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]); - $("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]); + $("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]); + $("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]); $("#component_loading").hide (); $("#id_module_type").change (); if ($("#id_category").is("select")) { @@ -300,7 +300,7 @@ function configure_modules_form () { else $("#checkbox-history_data").uncheck (); - $("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]); + $("#dynamic_interval_select").val (data["dynamic_interval"]); $("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]); $("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]); @@ -322,8 +322,8 @@ function configure_modules_form () { $("#text-ff_event_critical").attr ("value", (data["min_ff_event_critical"] == 0) ? 0 : data["min_ff_event_critical"]); $("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]); $("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]); - $("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]); - $("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]); + $("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]); + $("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]); $("#component_loading").hide (); $("#id_module_type").change (); if ($("#id_category").is("select")) { diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index a09df577a1..0fc5b9c7c9 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -653,6 +653,15 @@ input.sub[disabled] { cursor: default; } +input.vs_button_ghost{ + background-color: transparent !important; + border: 1px solid #82b92e; + color: #82b92e !important; + text-align: center; + padding: 4px 12px; + font-weight: bold; +} + input.next, input.upd, input.ok, input.wand, input.delete, input.cog, input.target, input.search, input.copy, input.add, input.graph, input.percentile, input.binary, input.camera, input.config, @@ -1393,6 +1402,37 @@ table.databox { color: #222 !important; } +.databox.data>tbody>tr>td:first-child{ + border-left: 1px solid #e2e2e2; +} + +.databox.data>tbody>tr:last-child>td:first-child{ + border-bottom-left-radius: 4px; +} + +.databox.data>tbody>tr>td:last-child { + border-right: 1px solid #e2e2e2; +} + +.databox.data>tbody>tr:last-child >td:last-child { + border-bottom-right-radius: 4px; +} + +.databox.data>thead>tr:first-child>th:first-child { + border-left: 1px solid #e2e2e2; + border-top-left-radius: 4px; + border-color: #373737; +} + +.databox.data>thead>tr:first-child>th:last-child { + border-right: 1px solid #e2e2e2; + border-top-right-radius: 4px; + border-color: #373737; +} +.databox.data{ + border: none; +} + .tabletitle { color: #333; } diff --git a/pandora_console/index.php b/pandora_console/index.php index 7b5cc7c8b9..1fc6e932ed 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1057,6 +1057,7 @@ else { $_GET['sec2'] = 'general/logon_ok'; break; case 'Dashboard': + $dashboard_from_main_page = 1; $id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url); $str = 'sec=reporting&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; parse_str($str, $res); diff --git a/pandora_console/install.php b/pandora_console/install.php index dff7da228d..de58f942b6 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -70,8 +70,8 @@
showFooter(false); $ui->beginContent(); - if ($system->getConfig('metaconsole')) - $logo_image = html_print_image (ui_get_mobile_login_icon(), - true, array ("alt" => "logo", "border" => 0)); - else - $logo_image = html_print_image (ui_get_mobile_login_icon(), - true, array ("alt" => "logo", "border" => 0),false, false, false, true); + $logo_image = html_print_image (ui_get_mobile_login_icon(), + true, array ("alt" => "logo", "border" => 0), false, false, false, true); $ui->contentAddHtml(''); @@ -292,7 +288,7 @@ class User { $ui->beginContent(); $ui->contentAddHtml(''); $ui->contentAddHtml('
'); $ui->beginForm(); diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index e3a9cf2665..c62de4d035 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -28,6 +28,7 @@ class Tactical { else { $this->correct_acl = false; } + include_javascript_dependencies_flot_graph(); } public function show() { diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index d37cc9396c..20d3f18a47 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -623,7 +623,7 @@ foreach ($agents as $agent) { $data[0] = '
'; $data[0] .= ''; - $data[0] .= ' '.$agent["alias"].''; + $data[0] .= ' '.$agent["alias"].''; $data[0] .= ''; if ($agent['quiet']) { @@ -642,7 +642,7 @@ foreach ($agents as $agent) { $data[0] .= ''.__('View').''; } else{ - $data[0] .= ''.__('View').''; + $data[0] .= ''.__('View').''; } if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) { diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index abc31b4ea4..d80870f334 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -246,7 +246,7 @@ if (!empty($result_groups)) { $link = ""; } else { $deep = groups_get_group_deep ($data['_id_']); - $link = ""; + $link = ""; } $group_name = "" . ui_print_truncate_text($data['_name_'], 50) . ""; @@ -279,7 +279,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "'>"; } else { $link = ""; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; } if ($data["_id_"] == 0) { echo $link . $total_agentes . ""; @@ -296,7 +296,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_UNKNOWN ."'>"; } else { $link = ""; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_UNKNOWN ."'>"; } if (($data["_id_"] == 0) && ($agents_unknown != 0)) { echo $link . $agents_unknown . ""; @@ -313,7 +313,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_NOT_INIT ."'>"; } else { $link = ""; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_NOT_INIT ."'>"; } if (($data["_id_"] == 0) && ($agents_notinit != 0)) { echo $link . $agents_notinit . ""; @@ -331,7 +331,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_CRITICAL ."'>"; } else { $link = ""; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_CRITICAL ."'>"; } if (($data["_id_"] == 0) && ($agents_critical != 0)) { echo $link . $agents_critical . ""; diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index a5c5acc1ec..6163c47f8f 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -221,11 +221,10 @@ else { $table->data[0][0] = __('Name'); $table->data[0][1] = html_print_input_text ('name', $name, '', 30, 100,true); - $table->data[1][0] = __('Group'); - + $table->data[1][0] = __('Group'); $table->data[1][1] = html_print_select_groups($config['id_user'], "AR", - true, 'id_group', $idGroup, '', '', '', true); + true, 'id_group', $id_group, '', '', '', true); $table->data[2][0] = __('Node radius'); $table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2, diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 738f9ed5df..d1916ea741 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -511,9 +511,16 @@ if (is_ajax ()) { $id = (int)get_parameter('id', 0); $x = (int)get_parameter('x', 0); $y = (int)get_parameter('y', 0); + $scale = (float)get_parameter('scale', 0); $networkmap = db_get_row('tmap', 'id', $id); + $array_filter = json_decode($networkmap['filter']); + if (isset($array_filter->z_dash)) { + $array_filter->z_dash = number_format($scale,2); + } + $filter = json_encode($array_filter); + // ACL for the network map // $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR"); $networkmap_write = check_acl ($config['id_user'], $networkmap['id_group'], "MW"); @@ -529,7 +536,7 @@ if (is_ajax ()) { $networkmap['center_x'] = $x; $networkmap['center_y'] = $y; db_process_sql_update('tmap', - array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']), + array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y'], 'filter' => $filter), array('id' => $id)); $return = array(); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index e82a624b9b..84e78d5208 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -97,8 +97,11 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); + "; + echo"

" . __('The CSV export has been successful.') . "

"; + echo"
"; // Module id $id = (int) get_parameter ("id", 0); // Agent id diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index dd2472d7bc..635d61c0d2 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -163,7 +163,7 @@ $table->rowclass[] = ''; // Server performance // --------------------------------------------------------------------- if ($is_admin) { - $table->data[4][0] = reporting_get_stats_servers(false); + $table->data[4][0] = reporting_get_stats_servers(); $table->rowclass[] = ''; } @@ -183,6 +183,11 @@ if (check_acl($config['id_user'],0,'ER')) { if (!empty($tags_condition)) { $event_filter .= " AND ($tags_condition)"; } + + if ($config['event_view_hr']) { + $event_filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")"; + } + $events = events_print_event_table ($event_filter, 10, "100%",true,false,true); ui_toggle($events, __('Latest events'),false,false); } @@ -196,20 +201,44 @@ if ($is_admin) { } $out = '
'; - $out .= '
+ $out .= '
' . __('Event graph') . '' . - grafico_eventos_total("", 280, 150, false) . '
'; + html_print_image('images/spinner.gif',true,array('id' => 'spinner_total_event_graph')) . '
'; $out .="
"; - $out .= '
+ $out .= '
' . __('Event graph by agent') . '' . - grafico_eventos_grupo(280, 150, "", false, false, false) . '
'; + html_print_image('images/spinner.gif', true, array('id' => 'spinner_graphic_event_group')) . '
'; $out .= '
'; echo $out; echo ''; echo ''; -?> \ No newline at end of file +?> + \ No newline at end of file diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index df7a2777ff..9a33050e94 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -68,14 +68,18 @@ if (is_ajax ()) { } } else { - $groups_orig = users_get_groups(false, $privilege); + $groups_orig = users_get_groups(false, $privilege, false); $groups = array_keys($groups_orig); } - + // Build filter $filter = array(); - $filter['id_grupo'] = $groups; - + // Group filter (primary and secondary) + $filter[] = "(" .db_format_array_where_clause_sql( + array('id_grupo' => $groups, 'id_group' => $groups), + 'OR' + ) . ")"; + if (!empty($id_os)) $filter['id_os'] = $id_os; if (!empty($agent_name)) @@ -158,12 +162,17 @@ if (is_ajax ()) { } } - + $filter['group'] = 'id_agente'; + // Build fields $fields = array('id_agente', 'alias'); // Perform search - $agents = db_get_all_rows_filter('tagente', $filter, $fields); + $agents = db_get_all_rows_filter( + 'tagente LEFT JOIN tagent_secondary_group ON id_agente=id_agent', + $filter, + $fields + ); if (empty($agents)) $agents = array(); foreach ($agents as $k => $v) { diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 6b5b1a033b..16f43397ba 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -680,7 +680,14 @@ else { } $comments_help_tip = ""; if (!empty($event_user_comment_str)) { - $comments_help_tip = ui_print_help_tip($event_user_comment_str, true); + + if($myclass == 'datos_yellow'){ + $comments_help_tip = ui_print_help_tip_border($event_user_comment_str, true); + } + else{ + $comments_help_tip = ui_print_help_tip($event_user_comment_str, true); + } + } $data[$i] = '' . $comments_help_tip . ''; diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 22fa43e5a6..435aaeade2 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -50,7 +50,7 @@ if (is_ajax()) { else { snmp_browser_print_tree ($snmp_tree); echo html_print_submit_button(__('Create network components'),'create_network_component', - false, array('style' => 'display: none; position: fixed; bottom: 55px; right: 80px;', 'class' => 'sub add'), true); + false, array('style' => 'display: none; position: absolute; bottom: 0px; right: 35px;', 'class' => 'sub add'), true); echo '