diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 245a30ef4c..dcfa365e6b 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.725, AIX version +# Version 7.0NG.726, 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 0fc2927c2f..f7d23ab200 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.725, FreeBSD Version +# Version 7.0NG.726, 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 c97115d409..532fbe65e4 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.725, HP-UX Version +# Version 7.0NG.726, 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 a0d7d5ea8d..8fd5498d51 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.725, GNU/Linux +# Version 7.0NG.726, 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 995d0d33d7..5bea10d1fa 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.725, GNU/Linux +# Version 7.0NG.726, 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 fa86fe707d..d30b3459ac 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.725, Solaris Version +# Version 7.0NG.726, 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 d347375de2..ed451d9de0 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.725 +# Version 7.0NG.726 # 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 965020560c..7f7e1d96f9 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.725, AIX version +# Version 7.0NG.726, 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 edca5a3c52..8fc6f4e1eb 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.725 +# Version 7.0NG.726 # 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 edec1bb26c..0e80d51dd9 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.725, HPUX Version +# Version 7.0NG.726, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index dfe908bae8..5dd411ecd3 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.725 +# Version 7.0NG.726 # 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 9b1c31e469..e5dd6122af 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.725 +# Version 7.0NG.726 # 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 c7806abd5c..2eee374d68 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.725 +# Version 7.0NG.726 # 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 17bd56f29d..138448fd17 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.725, Solaris version +# Version 7.0NG.726, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 95cb035609..ce926a7cac 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.725, AIX version +# Version 7.0NG.726, 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 e312449ae5..fafc3d2c41 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180813 +Version: 7.0NG.726-180817 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 4d40a82f1e..3984e903c2 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.725-180813" +pandora_version="7.0NG.726-180817" 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 c7f2a3547c..6e58735751 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.725, GNU/Linux +# Version 7.0NG.726, 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 f0568cae8f..af429aa2b7 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.725, FreeBSD Version +# Version 7.0NG.726, 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 77b678de67..6d4e113c16 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.725, HP-UX Version +# Version 7.0NG.726, 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 754470aa4c..4b86143f9a 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.725, GNU/Linux +# Version 7.0NG.726, 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 dde28ceef5..b15043bc67 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.725, GNU/Linux +# Version 7.0NG.726, 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 682fd6f270..e26488592f 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.725, NetBSD Version +# Version 7.0NG.726, 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 7bdcf6fbde..5764320b0a 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.725, Solaris Version +# Version 7.0NG.726, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 16488aec72..41ade7ed7a 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.725'; -use constant AGENT_BUILD => '180813'; +use constant AGENT_VERSION => '7.0NG.726'; +use constant AGENT_BUILD => '180817'; # 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 676c623276..2573ad8ff6 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.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 71b3c173b1..66e606cdf7 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.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 69d1160d50..1d0d3d8428 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.725" -PI_BUILD="180813" +PI_VERSION="7.0NG.726" +PI_BUILD="180817" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index e7a920d22c..4e9edf8157 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.725 +# Version 7.0NG.726 # 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 58fadb34b2..ca80ec74de 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.725} +{Pandora FMS Windows Agent v7.0NG.726} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180813} +{180817} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d5491d83bf..ee16b373ab 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.725(Build 180813)") +#define PANDORA_VERSION ("7.0NG.726(Build 180817)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 78ecf90883..16d62f2896 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.725(Build 180813))" + VALUE "ProductVersion", "(7.0NG.726(Build 180817))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5db8213fa6..f8e37eb796 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180813 +Version: 7.0NG.726-180817 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 a3b0d44261..d24e66e8a4 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.725-180813" +pandora_version="7.0NG.726-180817" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/19.sql b/pandora_console/extras/mr/19.sql index 3fb87a3f19..ea08bd0f26 100644 --- a/pandora_console/extras/mr/19.sql +++ b/pandora_console/extras/mr/19.sql @@ -57,9 +57,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( -- Rename column is_secondary to no_hierarchy in `tusuario _perfil` -- --------------------------------------------------------------------- ALTER TABLE `tusuario_perfil` ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL DEFAULT 0; -UPDATE `tusuario_perfil` SET `is_secondary` = `no_hierarchy`; +UPDATE `tusuario_perfil` SET `no_hierarchy` = `is_secondary`; ALTER TABLE `tusuario_perfil` DROP COLUMN `is_secondary`; +UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event'; + -- ----------------------------------------------------- -- Table `tgis_map_layer_groups` -- ----------------------------------------------------- diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php index 6a37a9c9b1..d83e211a82 100644 --- a/pandora_console/extras/pandora_diag.php +++ b/pandora_console/extras/pandora_diag.php @@ -138,6 +138,7 @@ function execution_time(){ return "Normal Status   The execution time is correct. For a more extensive information of this data consult the Execution Time graph"; } + function get_logs_size($file){ $file_name = '/var'. $file .''; $size_server_log = filesize($file_name); @@ -149,9 +150,9 @@ function get_status_logs($path){ $status_server_log = ""; $size_server_log = get_logs_size($path); if ($size_server_log <= 10240){ - $status_server_log = "Normal Status   You have less than 10 MB of logs"; + $status_server_log = "Normal Status   You have less than 10 MB of logs"; }else{ - $status_server_log = "Warning Status   You have more than 10 MB of logs"; + $status_server_log = "Warning Status   You have more than 10 MB of logs"; } return $status_server_log; } @@ -161,9 +162,9 @@ function percentage_modules_per_agent(){ $total_modules = db_get_value_sql ('SELECT count(*) FROM tagente_modulo'); $average_modules_per_agent = $total_modules / $total_agents; if($average_modules_per_agent <= 40){ - $status_average_modules = "Normal Status   The average of modules per agent is less than 40 percent"; + $status_average_modules = "Normal Status   The average of modules per agent is less than 40 percent"; }else{ - $status_average_modules = "Warning Status  The average of modules per agent is more than 40 percent. You can have performance problems"; + $status_average_modules = "Warning Status  The average of modules per agent is more than 40 percent. You can have performance problems"; } return $status_average_modules; } @@ -174,9 +175,9 @@ function license_capacity(){ $status_license_capacity = ""; $current_count = db_get_value_sql ('SELECT count(*) FROM tagente'); if ($current_count > $license_limit * 90 /100){ - $status_license_capacity = "Warning Status   The license capacity is more than 90 percent"; + $status_license_capacity = "Warning Status   The license capacity is more than 90 percent"; }else{ - $status_license_capacity = "Normal Status   The license capacity is less than 90 percent"; + $status_license_capacity = "Normal Status   The license capacity is less than 90 percent"; } return $status_license_capacity; } @@ -195,12 +196,12 @@ function interval_average_of_network_modules(){ $average_time= (int) $total_module_interval_time / $total_network_modules; if($average_time < 180 ){ - $status_average_modules = "Warning Status   The system has a lot of load and a very fine configuration is required"; + $status_average_modules = "Warning Status   The system has a lot of load and a very fine configuration is required"; }else{ - $status_average_modules = "Normal Status   The system has an acceptable charge"; + $status_average_modules = "Normal Status   The system has an acceptable charge"; } if ($average_time == 0) - $status_average_modules = "Normal Status   The system has no load"; + $status_average_modules = "Normal Status   The system has no load"; return $status_average_modules; } @@ -208,9 +209,9 @@ $attachment_total_files = count(glob($config['homedir']."/attachment/{*.*}",GLOB function files_attachment_folder($total_files){ if($total_files <= 700){ - $status_total_files = "Normal Status   The attachment folder has less than 700 files."; + $status_total_files = "Normal Status   The attachment folder has less than 700 files."; }else{ - $status_total_files = "Warning Status   The attachment folder has more than 700 files."; + $status_total_files = "Warning Status   The attachment folder has more than 700 files."; } return $status_total_files; } @@ -218,14 +219,21 @@ function files_attachment_folder($total_files){ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos'); function status_tagente_datos($tagente_datos_size){ - if ($tagente_datos_size <=3000){ - $tagente_datos_size = "Normal Status   The tagente_datos table has less than 3000 data."; + if ($tagente_datos_size <=3000000){ + $tagente_datos_size = "Normal Status   The tagente_datos table has an acceptable amount of data."; }else{ - $tagente_datos_size = "Warning Status   The tagente_datos table has more than 3000 data. A historical database is recommended."; + $tagente_datos_size = "Warning Status   The tagente_datos table has too much data. A historical database is recommended."; } return $tagente_datos_size; } +function status_values($val_rec, $val){ + if ($val_rec <= $val) + return $val . " (current value) Normal Status"; + else + return $val . " (current value) Warning Status"; +} + $tables_fragmentation=db_get_sql ("SELECT (data_free/(index_length+data_length)) as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'"); $db_size=db_get_all_rows_sql("SELECT table_schema, @@ -245,28 +253,30 @@ $path_console_logs ="/www/html/pandora_console/pandora_console.log"; $innodb_log_file_size_min_rec_value = "64M"; $innodb_log_buffer_size_min_rec_value = "16M"; $innodb_flush_log_at_trx_commit_min_rec_value = 0; -$query_cache_limit_min_rec_value = "2M"; -$max_allowed_packet_min_rec_value = "32M"; -$sort_buffer_size_min_rec_value = "32K"; -$join_buffer_size_min_rec_value = "265K"; +$query_cache_limit_min_rec_value = 2; +$max_allowed_packet_min_rec_value = 32; +$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'"); +$sort_buffer_size_min_rec_value = 32; +$join_buffer_size_min_rec_value = 265; $query_cache_type_min_rec_value = "ON"; -$query_cache_size_min_rec_value = "24M"; -$innodb_lock_wait_timeout_max_rec_value = "120 seconds"; +$query_cache_size_min_rec_value = 24; +$innodb_lock_wait_timeout_max_rec_value = 120; $tables_fragmentation_max_rec_value = 10; -$thread_cache_size_max_rec_value = "8M"; -$thread_stack_min_rec_value = "256K"; -$max_connections_max_rec_value = "150"; -$key_buffer_size_min_rec_value = "256K"; -$read_buffer_size_min_rec_value = "32K"; -$read_rnd_buffer_size_min_rec_value = "32K"; -$query_cache_min_res_unit_min_rec_value = "2K"; +$thread_cache_size_max_rec_value = 8; +$thread_stack_min_rec_value = 256; +$max_connections_max_rec_value = 150; +$key_buffer_size_min_rec_value = 256; +$read_buffer_size_min_rec_value = 32; +$read_rnd_buffer_size_min_rec_value = 32; +$query_cache_min_res_unit_min_rec_value = 2; +$innodb_file_per_table_min_rec_value = 0; function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation){ $status_tables_frag = ""; if($tables_fragmentation > $tables_fragmentation_max_rec_value) - $status_tables_frag = "Warning Status   The fragmentation tables is higher than recommended. You should defragment them."; + $status_tables_frag = "Warning Status   The fragmentation tables is higher than recommended. You should defragment them."; else - $status_tables_frag = "Normal Status   The fragmentation tables is correct."; + $status_tables_frag = "Normal Status   The fragmentation tables is correct."; return $status_tables_frag; } @@ -536,29 +546,46 @@ switch ($config["dbtype"]) { WHERE \"key\" = 'current_update'", "Current Update #"); break; } - +$innodb_log_file_size =db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576; +$innodb_log_buffer_size =db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576; +$innodb_flush_log_at_trx_commit =db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit"); +$max_allowed_packet =db_get_value_sql("SELECT @@max_allowed_packet")/1048576; +$innodb_buffer_pool_size = db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024; +$sort_buffer_size =number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2); +$join_buffer_size =db_get_value_sql("SELECT @@join_buffer_size")/1024; +$query_cache_type =db_get_value_sql("SELECT @@query_cache_type"); +$query_cache_size =db_get_value_sql("SELECT @@query_cache_size")/1048576; +$query_cache_limit =db_get_value_sql("SELECT @@query_cache_limit")/1048576; +$innodb_lock_wait_timeout =db_get_value_sql("SELECT @@innodb_lock_wait_timeout"); +$thread_cache_size =db_get_value_sql("SELECT @@thread_cache_size"); +$thread_stack =db_get_value_sql("SELECT @@thread_stack")/1024; +$max_connections =db_get_value_sql("SELECT @@max_connections"); +$key_buffer_size =db_get_value_sql("SELECT @@key_buffer_size")/1024; +$read_buffer_size =db_get_value_sql("SELECT @@read_buffer_size")/1024; +$read_rnd_buffer_size =db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024; +$query_cache_min_res_unit =db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024; +$innodb_file_per_table = db_get_value_sql("SELECT @@innodb_file_per_table"); echo "".__("MySQL Performance metrics").""; -render_row_2($innodb_log_file_size_min_rec_value,'InnoDB log file size (minimum recommended value)',db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576 . 'M', 'InnoDB log file size (current value)'); -render_row_2($innodb_log_buffer_size_min_rec_value,'InnoDB log buffer size (minimum recommended value)',db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576 . 'M', 'InnoDB log buffer size (current value)'); -render_row_2($innodb_flush_log_at_trx_commit_min_rec_value,'InnoDB flush log at trx-commit (minimum recommended value)',db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit"), 'InnoDB flush log at trx-commit (current value)'); -render_row_2($max_allowed_packet_min_rec_value,'Maximun allowed packet',db_get_value_sql("SELECT @@max_allowed_packet")/1048576 . 'M', 'Maximun allowed packet (current value)'); -render_row_2($innodb_buffer_pool_size_min_rec_value . 'M','InnoDB buffer pool size (minimum recommended value)',db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024 . 'M', 'InnoDB buffer pool size (current value)'); -render_row_2($sort_buffer_size_min_rec_value,'Sort buffer size (minimum recommended value)',number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2) . 'K', 'Sort buffer size (current value)'); -render_row_2($join_buffer_size_min_rec_value,'Join buffer size (minimum recommended value)',db_get_value_sql("SELECT @@join_buffer_size")/1024 . 'K', 'Join buffer size (current value)'); -render_row_2($query_cache_type_min_rec_value,'Query cache type (recommended value)',db_get_value_sql("SELECT @@query_cache_type"), 'Query cache type (current value)'); -render_row_2($query_cache_size_min_rec_value,'Query cache size (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_size")/1048576 . 'M', 'Query cache size (current value)'); -render_row_2($query_cache_limit_min_rec_value,'Query cache limit (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_limit")/1048576 . 'M', 'Query cache limit (current value)'); -render_row_2($innodb_lock_wait_timeout_max_rec_value ,'InnoDB lock wait timeout (maximum recommended value)',db_get_value_sql("SELECT @@innodb_lock_wait_timeout") . ' seconds', 'InnoDB lock wait timeout (current value)'); -render_row_2($thread_cache_size_max_rec_value ,'Thread cache size (maximum recommended value)',db_get_value_sql("SELECT @@thread_cache_size") . 'M', 'Thread cache size (current value)'); -render_row_2($thread_stack_min_rec_value ,'Thread stack (minimum recommended value)',db_get_value_sql("SELECT @@thread_stack")/1024 . 'K', 'Thread stack (current value)'); -render_row_2($max_connections_max_rec_value ,'Maximun connections (maximum recommended value)',db_get_value_sql("SELECT @@max_connections"), 'Maximum connections (current value)'); -render_row_2($key_buffer_size_min_rec_value ,'Key buffer size (minimum recommended value)',db_get_value_sql("SELECT @@key_buffer_size")/1024 . 'K', 'Key buffer size (current value)'); -render_row_2($read_buffer_size_min_rec_value ,'Read buffer size (minimum recommended value)',db_get_value_sql("SELECT @@read_buffer_size")/1024 . 'K', 'Read buffer size (current value)'); -render_row_2($read_rnd_buffer_size_min_rec_value ,'Read rnd-buffer size (minimum recommended value)',db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024 . 'K', 'Read rnd-buffer size (current value)'); -render_row_2($query_cache_min_res_unit_min_rec_value ,'Query cache min-res-unit (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024 . 'K', 'Query cache min-res-unit (current value)'); -render_row(db_get_value_sql("SELECT @@innodb_file_per_table"), 'InnoDB file per table'); - +render_row($innodb_log_file_size.status_values($innodb_log_file_size_min_rec_value,$innodb_log_file_size),'InnoDB log file size ', 'InnoDB log file size '); +render_row($innodb_log_buffer_size.status_values($innodb_log_buffer_size_min_rec_value,$innodb_log_buffer_size),'InnoDB log buffer size ', 'InnoDB log buffer size '); +render_row($innodb_flush_log_at_trx_commit.status_values($innodb_flush_log_at_trx_commit_min_rec_value,$innodb_flush_log_at_trx_commit), 'InnoDB flush log at trx-commit ','InnoDB flush log at trx-commit '); +render_row($max_allowed_packet.status_values($max_allowed_packet_min_rec_value,$max_allowed_packet), 'Maximun allowed packet ','Maximun allowed packet '); +render_row($innodb_buffer_pool_size .status_values($innodb_buffer_pool_size_min_rec_value,$innodb_buffer_pool_size), 'InnoDB buffer pool size ','InnoDB buffer pool size '); +render_row($sort_buffer_size.status_values($sort_buffer_size_min_rec_value,$sort_buffer_size), 'Sort buffer size ','Sort buffer size '); +render_row($join_buffer_size.status_values($join_buffer_size_min_rec_value,$join_buffer_size), 'Join buffer size ','Join buffer size '); +render_row($query_cache_type.status_values($query_cache_type_min_rec_value,$query_cache_type), 'Query cache type ', 'Query cache type '); +render_row($query_cache_size.status_values($query_cache_size_min_rec_value,$query_cache_size), 'Query cache size ','Query cache size '); +render_row($query_cache_limit.status_values($query_cache_limit_min_rec_value,$query_cache_limit), 'Query cache limit ','Query cache limit '); +render_row($innodb_lock_wait_timeout.status_values($innodb_lock_wait_timeout_max_rec_value,$innodb_lock_wait_timeout), 'InnoDB lock wait timeout ','InnoDB lock wait timeout '); +render_row($thread_cache_size.status_values($thread_cache_size_max_rec_value,$thread_cache_size), 'Thread cache size ','Thread cache size '); +render_row($thread_stack .status_values($thread_stack_min_rec_value,$thread_stack), 'Thread stack ','Thread stack '); +render_row($max_connections.status_values($max_connections_max_rec_value,$max_connections), 'Maximum connections ','Maximun connections '); +render_row($key_buffer_size .status_values($key_buffer_size_min_rec_value,$key_buffer_size), 'Key buffer size ','Key buffer size '); +render_row($read_buffer_size.status_values($read_buffer_size_min_rec_value,$read_buffer_size), 'Read buffer size ','Read buffer size '); +render_row($read_rnd_buffer_size.status_values($read_rnd_buffer_size_min_rec_value,$read_rnd_buffer_size), 'Read rnd-buffer size ','Read rnd-buffer size '); +render_row($query_cache_min_res_unit.status_values($query_cache_min_res_unit_min_rec_value,$query_cache_min_res_unit), 'Query cache min-res-unit ','Query cache min-res-unit '); +render_row($innodb_file_per_table.status_values($innodb_file_per_table_min_rec_value,$innodb_file_per_table), 'InnoDB file per table ','InnoDB file per table '); echo "".__("Tables fragmentation in the PandoraFMS database").""; @@ -628,7 +655,7 @@ $agent_id= db_get_value_sql ("SELECT id_agente FROM tagente WHERE nombre = '$ser 'agent_module_id' => $id_module['id_agente_modulo'], 'period' => SECONDS_1MONTH, 'date' => time() , - 'height' => '200' + 'height' => '150' ); render_row(grafico_modulo_sparse ($params),"Graph of the " . $id_module['nombre']." module."); } diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 5879790d57..990de5042c 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -279,6 +279,7 @@ if (isset($groups[$grupo]) || $new_agent) { $table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true); } else { $table->data[4][1] = groups_get_name($grupo); + $table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true); } $table->data[4][1] .= ' '; $table->data[4][1] .= ui_print_group_icon ($grupo, true); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index ed52464dc0..b0999eb638 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -800,10 +800,9 @@ if ($update_agent) { // if modified some agent paramenter ui_print_error_message(__('No agent alias specified')); //If there is an agent with the same name, but a different ID } - /*elseif (agents_get_agent_id ($nombre_agente) > 0 && - agents_get_agent_id ($nombre_agente) != $id_agente) { - ui_print_error_message(__('There is already an agent in the database with this name')); - }*/ + if ($grupo <= 0) { + ui_print_error_message(__('The group id %d is incorrect.', $grupo)); + } else { //If different IP is specified than previous, add the IP if ($direccion_agente != '' && @@ -987,16 +986,16 @@ $edit_module = (bool) get_parameter ('edit_module'); // GET DATA for MODULE UPDATE OR MODULE INSERT if ($update_module || $create_module) { $id_grupo = agents_get_agent_group ($id_agente); + $all_groups = agents_get_all_groups_agent ($id_agente, $id_grupo); - $id_agent_module = (int) get_parameter ('id_agent_module'); - - if (!check_acl ($config["id_user"], $id_grupo, "AW")) { + if (! check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) { db_pandora_audit("ACL Violation", "Trying to create a module without admin rights"); require ("general/noaccess.php"); exit; } - + + $id_agent_module = (int) get_parameter ('id_agent_module'); $id_module_type = (int) get_parameter ('id_module_type'); $name = (string) get_parameter ('name'); $description = (string) get_parameter ('description'); diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 7b80693e42..b475e29e2b 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -656,7 +656,7 @@ foreach ($modules as $module) { "alt" => "")) . " "; } - if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { + if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) { $data[0] .= ''; } @@ -668,7 +668,7 @@ foreach ($modules as $module) { $data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt'); } - if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { + if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) { $data[0] .= ''; } diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 8d6541bfd4..61a5a23d32 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -586,7 +586,8 @@ if($cps_module > 0){ else{ $cps_inc = 0; if($id_agent_module){ - $cps_inc = service_modules_cps($id_agent_module); + $cps_inc = enterprise_hook('service_modules_cps', array($id_agent_module)); + if ($cps_inc === ENTERPRISE_NOT_HOOK) $cps_inc = 0; } $cps_array[$cps_inc] = __('Enabled'); } diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 470cdd471e..7f59e1f5d3 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -295,19 +295,8 @@ if ($get_module_detail) { elseif (($config['command_snapshot'] == '0') && (preg_match ("/[\n]+/i", $row[$attr[0]]))) { // Its a single-data, multiline data (data snapshot) ? - // Detect string data with \n and convert to
's - $datos = $row[$attr[0]]; - - $datos = preg_replace ('//', '>', $datos); - $datos = preg_replace ('/\n/i','
',$datos); - $datos = preg_replace ('/\s/i',' ',$datos); - $datos_format = "
"; - $datos_format .= $datos; - $datos_format .= "
"; - // I dont why, but using index (value) method, data is automatically converted to html entities ¿? - $data[] = $datos_format; + $data[] = html_print_result_div($row[$attr[0]]); } elseif ($is_web_content_string) { //Fixed the goliat sends the strings from web @@ -315,11 +304,9 @@ if ($get_module_detail) { $data[] = io_safe_input($row[$attr[0]]); } else { - // Just a string of alphanumerical data... just do print //Fixed the data from Selenium Plugin if ($row[$attr[0]] != strip_tags($row[$attr[0]])) { - - $data[] = io_safe_input($row[$attr[0]]); + $data[] = html_print_result_div($row[$attr[0]]); } else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) { switch($row['module_type']) { @@ -334,7 +321,6 @@ if ($get_module_detail) { }else{ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision'])); } - break; default: $data_macro = modules_get_unit_macro($row[$attr[0]],$unit); @@ -355,15 +341,7 @@ if ($get_module_detail) { if($data_macro){ $data[] = $data_macro; } else { - $datos = $row[$attr[0]]; - $datos = preg_replace ('//', '>', $datos); - $datos = preg_replace ('/\n/i','
',$datos); - $datos = preg_replace ('/\s/i',' ',$datos); - $datos_format = "
"; - $datos_format .= $datos; - $datos_format .= "
"; - $data[] = $datos_format; + $data[] = html_print_result_div($row[$attr[0]]); } } } diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 6d1a94ac66..497b12aa0d 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1046,16 +1046,20 @@ class Tree { // Modules SQL if ($item_for_count === false) { + //FIXME This group ACL should be the same in all modules view + $group_acl = " AND (ta.id_grupo IN ($user_groups_str) OR tasg.id_group IN ($user_groups_str))"; $sql = "SELECT $columns FROM tagente_modulo tam INNER JOIN tagente ta ON ta.disabled = 0 AND tam.id_agente = ta.id_agente - $group_acl + LEFT JOIN tagent_secondary_group tasg + ON tasg.id_agent = ta.id_agente $agent_search_filter $agent_status_filter $module_status_join WHERE tam.disabled = 0 + $group_acl $module_search_filter GROUP BY tam.nombre ORDER BY $order_fields"; @@ -1634,20 +1638,15 @@ class Tree { // Link to the Module graph // ACL - $group_id = (int) modules_get_agent_group($module['id']); + $all_groups = modules_get_agent_groups($module['id']); $acl_graphs = false; $module["showGraphs"] = 0; // Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions if (!empty($group_id) && !is_metaconsole()) { - if ($this->strictACL) { - $acl_graphs = tags_check_acl_by_module($module['id'], $config['id_user'], 'RR') === true; - } - else { - $acl_graphs = check_acl($config['id_user'], $group_id, "RR"); - } + $acl_graphs = check_acl_one_of_groups($config['id_user'], $all_groups, "RR"); } - else if (!empty($group_id)) { + else if (!empty($all_groups)) { $acl_graphs = true; } @@ -1685,7 +1684,8 @@ class Tree { $module['snapshot'] = ui_get_snapshot_link(array( 'id_module' => $module['id'], 'interval' => $module['current_interval'], - 'module_name' => $module['name'] + 'module_name' => $module['name'], + 'id_node' => $module['serverID'] ? $module['serverID'] : 0, ), true); } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1bed77da06..c4f4aa17ba 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 = 'PC180813'; -$pandora_version = 'v7.0NG.725'; +$build_version = 'PC180817'; +$pandora_version = 'v7.0NG.726'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 27f2bf52fc..0d496bf9c4 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -145,9 +145,10 @@ function events_get_events_grouped($sql_post, $offset = 0, switch ($config["dbtype"]) { case "mysql": db_process_sql ('SET group_concat_max_len = 9999999'); + $event_lj = events_get_secondary_groups_left_join($table); if ($total) { $sql = "SELECT COUNT(*) FROM (SELECT * - FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent + FROM $table te $event_lj WHERE 1=1 " . $sql_post . " GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . ") AS t"; } @@ -163,139 +164,10 @@ function events_get_events_grouped($sql_post, $offset = 0, (SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity, (SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp, (SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name - FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent + FROM $table te $event_lj WHERE 1=1 " . $sql_post . " - GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . " - ORDER BY "; - - if (!empty($sort_field)) { - switch ($sort_field) { - case 'event_id': - if ($order=='up') - $sql .= "id_evento" . " ASC"; - if ($order=='down') - $sql .= "id_evento" . " DESC"; - break; - case 'event_name': - if ($order=='up') - $sql .= "evento" . " ASC"; - if ($order=='down') - $sql .= "evento" . " DESC"; - break; - case 'event_id': - if ($order=='up') - $sql .= "id_evento" . " ASC"; - if ($order=='down') - $sql .= "id_evento" . " DESC"; - break; - case 'status': - if ($order=='up') - $sql .= "estado" . " ASC"; - if ($order=='down') - $sql .= "estado" . " DESC"; - break; - case 'agent_id': - if ($order=='up') - $sql .= "id_agente" . " ASC"; - if ($order=='down') - $sql .= "id_agente" . " DESC"; - break; - case 'timestamp': - if ($order=='up') - $sql .= "timestamp_rep" . " ASC"; - if ($order=='down') - $sql .= "timestamp_rep" . " DESC"; - break; - case 'user_id': - if ($order=='up') - $sql .= "id_usuario" . " ASC"; - if ($order=='down') - $sql .= "id_usuario" . " DESC"; - break; - case 'owner': - if ($order=='up') - $sql .= "owner_user" . " ASC"; - if ($order=='down') - $sql .= "owner_user" . " DESC"; - break; - case 'group_id': - if ($order=='up') - $sql .= "id_grupo" . " ASC"; - if ($order=='down') - $sql .= "id_grupo" . " DESC"; - break; - case 'module_name': - if ($order=='up') - $sql .= "module_name" . " ASC"; - if ($order=='down') - $sql .= "module_name" . " DESC"; - break; - case 'event_type': - if ($order=='up') - $sql .= "event_type" . " ASC"; - if ($order=='down') - $sql .= "event_type" . " DESC"; - break; - case 'alert_id': - if ($order=='up') - $sql .= "id_alert_am" . " ASC"; - if ($order=='down') - $sql .= "id_alert_am" . " DESC"; - break; - case 'criticity': - if ($order=='up') - $sql .= "criticity" . " ASC"; - if ($order=='down') - $sql .= "criticity" . " DESC"; - break; - case 'comment': - if ($order=='up') - $sql .= "user_comment" . " ASC"; - if ($order=='down') - $sql .= "user_comment" . " DESC"; - break; - case 'tags': - if ($order=='up') - $sql .= "tags" . " ASC"; - if ($order=='down') - $sql .= "tags" . " DESC"; - break; - case 'source': - if ($order=='up') - $sql .= "source" . " ASC"; - if ($order=='down') - $sql .= "source" . " DESC"; - break; - case 'extra_id': - if ($order=='up') - $sql .= "id_extra" . " ASC"; - if ($order=='down') - $sql .= "id_extra" . " DESC"; - break; - case 'ack_timestamp': - if ($order=='up') - $sql .= "ack_utimestamp" . " ASC"; - if ($order=='down') - $sql .= "ack_utimestamp" . " DESC"; - break; - case 'data': - if ($order=='up') - $sql .= "data" . " ASC"; - if ($order=='down') - $sql .= "data" . " DESC"; - break; - case 'module_status': - if ($order=='up') - $sql .= "module_status" . " ASC"; - if ($order=='down') - $sql .= "module_status" . " DESC"; - break; - default: - $sql .= "timestamp_rep" . " DESC"; - } - } - - + GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra; + $sql .= " " . events_get_sql_order($sort_field, $order, 2); $sql .= " LIMIT " . $offset . "," . $pagination; } @@ -3452,13 +3324,13 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0, $fields_extra = ''; } + $event_lj = events_get_secondary_groups_left_join($table); if ($total) { - $sql = "SELECT COUNT(*) FROM (select id_agente from $table WHERE 1=1 + $sql = "SELECT COUNT(*) FROM (select id_agente from $table $event_lj WHERE 1=1 $sql_post GROUP BY id_agente, event_type$groupby_extra ORDER BY id_agente ) AS t"; } else { - $sql = "select id_agente, count(*) as total$fields_extra from $table te LEFT JOIN tagent_secondary_group tasg - ON te.id_agente = tasg.id_agent + $sql = "select id_agente, count(*) as total$fields_extra from $table te $event_lj WHERE id_agente > 0 $sql_post GROUP BY id_agente$groupby_extra ORDER BY id_agente LIMIT $offset,$pagination"; } @@ -3472,7 +3344,7 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0, foreach ($events as $event) { if ($meta) { - $sql = "select event_type from $table + $sql = "select event_type from $table te $event_lj WHERE agent_name = '".$event['agent_name']."' $sql_post ORDER BY utimestamp DESC "; $resultado = db_get_row_sql($sql); @@ -3483,9 +3355,7 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0, 'event_type' => $resultado['event_type']); } else { - $sql = "SELECT event_type FROM $table te - LEFT JOIN tagent_secondary_group tasg - ON te.id_agente = tasg.id_agent + $sql = "SELECT event_type FROM $table te $event_lj WHERE id_agente = ".$event['id_agente']." $sql_post ORDER BY utimestamp DESC "; $resultado = db_get_row_sql($sql); @@ -4328,7 +4198,62 @@ function events_list_events_grouped_agents($sql) { return html_print_table($table,true); } +function events_get_sql_order($sort_field = "timestamp", $sort = "DESC", $group_rep = 0) { + $sort_field_translated = $sort_field; + switch ($sort_field) { + case 'event_id': + $sort_field_translated = "id_evento"; + break; + case 'event_name': + $sort_field_translated = "evento"; + break; + case 'status': + $sort_field_translated = "estado"; + break; + case 'agent_id': + $sort_field_translated = "id_agente"; + break; + case 'timestamp': + $sort_field_translated = ($group_rep == 0) ? "timestamp" : "timestamp_rep"; + break; + case 'user_id': + $sort_field_translated = "id_usuario"; + break; + case 'owner': + $sort_field_translated = "owner_user"; + break; + case 'group_id': + $sort_field_translated = "id_grupo"; + break; + case 'alert_id': + $sort_field_translated = "id_alert_am"; + break; + case 'comment': + $sort_field_translated = "user_comment"; + break; + case 'extra_id': + $sort_field_translated = "id_extra"; + break; + } + $dir = ($sort == "up") ? "ASC" : "DESC"; + return "ORDER BY $sort_field_translated $dir"; +} + +/** + * SQL left join of event queries to handle secondary groups + * + * @param string Table to see if is metaconsole or not + * + * @return string With the query. + */ +function events_get_secondary_groups_left_join($table) { + if ($table == 'tevento') { + return "LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent"; + } + return "LEFT JOIN tmetaconsole_agent_secondary_group tasg + ON te.id_agente = tasg.id_tagente AND te.server_id = tasg.id_tmetaconsole_setup"; +} ?> diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 2352e7c547..83e49c5b43 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2458,4 +2458,50 @@ function html_print_timezone_select ($name, $selected = "") { return html_print_select($timezones, $name, $selected, "", __("None"), "", true, false, false); } +/** + * Enclose a text into a result_div + * + * @param string Text to enclose + * + * @return string Text inside the result_div + */ +function html_print_result_div ($text) { + $text = preg_replace ('//', '>', $text); + $text = preg_replace ('/\n/i','
',$text); + $text = preg_replace ('/\s/i',' ',$text); + + $enclose = "
"; + $enclose .= $text; + $enclose .= "
"; + return $enclose; +} + +/** + * Print order arrows links + * + * @param array Base tags to build url + * @param string Order key to add to URL + * @param string Value to sort ascendent + * @param string Value to sort descendent + * + * @return string HTML code to display both arrows. + */ +function html_print_sort_arrows ($params, $order_tag, $up = 'up', $down = 'down') { + // Build the queries + $params[$order_tag] = $up; + $url_up = "index.php?" . http_build_query($params, '', '&'); + $params[$order_tag] = $down; + $url_down = "index.php?" . http_build_query($params, '', '&'); + + // Build the links + return ' ' . + '' . + html_print_image("images/sort_up.png", true) . + '' . + '' . + html_print_image("images/sort_down.png", true) . + '' + ; +} ?> diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 342aa19926..e78d4f15ca 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -780,14 +780,14 @@ function modules_get_raw_data($id_agent_module, $date_init, $date_end) { return $data; } -function modules_get_agent_group($id_agent_module) { +function modules_get_agent_groups($id_agent_module) { $return = false; $id_agent = modules_get_agentmodule_agent( $id_agent_module); if (!empty($id_agent)) { - $return = agents_get_agent_group($id_agent); + $return = agents_get_all_groups_agent($id_agent); } return $return; diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 68345135c9..ba031c0cff 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -1184,23 +1184,25 @@ function tags_get_tags_for_module_search($id_user = false, $access = 'AR') { function tags_check_acl_by_module($id_module = 0, $id_user = false, $access = 'AW') { - global $config; - - + $return = false; - + if (!empty($id_module)) { $tags = tags_get_module_tags($id_module); - $group = modules_get_agent_group($id_module); - + $groups = modules_get_agent_groups($id_module); + if ($id_user === false) { $id_user = $config["id_user"]; } - - $return = tags_check_acl($id_user, $group, $access, $tags, true); + + foreach ($groups as $group) { + if (tags_check_acl($id_user, $group, $access, $tags, true)) { + return true; + } + } } - + return $return; } @@ -2480,17 +2482,10 @@ function tags_get_all_user_agents ($id_tag = false, $id_user = false, } $select_fields = implode(',',$fields); - + $groups_clause = ""; - if ($strict_user) { - if (!empty($groups_and_tags)) { - $groups_clause = " AND ".tags_get_acl_tags_module_condition($groups_and_tags, "tagente_modulo"); - } - } - else { - $groups_clause = " AND tagente.id_grupo IN (".implode(',', array_keys($groups_and_tags)).")"; - } - + $groups_clause = " AND tagente.id_grupo IN (".implode(',', array_keys($groups_and_tags)).")"; + if (!empty($filter['id_group'])) { if (is_array($filter['id_group'])) $groups_str = implode(",", $filter['id_group']); diff --git a/pandora_console/install.php b/pandora_console/install.php index 1daa0e07e3..87dd28a443 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -70,8 +70,8 @@
0) { $row_module = modules_get_agentmodule($id); $row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id); -if ($id_node > 0) { - metaconsole_restore_db(); -} - // Build the info $label = get_parameter ("label", io_safe_output($row_module['module_name'])); $last_timestamp = get_parameter("timestamp", $row_state['timestamp']); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index a8b2982e37..4b25d928e6 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1036,7 +1036,8 @@ if (!empty($result)) { $data[2] = html_print_image('images/' . modules_show_icon_type ($row['module_type']), true); - if (check_acl ($config['id_user'], $row['id_group'], 'AW')) { + $agent_groups = agents_get_all_groups_agent($row['id_agent'], $row['id_group']); + if (check_acl_one_of_groups ($config['id_user'], $agent_groups, 'AW')) { $show_edit_icon = true; if (defined('METACONSOLE')) { if (!can_user_access_node ()) { diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index 5fbb42881c..7716257cc4 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -81,6 +81,7 @@ switch ($status) { $events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevento WHERE custom_data != ""'); $count_events = 0; $events_wi_cdata_id = 'OR id_evento IN ('; +if ($events_wi_cdata === false) $events_wi_cdata = array(); foreach ($events_wi_cdata as $key => $value) { $needle = base64_decode($value['custom_data']); if (($needle != "") && ($search != "")) { diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index ff2c030e80..84b995af28 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -20,7 +20,6 @@ require_once ($config["homedir"] . "/include/functions_ui.php"); $sort_field = get_parameter("sort_field", "timestamp"); $sort = get_parameter("sort", "down"); - $table = new stdClass(); if(!isset($table->width)) { $table->width = '100%'; @@ -34,37 +33,54 @@ if(!isset($table->class)) { $table->head = array (); $table->data = array (); +$params = array ( + // Pandora sections + "sec" => "eventos", + "sec2" => "operation/events/events", + + // Events query params + "search" => io_safe_input($search), + "severity" => $severity, + "status" => $status, + "id_group" => $id_group, + "recursion" => $recursion, + "refr" => (int)get_parameter("refr", 0), + "id_agent_module" => $id_agent_module, + "pagination" => $pagination, + "group_rep" => $group_rep, + "event_view_hr" => $event_view_hr, + "id_user_ack" => $id_user_ack, + "tag_with" => $tag_with_base64, + "tag_without" => $tag_without_base64, + "filter_only_alert" => $filter_only_alert, + "offset" => $offset, + "toogle_filter" => "no", + "filter_id" => $filter_id, + "id_name" => $id_name, + "history" => (int)$history, + "section" => $section, + "open_filter" => $open_filter, + "date_from" => $date_from, + "date_to" => $date_to, + "pure" => $config["pure"], + + // Display params + "offset" => $offset, + "disabled" => $disabled, + "sort" => $sort, + "sort_field" => $sort_field +); + if ($group_rep == 2) { $table->class = "databox filters data"; $table->head[1] = __('Agent'); $table->head[5] = __('More detail'); - - $params = "search=" . io_safe_input($search) . - "&severity=" . $severity . - "&status=" . $status . - "&id_group=" . $id_group . - "&recursion=" . $recursion . - "&refr=" . (int)get_parameter("refr", 0) . - "&id_agent_module=" . $id_agent_module . - "&pagination=" . $pagination . - "&group_rep=2" . - "&event_view_hr=" . $event_view_hr . - "&id_user_ack=" . $id_user_ack . - "&tag_with=". $tag_with_base64 . - "&tag_without=" . $tag_without_base64 . - "&filter_only_alert" . $filter_only_alert . - "&offset=" . $offset . - "&toogle_filter=no" . - "&filter_id=" . $filter_id . - "&id_name=" . $id_name . - "&history=" . (int)$history . - "&section=" . $section . - "&open_filter=" . $open_filter . - "&date_from=" . $date_from . - "&date_to=" . $date_to . - "&pure=" . $config["pure"]; - $url = "index.php?sec=eventos&sec2=operation/events/events&" . $params; + $url = html_print_sort_arrows( + array_merge($params, array('sort_field' => 'status')), + 'sort' + ); + foreach ($result as $key => $res) { if ($res['event_type'] == 'alert_fired') { @@ -122,7 +138,6 @@ if ($group_rep == 2) { } } else { - //fields that the user has selected to show if ($meta) { $show_fields = events_meta_get_custom_fields_user(); @@ -133,7 +148,10 @@ else { //headers $i = 0; - $table->head[$i] = __('ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('ID') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'event_id')), + 'sort' + ); $table->align[$i] = 'left'; @@ -144,104 +162,154 @@ else { $i++; } if (in_array('estado', $show_fields)) { - $table->head[$i] = __('Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Status') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'status')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('id_evento', $show_fields)) { - $table->head[$i] = __('Event ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Event ID') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'event_id')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('evento', $show_fields)) { - $table->head[$i] = __('Event Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Event Name') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'event_name')), + 'sort' + ); $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 200px; max-width: 350px; word-break: break-all;'; $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Agent name') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'agent_id')), + 'sort' + ); $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; } if (in_array('timestamp', $show_fields)) { - $table->head[$i] = __('Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Timestamp') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'timestamp')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('id_usuario', $show_fields)) { - $table->head[$i] = __('User') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('User') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'user_id')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('owner_user', $show_fields)) { - $table->head[$i] = __('Owner') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Owner') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'owner')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('id_grupo', $show_fields)) { - $table->head[$i] = __('Group') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Group') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'group_id')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('event_type', $show_fields)) { - $table->head[$i] = __('Event Type') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Event Type') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'event_type')), + 'sort' + ); $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 85px;'; $i++; } if (in_array('id_agentmodule', $show_fields)) { - $table->head[$i] = __('Module Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Module Name') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'module_name')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('id_alert_am', $show_fields)) { - $table->head[$i] = __('Alert') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Alert') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'alert_id')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('criticity', $show_fields)) { - $table->head[$i] = __('Severity') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Severity') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'criticity')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('user_comment', $show_fields)) { - $table->head[$i] = __('Comment') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Comment') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'comment')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('tags', $show_fields)) { - $table->head[$i] = __('Tags') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Tags') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'tags')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('source', $show_fields)) { - $table->head[$i] = __('Source') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; - $table->align[$i] = 'left'; + $table->head[$i] = __('Source') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'source')), + 'sort' + );$table->align[$i] = 'left'; $i++; } if (in_array('id_extra', $show_fields)) { - $table->head[$i] = __('Extra ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Extra ID') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'extra_id')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('ack_utimestamp', $show_fields)) { - $table->head[$i] = __('ACK Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('ACK Timestamp') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'ack_utimestamp')), + 'sort' + ); $table->align[$i] = 'left'; $i++; @@ -253,14 +321,19 @@ else { $i++; } if (in_array('data', $show_fields)) { - $table->head[$i] = __('Data') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Data') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'data')), + 'sort' + ); $table->align[$i] = 'left'; $i++; } if (in_array('module_status', $show_fields)) { - $table->head[$i] = __('Module Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '';; - $table->align[$i] = 'left'; + $table->head[$i] = __('Module Status') . html_print_sort_arrows( + array_merge($params, array('sort_field' => 'module_status')), + 'sort' + );$table->align[$i] = 'left'; $i++; } @@ -772,7 +845,10 @@ else { if (!empty ($table->data)) { if ($allow_pagination) { - ui_pagination ($total_events, "index.php?sec=eventos&sec2=operation/events/events&sort_field=$sort_field&sort=$sort&disabled=$disabled", $offset, $pagination); + $params_to_paginate = $params; + unset($params_to_paginate['offset']); + $url_paginate = "index.php?" . http_build_query($params_to_paginate, '', '&'); + ui_pagination ($total_events, $url_paginate, $offset, $pagination); } if ($allow_action) { @@ -790,7 +866,6 @@ else { if ($allow_action) { echo '
'; - //~ if (!$readonly && tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) { if (!$readonly && $show_validate_button) { html_print_button(__('In progress selected'), 'validate_button', false, 'validate_selected(2);', 'class="sub ok"'); echo " "; @@ -808,7 +883,6 @@ else { diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 783383daa5..ea78086c6b 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -29,7 +29,6 @@ enterprise_include_once('include/functions_events.php'); check_login (); $sort_field = get_parameter("sort_field", "timestamp"); - $sort_order = get_parameter("sort", "down"); $event_a = check_acl ($config['id_user'], 0, "ER"); @@ -741,13 +740,15 @@ echo "
"; 0 $sql_post GROUP BY id_agente ORDER BY id_agente ) AS t"; $total_events = (int) db_get_sql ($sql); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index d09f3cb18d..6c01144610 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -2,8 +2,8 @@ # Pandora FMS Console # %define name pandorafms_console -%define version 7.0NG.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 409959356e..04c05a3b11 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -2,8 +2,8 @@ # Pandora FMS Console # %define name pandorafms_console -%define version 7.0NG.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandora_console_install b/pandora_console/pandora_console_install index 14c55d2998..a9c44bc998 100644 --- a/pandora_console/pandora_console_install +++ b/pandora_console/pandora_console_install @@ -9,7 +9,7 @@ # This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.725" +PI_VERSION="7.0NG.726" FORCE=0 DESTDIR="" LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 0aa116933b..914cae482d 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.725-180813 +Version: 7.0NG.726-180817 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 9bfbb98f78..96f9a42e49 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.725-180813" +pandora_version="7.0NG.726-180817" package_cpan=0 package_pandora=1 diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 408472c113..f26cf3d016 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -111,10 +111,10 @@ sub pandora_startup () { start_server_thread(\&pandora_process_policy_queue, [\%Config]) if ($Config{'__enterprise_enabled'} == 1 && $Config{'policy_manager'} == 1); # Start the event replication thread. Do not start with start_server_thread, this thread may exit on its own. - threads->create(\&pandora_process_event_replication, [\%Config]) if($Config{'__enterprise_enabled'} == 1 && $Config{'event_replication'} == 1); + threads->create(\&pandora_process_event_replication, \%Config) if($Config{'__enterprise_enabled'} == 1 && $Config{'event_replication'} == 1); # Update the agent cache. Do not start with start_server_thread, this thread updates the agent cache and exits. - threads->create(\&enterprise_hook, ['update_agent_cache', [\%Config]])->detach() if ($Config{'node_metaconsole'} == 1); + threads->create(\&enterprise_hook, 'update_agent_cache', [\%Config])->detach() if ($Config{'node_metaconsole'} == 1); pandora_audit (\%Config, $Config{'rb_product_name'} . ' Server Daemon starting', 'SYSTEM', 'System', $DBH); diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index e18dd82db0..c4982acf77 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -1,7 +1,7 @@ ############################################################################# # Pandora FMS Server Parameters # Pandora FMS, the Flexible Monitoring System. -# Version 7.0NG.725 +# Version 7.0NG.726 # Licensed under GPL license v2, # (c) 2003-2017 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 6af4a4d1c8..8c5bb7d668 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -44,8 +44,8 @@ our @EXPORT = qw( ); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.725"; -my $pandora_build = "180813"; +my $pandora_version = "7.0NG.726"; +my $pandora_build = "180817"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index d40b98f502..dbd4a958a4 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -31,8 +31,8 @@ use base 'Exporter'; our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.725"; -my $pandora_build = "180813"; +my $pandora_version = "7.0NG.726"; +my $pandora_build = "180817"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 41bf481198..1758d79459 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -1278,16 +1278,16 @@ sub month_have_days($$) { if ( $year <= 1752 ) { # Note: Although September 1752 only had 19 days, # they were numbered 1,2,14..30! - if (1752 == $year && 9 == $month) { + if (1752 == $year && 8 == $month) { return 19; } - if (2 == $month && 0 == $year % 4) { + if (1 == $month && 0 == $year % 4) { return 29; } } else { #Check if Leap year - if (2 == $month && 0 == $year % 4 && 0 == $year%100 + if (1 == $month && 0 == $year % 4 && 0 == $year%100 || 0 == $year%400) { return 29; } diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 5fe04d52a5..b2e13e77de 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 450b7666ab..6257dda67c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.725 -%define release 180813 +%define version 7.0NG.726 +%define release 180817 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 97864d8c97..8499bed00c 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -8,8 +8,8 @@ # This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.725" -PI_BUILD="180813" +PI_VERSION="7.0NG.726" +PI_BUILD="180817" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0dcb0dd9c2..31ed211033 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180813"; +my $version = "7.0NG.726 PS180817"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d21043fd72..50a8b51335 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180813"; +my $version = "7.0NG.726 PS180817"; # save program name for logging my $progname = basename($0);