diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index c39b6930fd..fd056492a0 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 5.1SP1RC2, AIX version +# Version 5.1SP1RC3, 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 a2b03ae42f..4b7242d21c 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 5.1SP1RC2, FreeBSD Version +# Version 5.1SP1RC3, 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 7c2b01600e..36990da852 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 5.1SP1RC2, HP-UX Version +# Version 5.1SP1RC3, 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 ee7b05f78d..60c5a8c994 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 5.1SP1RC2, GNU/Linux +# Version 5.1SP1RC3, 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 e1267a47a0..3dd0593464 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 5.1SP1RC2, GNU/Linux +# Version 5.1SP1RC3, 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 c13bcd5a85..3ce8753bbc 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 5.1SP1RC2, Solaris Version +# Version 5.1SP1RC3, 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 1f69985b18..5c8763dc68 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 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 2ec67f68a6..fc9282334e 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 5.1SP1RC2, AIX version +# Version 5.1SP1RC3, 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 9a345fd2d2..2adf0c4067 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 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 6a4deb99f1..740a114268 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 5.1SP1RC2, HPUX Version +# Version 5.1SP1RC3, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 42f1d1cea3..7560dbcfa6 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 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 ce406761e8..1628c2b7e9 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 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 087f856b0e..0b10480ac8 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 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 bd90508643..8416cb74d3 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 5.1SP1RC2, Solaris version +# Version 5.1SP1RC3, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 8048c8fc4c..2d8fe0f3c7 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 5.1SP1RC2, AIX version +# Version 5.1SP1RC3, 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 da174cddaf..11137cef2c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 5.1SP1RC2-141021 +Version: 5.1SP1RC3-141024 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 56001cade9..7df691f180 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="5.1SP1RC2-141021" +pandora_version="5.1SP1RC3-141024" 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 d2876a1ae0..3ddc4bdc7a 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 5.1SP1RC2, GNU/Linux +# Version 5.1SP1RC3, 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 f23d75c0ad..823a772b1b 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 5.1SP1RC2, FreeBSD Version +# Version 5.1SP1RC3, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 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 9773a6ca4c..906d1cc9a3 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 5.1SP1RC2, HP-UX Version +# Version 5.1SP1RC3, 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 bff13358ab..9cc7bafee6 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 5.1SP1RC2, GNU/Linux +# Version 5.1SP1RC3, 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 5b374259ff..f86467ae71 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 5.1SP1RC2, GNU/Linux +# Version 5.1SP1RC3, 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 856244de4d..5f3cb1e06c 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 5.1SP1RC2, NetBSD Version +# Version 5.1SP1RC3, 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 5c0eb76bc4..6899fc9997 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 5.1SP1RC2, Solaris Version +# Version 5.1SP1RC3, 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 b1e57b087c..ffa0093aeb 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -40,8 +40,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '5.1SP1RC2'; -use constant AGENT_BUILD => '141021'; +use constant AGENT_VERSION => '5.1SP1RC3'; +use constant AGENT_BUILD => '141024'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 109835dae0..3803f2f017 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 5.1SP1RC2 -%define release 141021 +%define version 5.1SP1RC3 +%define release 141024 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 28dcb11590..b4580ca5fb 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 5.1SP1RC2 -%define release 141021 +%define version 5.1SP1RC3 +%define release 141024 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index e75f5d6c12..91a7214a02 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-2014 Artica Soluciones Tecnologicas -# Version 5.1SP1RC2 +# Version 5.1SP1RC3 # 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 b3e5f6aaee..3dec7a3998 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 v5.1SP1RC2} +{Pandora FMS Windows Agent v5.1SP1RC3} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{141021} +{141024} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 63f59daff8..7061810864 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 ("5.1SP1RC2(Build 141021)") +#define PANDORA_VERSION ("5.1SP1RC3(Build 141024)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bcf8467c1d..6ee8830f4a 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", "(5.1SP1RC2(Build 141021))" + VALUE "ProductVersion", "(5.1SP1RC3(Build 141024))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a32f0e74c1..5267937d74 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 5.1SP1RC2-141021 +Version: 5.1SP1RC3-141024 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 4c55b2c143..043b61b940 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="5.1SP1RC2-141021" +pandora_version="5.1SP1RC3-141024" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1c3c93505b..c790c62907 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 = 'PC141021'; -$pandora_version = 'v5.1SP1RC2'; +$build_version = 'PC141024'; +$pandora_version = 'v5.1SP1RC3'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 7f7fc7dc2d..b8cd3e683f 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1187,4 +1187,25 @@ function db_get_fields($table) { break; } } + +/** + * @param int Unix timestamp with the date. + * + * @return bool Returns true if the history db has data after the date provided or false otherwise. + */ +function db_search_in_history_db ($utimestamp) { + global $config; + + $search_in_history_db = false; + if ($config['history_db_enabled'] == 1) { + $history_db_start_period = $config['history_db_days'] * SECONDS_1DAY; + + // If the date is newer than the newest history db data + if (time() - $history_db_start_period >= $utimestamp) + $search_in_history_db = true; + } + + return $search_in_history_db; +} + ?> \ No newline at end of file diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5dc4ff4461..d474f61e04 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -495,6 +495,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, // Set variables if ($date == 0) $date = get_system_time(); $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); $resolution = $config['graph_res'] * 50; //Number of points of the graph $interval = (int) ($period / $resolution); $agent_name = modules_get_agentmodule_agent_name ($agent_module_id); @@ -539,7 +540,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, "utimestamp > $datelimit", "utimestamp < $date", 'order' => 'utimestamp ASC'), - array ('datos', 'utimestamp'), 'AND', true); + array ('datos', 'utimestamp'), 'AND', $search_in_history_db); // Get module warning_min and critical_min $warning_min = db_get_value('min_warning','tagente_modulo','id_agente_modulo',$agent_module_id); @@ -913,6 +914,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, if ($date == 0) $date = get_system_time(); $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); $resolution = $config['graph_res'] * 50; //Number of points of the graph $interval = (int) ($period / $resolution); @@ -1063,7 +1065,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, "utimestamp > $datelimit", "utimestamp < $date", 'order' => 'utimestamp ASC'), - array ('datos', 'utimestamp'), 'AND', true); + array ('datos', 'utimestamp'), 'AND', $search_in_history_db); if ($data === false) { $data = array (); } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 5627f395a7..82a3075254 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1497,7 +1497,9 @@ function modules_get_previous_data ($id_agent_module, $utimestamp = 0, $string = ORDER BY utimestamp DESC', $id_agent_module, $utimestamp, $utimestamp - SECONDS_2DAY); - return db_get_row_sql ($sql, true); + $search_in_history_db = db_search_in_history_db($utimestamp); + + return db_get_row_sql ($sql, $search_in_history_db); } /** @@ -1529,7 +1531,9 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0) ORDER BY utimestamp ASC', $id_agent_module, $utimestamp + $interval, $utimestamp); - return db_get_row_sql ($sql, true); + $search_in_history_db = db_search_in_history_db($utimestamp); + + return db_get_row_sql ($sql, $search_in_history_db); } /** @@ -1550,6 +1554,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) { } $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); switch ($module['id_tipo_modulo']) { //generic_data_string @@ -1586,7 +1591,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) { break; } - $values = db_get_all_rows_sql ($sql, true, false); + $values = db_get_all_rows_sql ($sql, $search_in_history_db, false); if ($values === false) { return array (); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index cd9b12b990..9c00b0ab87 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -52,6 +52,8 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period=0, $d // Initialize variables if (empty ($date)) $date = get_system_time (); $datelimit = $date - $period; + + $search_in_history_db = db_search_in_history_db($datelimit); $id_module_type = modules_get_agentmodule_type ($id_agent_module); $module_type = modules_get_moduletype_name ($id_module_type); @@ -63,7 +65,7 @@ function reporting_get_agentmodule_data_average ($id_agent_module, $period=0, $d WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Uncompressed module data @@ -155,7 +157,9 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period=0, $date // Initialize variables if (empty ($date)) $date = get_system_time (); $datelimit = $date - $period; - + + $search_in_history_db = db_search_in_history_db($datelimit); + $id_module_type = modules_get_agentmodule_type ($id_agent_module); $module_type = modules_get_moduletype_name ($id_module_type); $uncompressed_module = is_module_uncompressed ($module_type); @@ -166,7 +170,7 @@ function reporting_get_agentmodule_data_max ($id_agent_module, $period=0, $date WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Uncompressed module data @@ -233,7 +237,9 @@ function reporting_get_agentmodule_data_min ($id_agent_module, $period=0, $date // Initialize variables if (empty ($date)) $date = get_system_time (); - $datelimit = $date - $period; + $datelimit = $date - $period; + + $search_in_history_db = db_search_in_history_db($datelimit); $id_module_type = modules_get_agentmodule_type ($id_agent_module); $module_type = modules_get_moduletype_name ($id_module_type); @@ -245,7 +251,7 @@ function reporting_get_agentmodule_data_min ($id_agent_module, $period=0, $date WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Uncompressed module data @@ -307,6 +313,8 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period=0, $date // Initialize variables if (empty ($date)) $date = get_system_time (); $datelimit = $date - $period; + + $search_in_history_db = db_search_in_history_db($datelimit); $id_module_type = db_get_value ('id_tipo_modulo', 'tagente_modulo','id_agente_modulo', $id_agent_module); $module_name = db_get_value ('nombre', 'ttipo_modulo', 'id_tipo', $id_module_type); @@ -326,7 +334,7 @@ function reporting_get_agentmodule_data_sum ($id_agent_module, $period=0, $date WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Uncompressed module data @@ -414,6 +422,8 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $min_valu } // Limit date to start searching data $datelimit = $date - $period; + + $search_in_history_db = db_search_in_history_db($datelimit); // Get interval data $sql = sprintf ('SELECT * @@ -464,7 +474,7 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0, $min_valu $sql .= ' AND (TIME(FROM_UNIXTIME(utimestamp)) >= "' . $timeFrom . '" OR TIME(FROM_UNIXTIME(utimestamp)) <= "'. $timeTo . '")'; } $sql .= ' ORDER BY utimestamp ASC'; - $interval_data = db_get_all_rows_sql ($sql, true); + $interval_data = db_get_all_rows_sql ($sql, $search_in_history_db); if ($interval_data === false) { $interval_data = array (); @@ -578,6 +588,8 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi } // Limit date to start searching data $datelimit = $date - $period; + + $search_in_history_db = db_search_in_history_db($datelimit); // Get interval data $sql = sprintf ('SELECT * FROM tagente_datos @@ -631,7 +643,7 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi } $sql .= ' ORDER BY utimestamp ASC'; - $interval_data = db_get_all_rows_sql ($sql, true); + $interval_data = db_get_all_rows_sql ($sql, $search_in_history_db); if ($interval_data === false) { $interval_data = array (); @@ -887,7 +899,7 @@ function reporting_get_planned_downtimes_intervals ($id_agent_module, $start_dat AND tpda.all_modules = 1 AND tpda.id_agent = tam.id_agente AND tam.id_agente_modulo = $id_agent_module - UNION + UNION ALL SELECT tpd.* FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm WHERE tpd.id = tpdm.id_downtime @@ -1209,7 +1221,7 @@ function reporting_get_planned_downtimes ($start_date, $end_date, $id_agent_modu OR (date_from <= '$start_date' AND date_to >= '$end_date') OR (date_from <= '$start_date' AND date_to >= '$start_date') OR (date_from <= '$end_date' AND date_to >= '$end_date')))) - UNION + UNION ALL SELECT tpd.* FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm WHERE (tpd.id = tpdm.id_downtime @@ -4996,13 +5008,14 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f array_unshift($table2->head, __('Date')); $datelimit = $report["datetime"] - $content['period']; + $search_in_history_db = db_search_in_history_db($datelimit); // This query gets information from the default and the historic database $result = db_get_all_rows_sql('SELECT * FROM tagente_datos WHERE id_agente_modulo = ' . $content['id_agent_module'] . ' AND utimestamp > ' . $datelimit . ' - AND utimestamp <= ' . $report["datetime"], true); + AND utimestamp <= ' . $report["datetime"], $search_in_history_db); // Adds string data if there is no numeric data if ((count($result) < 0) or (!$result)) { @@ -5011,7 +5024,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f FROM tagente_datos_string WHERE id_agente_modulo = ' . $content['id_agent_module'] . ' AND utimestamp > ' . $datelimit . ' - AND utimestamp <= ' . $report["datetime"], true); + AND utimestamp <= ' . $report["datetime"], $search_in_history_db); } if ($result === false) { $result = array(); @@ -7122,7 +7135,9 @@ function reporting_get_agentmodule_mtbf ($id_agent_module, $period = 0, $date = if (empty ($date)) $date = get_system_time (); // Read module configuration - $datelimit = $date - $period; + $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); + $module = db_get_row_sql ('SELECT max_critical, min_critical, id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ' . (int) $id_agent_module); @@ -7146,7 +7161,7 @@ function reporting_get_agentmodule_mtbf ($id_agent_module, $period = 0, $date = WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Get previous data @@ -7232,7 +7247,9 @@ function reporting_get_agentmodule_mttr ($id_agent_module, $period = 0, $date = if (empty ($date)) $date = get_system_time (); // Read module configuration - $datelimit = $date - $period; + $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); + $module = db_get_row_sql ('SELECT max_critical, min_critical, id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ' . (int) $id_agent_module); @@ -7256,7 +7273,7 @@ function reporting_get_agentmodule_mttr ($id_agent_module, $period = 0, $date = WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Get previous data @@ -7341,7 +7358,9 @@ function reporting_get_agentmodule_tto ($id_agent_module, $period = 0, $date = 0 if (empty ($date)) $date = get_system_time (); // Read module configuration - $datelimit = $date - $period; + $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); + $module = db_get_row_sql ('SELECT max_critical, min_critical, id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ' . (int) $id_agent_module); @@ -7365,7 +7384,7 @@ function reporting_get_agentmodule_tto ($id_agent_module, $period = 0, $date = 0 WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Get previous data @@ -7441,7 +7460,9 @@ function reporting_get_agentmodule_ttr ($id_agent_module, $period = 0, $date = 0 if (empty ($date)) $date = get_system_time (); // Read module configuration - $datelimit = $date - $period; + $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); + $module = db_get_row_sql ('SELECT max_critical, min_critical, id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ' . (int) $id_agent_module); @@ -7465,7 +7486,7 @@ function reporting_get_agentmodule_ttr ($id_agent_module, $period = 0, $date = 0 WHERE id_agente_modulo = ' . (int) $id_agent_module . ' AND utimestamp > ' . (int) $datelimit . ' AND utimestamp < ' . (int) $date . - ' ORDER BY utimestamp ASC', true); + ' ORDER BY utimestamp ASC', $search_in_history_db); if ($interval_data === false) $interval_data = array (); // Get previous data diff --git a/pandora_console/include/help/ja/help_plugin_macros.php b/pandora_console/include/help/ja/help_plugin_macros.php index b3ba360886..794a43e629 100644 --- a/pandora_console/include/help/ja/help_plugin_macros.php +++ b/pandora_console/include/help/ja/help_plugin_macros.php @@ -9,25 +9,33 @@ 次のマクロが利用できます:
+
diff --git a/pandora_console/install.php b/pandora_console/install.php index 0f509e59d8..605d357214 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -62,8 +62,8 @@