From 4af3b2b1aa4c6a89772bb3b1b246790b00a9b674 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 9 Mar 2016 15:59:36 +0100 Subject: [PATCH 01/46] Fixed problems with order data in custom graphs (cherry picked from commit 093d9ad313828c32af46b107a54dbe79b3c913e3) --- pandora_console/include/functions_graph.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f7798c5358..a4388b72b4 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1428,7 +1428,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, FROM tagente_datos WHERE id_agente_modulo = ' . (int) $module . ' AND utimestamp > ' . (int) $datelimit . - ' AND utimestamp < ' . (int) $date); + ' AND utimestamp < ' . (int) $date) . + " ORDER BY utimestamp DESC"; if ($temp_data) { if (is_numeric($temp_data)) @@ -1483,7 +1484,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, FROM tagente_datos WHERE id_agente_modulo = ' . (int) $module . ' AND utimestamp > ' . (int) $datelimit . - ' AND utimestamp < ' . (int) $date); + ' AND utimestamp < ' . (int) $date) . + " ORDER BY utimestamp DESC"; $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($module)); @@ -1524,7 +1526,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, FROM tagente_datos WHERE id_agente_modulo = ' . (int) $module . ' AND utimestamp > ' . (int) $datelimit . - ' AND utimestamp < ' . (int) $date); + ' AND utimestamp < ' . (int) $date) . + " ORDER BY utimestamp DESC"; if ( $temp_data ){ if (is_numeric($temp_data)) $value = $temp_data; @@ -1576,7 +1579,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, FROM tagente_datos WHERE id_agente_modulo = ' . (int) $module . ' AND utimestamp > ' . (int) $datelimit . - ' AND utimestamp < ' . (int) $date); + ' AND utimestamp < ' . (int) $date) . + " ORDER BY utimestamp DESC"; if ( $temp_data ) { if (is_numeric($temp_data)) $value = $temp_data; From 663afaeae361fb6ec6853564e5bed78c5e6b2a94 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 10 Mar 2016 00:01:27 +0100 Subject: [PATCH 02/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 10aed9fc2a..8218b2a498 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160309 +Version: 6.1dev-160310 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 463420be52..f8903bdf82 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="6.1dev-160309" +pandora_version="6.1dev-160310" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 2912df38f8..a5b9d69b35 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160309'; +use constant AGENT_BUILD => '160310'; # 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 570af69f44..97016cf1e6 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160309 +%define release 160310 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 ae1d947a7f..f0ab9fbddb 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160309 +%define release 160310 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 b9ccd0b9a2..8d2c980088 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160309" +PI_BUILD="160310" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a1a5e71b0d..dc257000f1 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160309} +{160310} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ef77cd0d18..0bac0e8193 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 ("6.1dev(Build 160309)") +#define PANDORA_VERSION ("6.1dev(Build 160310)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 09bca8039d..b71d9942e7 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", "(6.1dev(Build 160309))" + VALUE "ProductVersion", "(6.1dev(Build 160310))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 895e976cb6..731747be86 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160309 +Version: 6.1dev-160310 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 5a67d8d81b..2a20d97975 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="6.1dev-160309" +pandora_version="6.1dev-160310" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 715242ac7b..76ff05a3d0 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160309'; +$build_version = 'PC160310'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f95ae69478..2081fa3774 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 10 Mar 2016 10:47:02 +0100 Subject: [PATCH 03/46] Fixed error in php with acl enterprise. Tiquet: #3457 --- pandora_console/include/functions_menu.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 75f92e9e86..9e0d356b62 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -330,7 +330,7 @@ function menu_print_menu (&$menu) { $count_sub2 = 0; foreach ($sub['sub2'] as $key => $sub2) { - if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec, $subsec2, false,$key)) == false) { + if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec, $subsec2, false, $key)) == false) { continue; } @@ -387,17 +387,15 @@ function menu_print_menu (&$menu) { } } - - if ($menu_selected) $seleccionado = 'selected'; else $seleccionado = ''; - + //Print out the first level $output .= '
  • '; //onclick="location.href=\'index.php?sec='.$mainsec.'&sec2='.$main["sec2"].($main["refr"] ? '&refr='.$main["refr"] : '').'\'">'; - + $length = strlen(__($main["text"])); $padding_top = ( $length >= 18) ? 6 : 12; @@ -663,7 +661,7 @@ function menu_get_sec2_pages($sec, $sec2, $menu_hash = false) { $sec3_array = array(); - if (isset($sec2)) { + if (isset($menu[$sec]['sub']) AND isset($menu[$sec]['sub'][$sec2]['sub2'])) { // Get the sec2 of the subsections foreach ($menu[$sec]['sub'][$sec2]['sub2'] as $k => $v) { $sec3_array[$k] = $v['text']; From 50e3f6bebe0a1c691f3341f3d74637c64215a6a0 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 11 Mar 2016 00:01:26 +0100 Subject: [PATCH 04/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8218b2a498..ab96125ff8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160310 +Version: 6.1dev-160311 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 f8903bdf82..7c510b16af 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="6.1dev-160310" +pandora_version="6.1dev-160311" 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/pandora_agent b/pandora_agents/unix/pandora_agent index a5b9d69b35..b4002a7187 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160310'; +use constant AGENT_BUILD => '160311'; # 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 97016cf1e6..f289d44aa9 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160310 +%define release 160311 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 f0ab9fbddb..7fd05152f1 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160310 +%define release 160311 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 8d2c980088..734c0c8bec 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160310" +PI_BUILD="160311" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index dc257000f1..2d9751ad8d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160310} +{160311} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0bac0e8193..dcf370a6f3 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 ("6.1dev(Build 160310)") +#define PANDORA_VERSION ("6.1dev(Build 160311)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b71d9942e7..bdac829a3f 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", "(6.1dev(Build 160310))" + VALUE "ProductVersion", "(6.1dev(Build 160311))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 731747be86..32380e626e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160310 +Version: 6.1dev-160311 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 2a20d97975..6d022e010a 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="6.1dev-160310" +pandora_version="6.1dev-160311" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 76ff05a3d0..78df31e23e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160310'; +$build_version = 'PC160311'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2081fa3774..5c6dec5fea 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
    Date: Sat, 12 Mar 2016 00:01:23 +0100 Subject: [PATCH 05/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ab96125ff8..c970a67932 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160311 +Version: 6.1dev-160312 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 7c510b16af..0a9029cacd 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="6.1dev-160311" +pandora_version="6.1dev-160312" 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/pandora_agent b/pandora_agents/unix/pandora_agent index b4002a7187..1e87bdb8ca 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160311'; +use constant AGENT_BUILD => '160312'; # 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 f289d44aa9..7069da0251 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160311 +%define release 160312 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 7fd05152f1..77e3dadb36 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160311 +%define release 160312 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 734c0c8bec..a68d988999 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160311" +PI_BUILD="160312" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2d9751ad8d..bb125947b4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160311} +{160312} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index dcf370a6f3..70c7696e6c 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 ("6.1dev(Build 160311)") +#define PANDORA_VERSION ("6.1dev(Build 160312)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bdac829a3f..1913a98ab9 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", "(6.1dev(Build 160311))" + VALUE "ProductVersion", "(6.1dev(Build 160312))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 32380e626e..d8a13d0304 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160311 +Version: 6.1dev-160312 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 6d022e010a..3c66838ec1 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="6.1dev-160311" +pandora_version="6.1dev-160312" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 78df31e23e..4321b79190 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160311'; +$build_version = 'PC160312'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5c6dec5fea..4ce6371fba 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
    Date: Sun, 13 Mar 2016 00:01:13 +0100 Subject: [PATCH 06/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c970a67932..05e47ff44f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160312 +Version: 6.1dev-160313 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 0a9029cacd..8ec6d59eab 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="6.1dev-160312" +pandora_version="6.1dev-160313" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 1e87bdb8ca..97e513d6e1 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160312'; +use constant AGENT_BUILD => '160313'; # 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 7069da0251..ff01cd250d 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160312 +%define release 160313 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 77e3dadb36..1af181f97f 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160312 +%define release 160313 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 a68d988999..5d63b387f4 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160312" +PI_BUILD="160313" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index bb125947b4..96d3743c17 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160312} +{160313} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 70c7696e6c..1aae2aa197 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 ("6.1dev(Build 160312)") +#define PANDORA_VERSION ("6.1dev(Build 160313)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1913a98ab9..62bf3e4738 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", "(6.1dev(Build 160312))" + VALUE "ProductVersion", "(6.1dev(Build 160313))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d8a13d0304..73d96d215a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160312 +Version: 6.1dev-160313 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 3c66838ec1..cb6a167eff 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="6.1dev-160312" +pandora_version="6.1dev-160313" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4321b79190..18a9341faa 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160312'; +$build_version = 'PC160313'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4ce6371fba..f060373f1e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
    Date: Mon, 14 Mar 2016 00:01:13 +0100 Subject: [PATCH 07/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 05e47ff44f..17e4690771 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160313 +Version: 6.1dev-160314 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 8ec6d59eab..e6ea1657dc 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="6.1dev-160313" +pandora_version="6.1dev-160314" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 97e513d6e1..133c10b060 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160313'; +use constant AGENT_BUILD => '160314'; # 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 ff01cd250d..aeea222606 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160313 +%define release 160314 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 1af181f97f..c41fd6d679 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160313 +%define release 160314 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 5d63b387f4..e233d09f95 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160313" +PI_BUILD="160314" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 96d3743c17..db1b922dc6 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160313} +{160314} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1aae2aa197..8628298885 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 ("6.1dev(Build 160313)") +#define PANDORA_VERSION ("6.1dev(Build 160314)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 62bf3e4738..c6426b8e91 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", "(6.1dev(Build 160313))" + VALUE "ProductVersion", "(6.1dev(Build 160314))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 73d96d215a..b5d3e91029 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160313 +Version: 6.1dev-160314 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 cb6a167eff..fba148d921 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="6.1dev-160313" +pandora_version="6.1dev-160314" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 18a9341faa..2f027d62e4 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160313'; +$build_version = 'PC160314'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f060373f1e..e434d9c876 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
    Date: Mon, 14 Mar 2016 10:53:03 +0100 Subject: [PATCH 08/46] Modified SLA to work only in working time properly. TICKETS #3370 Graphs are modified to show without having consideration of working time --- pandora_console/include/functions_graph.php | 2 +- .../include/functions_reporting.php | 219 +++++++++++++++++- 2 files changed, 213 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index a4388b72b4..e991867308 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2108,7 +2108,7 @@ function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek // If the data is not provided, we got it if ($data === false) { $data = reporting_get_agentmodule_sla_array ($id, $period, - $sla_min, $sla_max, $date, $daysWeek, $time_from, $time_to); + $sla_min, $sla_max, $date, $daysWeek, null, null); } $col_planned_downtime = '#20973F'; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f64ed6dc82..d11818c6c3 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7741,7 +7741,15 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ // Limit date to start searching data $datelimit = $date - $period; - + // Substract the not working time + // Initialize the working time status machine ($wt_status) + // Search the first data at worktime start + list ($period_reduced, $wt_status, $datelimit_increased) = reporting_get_agentmodule_sla_day_period ($period, $date, $timeFrom, $timeTo); + if ($period_reduced <= 0) { + return false; + } + + $wt_points = reporting_get_agentmodule_sla_working_timestamp ($period, $date, $timeFrom, $timeTo); $search_in_history_db = db_search_in_history_db($datelimit); @@ -7784,7 +7792,7 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ } } - + /* The not working time consideration is now doing in foreach loop above switch ($config["dbtype"]) { case "mysql": case "postgresql": @@ -7801,6 +7809,7 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ case "oracle": break; } + * */ $sql .= ' ORDER BY utimestamp ASC'; @@ -7815,11 +7824,17 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ reporting_get_planned_downtimes_intervals($id_agent_module, $datelimit, $date); // Get previous data - $previous_data = modules_get_previous_data($id_agent_module, $datelimit); + $previous_data = modules_get_previous_data($id_agent_module, $datelimit + $datelimit_increased); if ($previous_data !== false) { - $previous_data['utimestamp'] = $datelimit; + $previous_data['utimestamp'] = $datelimit + $datelimit_increased; array_unshift ($interval_data, $previous_data); + } else if (count ($interval_data) > 0) { + // Propagate undefined status to first time point + $first_interval_time = array_shift ($interval_data); + html_debug ($first_interval_time); + $period_reduced -= $first_interval_time['utimestamp'] - $datelimit + $datelimit_increased; + array_unshift ($interval_data, $first_interval_time); } // Get next data @@ -7868,8 +7883,18 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ foreach ($interval_data as $data) { - // Previous status was critical - if ($previous_status == 1) { + // Test if working time is changed + while ($wt_points[0] <= $data['utimestamp']) { + $intermediate_point = array_shift($wt_points); + if ($wt_status && ($previous_status == 1)) { + $bad_period += $intermediate_point - $previous_utimestamp; + } + $previous_utimestamp = $intermediate_point; + $wt_status = !$wt_status; + } + + // Increses bad_period only if it is working time + if ($wt_status && ($previous_status == 1)) { $bad_period += $data['utimestamp'] - $previous_utimestamp; } @@ -7895,7 +7920,7 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ // Return the percentage of SLA compliance - return (float) (100 - ($bad_period / $period) * 100); + return (float) (100 - ($bad_period / $period_reduced) * 100); } /** @@ -8505,4 +8530,184 @@ function reporting_format_planned_downtime_dates ($planned_downtime) { return $dates; } +/** + * Get real period in SLA subtracting worktime period. + * Get if is working in the first point + * Get time between first point and + * + * @param int Period to check the SLA compliance. + * @param int Date_end date end the sla compliace interval + * @param int Working Time start + * @param int Working Time end + * + * @return array (int fixed SLA period, bool inside working time) + * found + */ +function reporting_get_agentmodule_sla_day_period ($period, $date_end, $wt_start = "00:00:00", $wt_end = "23:59:59") { + + $date_start = $date_end - $period; + // Converts to timestamp + $human_date_end = date ('H:i:s', $date_end); + $human_date_start = date ('H:i:s', $date_start); + // Store into an array the points + // "s" start SLA interval point + // "e" end SLA interval point + // "f" start worktime interval point (from) + // "t" end worktime interval point (to) + $tp = array ( + "s" => strtotime($human_date_start), + "e" => strtotime($human_date_end), + "f" => strtotime($wt_start), + "t" => strtotime($wt_end) + ); + + asort ($tp); + $order = ""; + foreach ($tp as $type => $time) { + $order .= $type; + } + + $period_reduced = $period; + $start_working = true; + $datelimit_increased = 0; + + //Special case. If $order = "seft" and start time == end time it should be treated like "esft" + if (($period > 0) and ($human_date_end == $human_date_start) and ($order == "seft")) { + $order = "esft"; + } + + // Discriminates the cases depends what time point is higher than other + switch ($order) { + + case "setf": + case "etfs": + case "tfse": + case "fset": + // Default $period_reduced + // Default $start_working + // Default $datelimit_increased + break; + case "stef": + case "tefs": + case "fste": + $period_reduced = $period - ($tp["e"] - $tp["t"]); + // Default $start_working + // Default $datelimit_increased + break; + case "stfe": + case "estf": + case "tfes": + $period_reduced = $period - ($tp["f"] -$tp["t"]); + // Default $start_working + // Default $datelimit_increased + break; + case "tsef": + case "seft": + case "ftse": + case "efts": + $period_reduced = -1; + $start_working = false; + // Default $datelimit_increased + break; + case "tsfe": + case "etsf": + case "sfet": + $period_reduced = $period - ($tp["f"] - $tp["s"]); + $start_working = false; + $datelimit_increased = $tp["f"] - $tp["s"]; + break; + case "efst": + $period_reduced = $tp["t"] - $tp["s"]; + // Default $start_working + // Default $datelimit_increased + break; + case "fest": + $period_reduced = ($tp["t"] - $tp["s"]) + ($tp["e"] - $tp["f"]); + // Default $start_working + // Default $datelimit_increased + break; + case "tesf": + $period_reduced = SECONDS_1DAY - ($tp["f"] - $tp["t"]); + $start_working = false; + $datelimit_increased = $tp["f"] - $tp["s"]; + break; + case "sfte": + case "esft": + $period_reduced = $tp["t"] - $tp["f"]; + $start_working = false; + $datelimit_increased = $tp["f"] - $tp["s"]; + break; + case "ftes": + $period_reduced = $tp["t"] - $tp["f"]; + $start_working = false; + $datelimit_increased = $tp["f"] + SECONDS_1DAY - $tp["s"]; + break; + case "fets": + $period_reduced = $tp["e"] - $tp["f"]; + $start_working = false; + $datelimit_increased = $tp["f"] + SECONDS_1DAY - $tp["s"]; + break; + default: + // Default $period_reduced + // Default $start_working + // Default $datelimit_increased + break; + } + + return array ($period_reduced, $start_working, $datelimit_increased); +} + +/** + * Get working time SLA in timestamp form. Get all items and discard previous not necessaries + * + * @param int Period to check the SLA compliance. + * @param int Date_end date end the sla compliace interval + * @param int Working Time start + * @param int Working Time end + * + * @return array work time points + * found + */ +function reporting_get_agentmodule_sla_working_timestamp ($period, $date_end, $wt_start = "00:00:00", $wt_end = "23:59:59") { + + $date_previous_day = $date_end - SECONDS_1DAY; + $wt = array (); + + // Calculate posibles data points + $relative_date_end = strtotime (date ('H:i:s', $date_end)); + $relative_00_00_00 = strtotime ("00:00:00"); + $relative_wt_start = strtotime($wt_start) - $relative_00_00_00; + $relative_wt_end = strtotime($wt_end) - $relative_00_00_00; + + $absolute_previous_00_00_00 = $date_previous_day - ($relative_date_end - $relative_00_00_00); + $absolute_00_00_00 = $date_end - ($relative_date_end - $relative_00_00_00); + array_push ($wt, $absolute_previous_00_00_00); + if ($relative_wt_start < $relative_wt_end) { + array_push ($wt, $absolute_previous_00_00_00 + $relative_wt_start); + array_push ($wt, $absolute_previous_00_00_00 + $relative_wt_end); + array_push ($wt, $absolute_00_00_00 + $relative_wt_start); + array_push ($wt, $absolute_00_00_00 + $relative_wt_end); + } else { + array_push ($wt, $absolute_previous_00_00_00 + $relative_wt_end); + array_push ($wt, $absolute_previous_00_00_00 + $relative_wt_start); + array_push ($wt, $absolute_00_00_00 + $relative_wt_end); + array_push ($wt, $absolute_00_00_00 + $relative_wt_start); + } + array_push ($wt, $absolute_00_00_00 + SECONDS_1DAY); + + //Discard outside period time points + $date_start = $date_end - $period; + + $first_time = array_shift ($wt); + while ($first_time < $date_start) { + if (empty ($wt)) { + return $wt; + } + $first_time = array_shift ($wt); + } + array_unshift ($wt, $first_time); + + return $wt; +} + ?> \ No newline at end of file From 1aed97cbd48b0b7febba6ce6440512812a75efaf Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 14 Mar 2016 12:02:03 +0100 Subject: [PATCH 09/46] Removed unwanted trace --- pandora_console/include/functions_reporting.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index d11818c6c3..f4fdcd167d 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7832,7 +7832,6 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ } else if (count ($interval_data) > 0) { // Propagate undefined status to first time point $first_interval_time = array_shift ($interval_data); - html_debug ($first_interval_time); $period_reduced -= $first_interval_time['utimestamp'] - $datelimit + $datelimit_increased; array_unshift ($interval_data, $first_interval_time); } @@ -8710,4 +8709,4 @@ function reporting_get_agentmodule_sla_working_timestamp ($period, $date_end, $w return $wt; } -?> \ No newline at end of file +?> From 5cf268e986f522f4d4e689cc89481c0742fdfe0d Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 14 Mar 2016 15:53:43 +0100 Subject: [PATCH 10/46] Fixed some fails in SLA operation due to Working time improvement #3470 --- pandora_console/include/functions_reporting.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f4fdcd167d..18d7819d04 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7834,6 +7834,15 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ $first_interval_time = array_shift ($interval_data); $period_reduced -= $first_interval_time['utimestamp'] - $datelimit + $datelimit_increased; array_unshift ($interval_data, $first_interval_time); + // Remove rebased points + while ($wt_points[0] <= $first_interval_time['utimestamp']) { + array_shift ($wt_points); + $wt_status = !$wt_status; + } + } + + if (count ($wt_points) < 2) { + return false; } // Get next data From e1783604a6deea1540e0f7ec55fa87b63d565af9 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 15 Mar 2016 00:01:20 +0100 Subject: [PATCH 11/46] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 17e4690771..21f4d41be1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160314 +Version: 6.1dev-160315 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 e6ea1657dc..c7efffd452 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="6.1dev-160314" +pandora_version="6.1dev-160315" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 133c10b060..d688b2b11e 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160314'; +use constant AGENT_BUILD => '160315'; # 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 aeea222606..185c88cf8a 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160314 +%define release 160315 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 c41fd6d679..6e468784b8 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160314 +%define release 160315 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 e233d09f95..e6d6354a94 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160314" +PI_BUILD="160315" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index db1b922dc6..d1fa784fc8 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160314} +{160315} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8628298885..0db53a223b 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 ("6.1dev(Build 160314)") +#define PANDORA_VERSION ("6.1dev(Build 160315)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c6426b8e91..617667d3e4 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", "(6.1dev(Build 160314))" + VALUE "ProductVersion", "(6.1dev(Build 160315))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b5d3e91029..84e16cf4d1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160314 +Version: 6.1dev-160315 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 fba148d921..66f73800f0 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="6.1dev-160314" +pandora_version="6.1dev-160315" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2f027d62e4..80ae59ab5b 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160314'; +$build_version = 'PC160315'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e434d9c876..4536122f6b 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
    Date: Tue, 15 Mar 2016 09:25:48 +0100 Subject: [PATCH 12/46] Fixed problems with dashboard performance when include users maps. Tiquet: #3438 (cherry picked from commit e3e549cbe8b57b0065edfcf78d239b4d469713a7) --- .../include/ajax/visual_console.ajax.php | 3 +- .../include/functions_custom_graphs.php | 5 +- pandora_console/include/functions_graph.php | 15 +- .../include/functions_visual_map.php | 15 +- pandora_console/include/graphs/fgraph.php | 270 ++++++++++++------ .../include/graphs/flot/pandora.flot.js | 24 +- .../include/graphs/functions_d3.php | 4 +- .../include/graphs/functions_flot.php | 21 +- .../operation/visual_console/render_view.php | 2 +- 9 files changed, 238 insertions(+), 121 deletions(-) diff --git a/pandora_console/include/ajax/visual_console.ajax.php b/pandora_console/include/ajax/visual_console.ajax.php index c927989130..9715ab7ff9 100644 --- a/pandora_console/include/ajax/visual_console.ajax.php +++ b/pandora_console/include/ajax/visual_console.ajax.php @@ -36,13 +36,14 @@ enterprise_include_once('include/functions_visual_map.php'); $id_visual_console = get_parameter('id_visual_console', null); $render_map = (bool)get_parameter('render_map', false); +$graph_javascript = (bool)get_parameter('graph_javascript', false); if ($render_map) { $width = (int)get_parameter('width', '400'); $height = (int)get_parameter('height', '400'); visual_map_print_visual_map($id_visual_console, true, true, $width, - $height); + $height, '', false, $graph_javascript); return; } diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index 5d82f997ac..db69a68698 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period, $background_color = 'white', $modules_param = array(), $homeurl = '', $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, $show_min = true, $show_avg = true, $ttl = 1, - $dashboard = false) { + $dashboard = false, $vconsole = false) { global $config; @@ -243,7 +243,8 @@ function custom_graphs_print($id_graph, $height, $width, $period, $show_min, $show_avg, $labels, - $dashboard); + $dashboard, + $vconsole); if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index e991867308..f6402da5e5 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -765,7 +765,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $unit = '', $baseline = 0, $return_data = 0, $show_title = true, $only_image = false, $homeurl = '', $ttl = 1, $projection = false, $adapt_key = '', $compare = false, $show_unknown = false, - $menu = true, $backgroundColor = 'white', $percentil = null) { + $menu = true, $backgroundColor = 'white', $percentil = null, + $dashboard = false, $vconsole = false) { global $config; global $graphic_type; @@ -892,7 +893,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $config['font_size'], $unit, $ttl, $series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false, $series_suffix_str, $menu, - $backgroundColor); + $backgroundColor, $dashboard, $vconsole); } } elseif ($config['type_module_charts'] === 'line') { @@ -969,7 +970,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $only_image = false, $homeurl = '', $ttl = 1, $projection = false, $prediction_period = false, $background_color = 'white', $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, - $show_min = true, $show_avg = true, $labels = false, $dashboard = false) { + $show_min = true, $show_avg = true, $labels = false, $dashboard = false, $vconsole = false) { global $config; global $graphic_type; @@ -1712,7 +1713,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, ui_get_full_url("images/image_problem.opaque.png", false, false, false), "", "", $homeurl, $water_mark, $config['fontpath'], $fixed_font_size, $unit, $ttl, array(), array(), 0, 0, '', - false, '', true, $background_color,$dashboard); + false, '', true, $background_color,$dashboard, $vconsole); break; default: case CUSTOM_GRAPH_STACKED_AREA: @@ -1720,21 +1721,21 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color,$dashboard); + "", $ttl, $homeurl, $background_color,$dashboard, $vconsole); break; case CUSTOM_GRAPH_LINE: return line_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - $unit, $ttl, $homeurl, $background_color,$dashboard); + $unit, $ttl, $homeurl, $background_color,$dashboard, $vconsole); break; case CUSTOM_GRAPH_STACKED_LINE: return stacked_line_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color,$dashboard); + "", $ttl, $homeurl, $background_color,$dashboard, $vconsole); break; case CUSTOM_GRAPH_BULLET_CHART: return stacked_bullet_chart($flash_charts, $graph_values, diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 2ca3115b18..e384b78f1c 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -88,7 +88,7 @@ function visual_map_print_user_line_handles($layoutData) { } function visual_map_print_item($mode = "read", $layoutData, - $proportion = null, $show_links = true, $isExternalLink = false) { + $proportion = null, $show_links = true, $isExternalLink = false, $graph_javascript = true) { global $config; require_once ($config["homedir"] . '/include/functions_graph.php'); @@ -771,12 +771,15 @@ function visual_map_print_item($mode = "read", $layoutData, if ($layoutData['id_custom_graph'] != 0) { $img = custom_graphs_print( $layoutData['id_custom_graph'], $height, $width, - $period, null, true, 0, true, $layoutData['image']); + $period, null, true, 0, true, $layoutData['image'], + array(), '', array(), array(), true, + true, true, true, 1, false, $graph_javascript); } else { $img = grafico_modulo_sparse($id_module, $period, 0, $width, - $height, '', null, false, 1, false, 0, '', 0, 0, true, true, - '', 1, false, '', false, false, true, $layoutData['image']); + $height, '', null, false, 1, false, 0, '', 0, 0, + true, true, '', 1, false, '', false, false, true, + $layoutData['image'], null, false, $graph_javascript); } //Restore db connection @@ -1918,7 +1921,7 @@ function visual_map_print_user_lines($layout_data, $proportion = null) { * @param bool $draw_lines */ function visual_map_print_visual_map ($id_layout, $show_links = true, - $draw_lines = true, $width = null, $height = null, $home_url = '', $isExternalLink = false) { + $draw_lines = true, $width = null, $height = null, $home_url = '', $isExternalLink = false, $graph_javascript = true) { enterprise_include_once('include/functions_visual_map.php'); @@ -2067,7 +2070,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, break; default: visual_map_print_item("read", $layout_data, - $proportion, $show_links, $isExternalLink); + $proportion, $show_links, $isExternalLink, $graph_javascript); break; } } diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 10fcd81883..12b249d036 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -218,7 +218,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key = '', $force_integer = false, $series_suffix_str = '', $menu = true, $backgroundColor = 'white', - $dashboard = false) { + $dashboard = false, $vconsole = false) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -260,35 +260,55 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $dashboard); } else { - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - $graph['backgroundColor'] = $backgroundColor; - $graph['unit'] = $unit; - $graph['series_type'] = $series_type; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - // Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "//" - - - - - return ""; + if ($vconsole) { + return flot_area_simple_graph( + $chart_data, + $width, + $height, + $color, + $legend, + $long_index, + $homeurl, + $unit, + $water_mark_url, + $series_type, + $chart_extra_data, + $yellow_threshold, + $red_threshold, + $adapt_key, + $force_integer, + $series_suffix_str, + $menu, + $backgroundColor, + $dashboard, + $vconsole); + } + else { + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + $graph['water_mark'] = $water_mark_file; + $graph['font'] = $font; + $graph['font_size'] = $font_size; + $graph['backgroundColor'] = $backgroundColor; + $graph['unit'] = $unit; + $graph['series_type'] = $series_type; + + $id_graph = serialize_in_temp($graph, null, $ttl); + // Warning: This string is used in the function "api_get_module_graph" from 'functions_api.php' with the regec patern "//" + return ""; + } } } @@ -296,7 +316,7 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white', - $dashboard = false) { + $dashboard = false, $vconsole = false) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -327,25 +347,51 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $dashboard); } else { - //Stack the data - stack_data($chart_data, $legend, $color); - - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - $graph['backgroundColor'] = $backgroundColor; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return ""; + if ($vconsole) { + return flot_area_stacked_graph( + $chart_data, + $width, + $height, + $color, + $legend, + $long_index, + $homeurl, + $unit, + $water_mark_url, + array(), + array(), + 0, + 0, + '', + false, + '', + true, + $backgroundColor, + $dashboard, + $vconsole); + } + else { + //Stack the data + stack_data($chart_data, $legend, $color); + + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + $graph['water_mark'] = $water_mark_file; + $graph['font'] = $font; + $graph['font_size'] = $font_size; + $graph['backgroundColor'] = $backgroundColor; + + $id_graph = serialize_in_temp($graph, null, $ttl); + + return ""; + } } } @@ -353,7 +399,7 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white', - $dashboard = false) { + $dashboard = false, $vconsole = false) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -385,25 +431,50 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $dashboard); } else { - //Stack the data - stack_data($chart_data, $legend, $color); - - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - $graph['backgroundColor'] = $backgroundColor; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return ""; + if ($vconsole) { + return flot_line_stacked_graph( + $chart_data, + $width, + $height, + $color, + $legend, + $long_index, + $homeurl, + $unit, + $water_mark_url, + array(), + array(), + 0, + 0, + '', + false, + '', + true, + $background_color, + $dashboard, + $vconsole); + } + else { + //Stack the data + stack_data($chart_data, $legend, $color); + + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + $graph['water_mark'] = $water_mark_file; + $graph['font'] = $font; + $graph['font_size'] = $font_size; + $graph['backgroundColor'] = $backgroundColor; + + $id_graph = serialize_in_temp($graph, null, $ttl); + + return ""; + } } } @@ -464,7 +535,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white', - $dashboard = false) { + $dashboard = false, $vconsole = false) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -495,22 +566,47 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $dashboard); } else { - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - $graph['backgroundColor'] = $backgroundColor; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return ""; + if ($vconsole) { + return flot_line_simple_graph( + $chart_data, + $width, + $height, + $color, + $legend, + $long_index, + $homeurl, + $unit, + $water_mark_url, + array(), + array(), + 0, + 0, + '', + false, + '', + true, + $backgroundColor, + $dashboard, + $vconsole); + } + else { + $graph = array(); + $graph['data'] = $chart_data; + $graph['width'] = $width; + $graph['height'] = $height; + $graph['color'] = $color; + $graph['legend'] = $legend; + $graph['xaxisname'] = $xaxisname; + $graph['yaxisname'] = $yaxisname; + $graph['water_mark'] = $water_mark_file; + $graph['font'] = $font; + $graph['font_size'] = $font_size; + $graph['backgroundColor'] = $backgroundColor; + + $id_graph = serialize_in_temp($graph, null, $ttl); + + return ""; + } } } diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index c48ba0f143..45283b24a2 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -706,7 +706,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, } } -function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2) { +function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2, graph_javascript) { values = values.split(separator2); labels = labels.split(separator); @@ -804,7 +804,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, type, serie_types, water_mark, width, max_x, homeurl, unit, font_size, menu, events, event_ids, legend_events, alerts, alert_ids, legend_alerts, yellow_threshold, red_threshold, - force_integer, separator, separator2, series_suffix_str) { + force_integer, separator, separator2, series_suffix_str, vconsole) { var threshold = true; var thresholded = false; @@ -1024,11 +1024,25 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, labelFormatter: lFormatter } }; - + if (vconsole) { + options.grid['hoverable'] = false; + options.grid['clickable'] = false; + options.crosshair = false; + options.selection = false; + } + var stack = 0, bars = true, lines = false, steps = false; var plot = $.plot($('#' + graph_id), datas, options); - + + if (vconsole) { + var myCanvas = plot.getCanvas(); + plot.setupGrid(); // redraw plot to new size + plot.draw(); + var image = myCanvas.toDataURL("image/png"); + return; + } + // Adjust the overview plot to the width and position of the main plot adjust_left_width_canvas(graph_id, 'overview_'+graph_id); @@ -1267,7 +1281,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $('#'+graph_id).bind('mouseout',resetInteractivity); $('#overview_'+graph_id).bind('mouseout',resetInteractivity); - + // Reset interactivity styles function resetInteractivity() { $('#timestamp_'+graph_id).hide(); diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index a76d1f3c55..6e135c1492 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -152,7 +152,7 @@ function d3_bullet_chart($chart_data, $width, $height, $color, $legend, $id_bullet = uniqid(); $output .= - '
    + '