From 8b9c59a3b088f9b48576bafda1fbe931b7bb62d8 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 1 Dec 2017 12:44:07 +0100 Subject: [PATCH 01/21] Fixed Unkwon Icon in GIS --- pandora_console/include/functions_gis.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 8f1a02f9f0..ee14a2f707 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -573,14 +573,17 @@ function gis_get_agent_icon_map($idAgent, $state = false, $status = null) { switch ($status) { case 1: case 4: + case 100: //Critical (BAD or ALERT) $state = ".bad"; break; case 0: + case 300: //Normal (OK) $state = ".ok"; break; case 2: + case 200: //Warning $state = ".warning"; break; From 87e2f4f3f9b35ed81e6a395393236987575004ad Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 4 Dec 2017 11:41:52 +0100 Subject: [PATCH 02/21] Fixed filter in gis maps --- .../include/javascript/openlayers.pandora.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/javascript/openlayers.pandora.js b/pandora_console/include/javascript/openlayers.pandora.js index 801ecf7bd5..e0599c709f 100755 --- a/pandora_console/include/javascript/openlayers.pandora.js +++ b/pandora_console/include/javascript/openlayers.pandora.js @@ -286,7 +286,7 @@ function EventZoomEnd (evt,zoom = map.zoom) { * @return none */ function changeShowStatus(newShowStatus) { - statusShow = newShowStatus; + statusShow = newShowStatus; hideAgentsStatus(); EventZoomEnd(null,map.zoom); js_refreshParentLines(); @@ -305,19 +305,19 @@ function hideFeatureByStatus(feature, status) { switch (statusShow) { case 'bad': - if ((status == 1) || (status == 4)) + if ((status == 1) || (status == 4) || (status == 100)) feature.style.display = ''; break; case 'warning': - if (status == 2) + if ((status == 2) || (status == 200)) feature.style.display = ''; break; case 'ok': - if (status == 0) + if ((status == 0) || (status == 300)) feature.style.display = ''; break; case 'default': - if ((status != 1) && (status != 4) && (status != 2) && (status != 0)) + if ((status != 1) && (status != 4) && (status != 2) && (status != 0) && (status != 100) && (status != 200) && (status != 300)) feature.style.display = ''; break; case 'all': @@ -337,19 +337,19 @@ function isHideFeatureByStatus(status) { switch (statusShow) { case 'bad': - if ((status == 1) || (status == 4)) + if ((status == 1) || (status == 4) || (status == 100)) returnVar = false; break; case 'warning': - if (status == 2) + if ((status == 2) || (status == 200)) returnVar = false; break; case 'ok': - if (status == 0) + if ((status == 0) || (status == 300)) returnVar = false; break; case 'default': - if ((status != 1) && (status != 4) && (status != 2) && (status != 0)) + if ((status != 1) && (status != 4) && (status != 2) && (status != 0) && (status != 100) && (status != 200) && (status != 300)) returnVar = false; break; case 'all': From 044d54a76fe88b564cce50669ef65843f93a45ac Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 6 Dec 2017 00:01:15 +0100 Subject: [PATCH 03/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 94b983af04..2245887004 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171205 +Version: 7.0NG.716-171206 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 b24e637840..eb7b55c818 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171205" +pandora_version="7.0NG.716-171206" 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 e836cc9bab..e5cefd957f 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171205'; +use constant AGENT_BUILD => '171206'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index f7684c3403..051f908244 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 7.0NG.716 -%define release 171205 +%define release 171206 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 69216b3634..9d634b0cf5 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 7.0NG.716 -%define release 171205 +%define release 171206 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 f11c62f8f0..0306bf5ed7 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171205" +PI_BUILD="171206" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0e14c086ab..67ded7c88e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171205} +{171206} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 56c43b8a22..1db64f2999 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171205)") +#define PANDORA_VERSION ("7.0NG.716(Build 171206)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 406e6ba068..fa507d8209 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171205))" + VALUE "ProductVersion", "(7.0NG.716(Build 171206))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 75c8bcbaf2..10960059bc 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171205 +Version: 7.0NG.716-171206 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 b2a2da6dbd..3464f04dde 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171205" +pandora_version="7.0NG.716-171206" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 679c33f0cb..03b6cf7ef2 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 = 'PC171205'; +$build_version = 'PC171206'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f7391fdd17..fe9c5a95a8 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index aa27a4f04c..da68536646 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171205 +%define release 171206 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6c323203c2..d54dbdb477 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171205 +%define release 171206 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 62ad9a9ca5..9d5af6c6b1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171205" +PI_BUILD="171206" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 79aea58527..37f61ac05d 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171205"; +my $version = "7.0NG.716 PS171206"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index e0e1d612f5..d2004731c4 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171205"; +my $version = "7.0NG.716 PS171206"; # save program name for logging my $progname = basename($0); From 633cb5a39c1ea8687c9d6d9f909bc03b7014dbab Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 7 Dec 2017 00:01:14 +0100 Subject: [PATCH 04/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 2245887004..62e6f9c326 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171206 +Version: 7.0NG.716-171207 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 eb7b55c818..41775c42ef 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171206" +pandora_version="7.0NG.716-171207" 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 e5cefd957f..d89e7e6bfd 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171206'; +use constant AGENT_BUILD => '171207'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 051f908244..a3e4822133 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 7.0NG.716 -%define release 171206 +%define release 171207 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 9d634b0cf5..8acb589446 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 7.0NG.716 -%define release 171206 +%define release 171207 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 0306bf5ed7..212e17af9a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171206" +PI_BUILD="171207" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 67ded7c88e..e0e8bae0ba 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171206} +{171207} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1db64f2999..a7bec973ec 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171206)") +#define PANDORA_VERSION ("7.0NG.716(Build 171207)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fa507d8209..86fbe82437 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171206))" + VALUE "ProductVersion", "(7.0NG.716(Build 171207))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 10960059bc..b3af0cf169 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171206 +Version: 7.0NG.716-171207 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 3464f04dde..949316ec35 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171206" +pandora_version="7.0NG.716-171207" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 03b6cf7ef2..68581f9aad 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 = 'PC171206'; +$build_version = 'PC171207'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index fe9c5a95a8..44f5f1433f 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index da68536646..6c229e44db 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171206 +%define release 171207 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index d54dbdb477..c7100e7699 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171206 +%define release 171207 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9d5af6c6b1..74aa94d5e8 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171206" +PI_BUILD="171207" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 37f61ac05d..20385e28dd 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171206"; +my $version = "7.0NG.716 PS171207"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d2004731c4..b449872875 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171206"; +my $version = "7.0NG.716 PS171207"; # save program name for logging my $progname = basename($0); From b6d2bdcc716a17eae6779e62dff88bfb52475b25 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Dec 2017 12:04:22 +0100 Subject: [PATCH 05/21] Minor fix --- pandora_plugins/EC2/ec2_cloudwatch_plugin.sh | 6 +++--- pandora_plugins/EC2/ec2_describe_instance.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_plugins/EC2/ec2_cloudwatch_plugin.sh b/pandora_plugins/EC2/ec2_cloudwatch_plugin.sh index 87ead65bd5..fab09b8b4a 100755 --- a/pandora_plugins/EC2/ec2_cloudwatch_plugin.sh +++ b/pandora_plugins/EC2/ec2_cloudwatch_plugin.sh @@ -17,8 +17,8 @@ function help { echo " " echo "This plugin is used to check performance of Volumes and Instances in the EC2 Cloud" echo "Syntax:" - echo -e "\t\t-A Access KEY ID, p.e AKIAILTVJ3S26GTKLD4A" - echo -e "\t\t-S Secret Access Key, p.e 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" + echo -e "\t\t-A Access KEY ID, p.e AKIAILTVCAS26GTKLD4A" + echo -e "\t\t-S Secret Access Key, p.e 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" echo -e "\t\t-R Region, p.e us-east-1" echo -e "\t\t-m Metric to gather (see doc for a metric list) " echo -e "\t\t-n Namespace (p.e: AWS/EC2, AWS/EBS) " @@ -27,7 +27,7 @@ function help { echo -e "\t\t-z Show default metrics " echo -e "\t\t-h Show this messages " echo "Samples:" - echo " ./ec2_plugin.sh -A AKIAILTVJ3S26GTKLD4A -S CgmQ6DxUWES05txfe+juJLoM57acDudHogkLotWk -i i-9d0b4af1 -n AWS/EC2 -m CPUUtilization" + echo " ./ec2_plugin.sh -A AKIAILTVCAS26GTKLD4A -S CgmQ6DxUWES05txju+alJLoM57acDudHogkLotWk -i i-9d0b4af1 -n AWS/EC2 -m CPUUtilization" echo exit 0 diff --git a/pandora_plugins/EC2/ec2_describe_instance.sh b/pandora_plugins/EC2/ec2_describe_instance.sh index b18bd30aad..6d3bcaf718 100755 --- a/pandora_plugins/EC2/ec2_describe_instance.sh +++ b/pandora_plugins/EC2/ec2_describe_instance.sh @@ -20,8 +20,8 @@ function help { echo " ./$progname [-A access-key -S secret-key][-R region] -f config -i instance-id -n field-name" echo -e "\t\t-f path of configu file" echo -e "\t\t-R Region, p.e us-east-1" - echo -e "\t\t-A Access KEY ID, p.e AKIAILTVJ3S26GTKLD4A" - echo -e "\t\t-S Secret Access Key, p.e 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" + echo -e "\t\t-A Access KEY ID, p.e AKIAILTVCAS26GTKLD4A" + echo -e "\t\t-S Secret Access Key, p.e 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" echo -e "\t\t-i Instance ID, p.e i-9d0b4af1" echo -e "\t\t-n Field Name, p.e type, public-dns, .." echo -e "\t\t-h Show this messages" From b51c239f3ed56749f89fc8ca201cf056adf1ec17 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 7 Dec 2017 14:11:38 +0100 Subject: [PATCH 06/21] Fixed disk_free on Windows automonitorization --- pandora_server/lib/PandoraFMS/Tools.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 4e77d3f25b..7487081c24 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -887,14 +887,14 @@ sub disk_free ($) { # Check relative path my $unit; if ($target =~ m/^([a-zA-Z]):/gi) { - $unit = $1/(1024*1024); + $unit = $1; } else { return; } # Get the free space of unit found my $all_disk_info = `wmic logicaldisk get caption, freespace`; if ($all_disk_info =~ m/$unit:\D*(\d+)/gmi){ - return $1; + return $1/(1024*1024); } return; } From 3804c3f826b2a4889c93c915a69551c41a3fa481 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 8 Dec 2017 00:01:13 +0100 Subject: [PATCH 07/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 62e6f9c326..6b82234647 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171207 +Version: 7.0NG.716-171208 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 41775c42ef..7b51dc6506 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171207" +pandora_version="7.0NG.716-171208" 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 d89e7e6bfd..b5f232e70a 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171207'; +use constant AGENT_BUILD => '171208'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index a3e4822133..c3f193a586 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 7.0NG.716 -%define release 171207 +%define release 171208 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 8acb589446..519fd666b9 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 7.0NG.716 -%define release 171207 +%define release 171208 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 212e17af9a..61288b5d35 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171207" +PI_BUILD="171208" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e0e8bae0ba..04248341cb 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171207} +{171208} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a7bec973ec..d3eff81daf 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171207)") +#define PANDORA_VERSION ("7.0NG.716(Build 171208)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 86fbe82437..cb551cb417 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171207))" + VALUE "ProductVersion", "(7.0NG.716(Build 171208))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b3af0cf169..8794234010 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171207 +Version: 7.0NG.716-171208 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 949316ec35..314a081f5d 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171207" +pandora_version="7.0NG.716-171208" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 68581f9aad..834e3adc10 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 = 'PC171207'; +$build_version = 'PC171208'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 44f5f1433f..1b91ed2cd6 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6c229e44db..4ea0ef9f75 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171207 +%define release 171208 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index c7100e7699..58a57a428f 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171207 +%define release 171208 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 74aa94d5e8..9fe24f77a2 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171207" +PI_BUILD="171208" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 20385e28dd..f0f2d8bccc 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171207"; +my $version = "7.0NG.716 PS171208"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index b449872875..8d8f7d3965 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171207"; +my $version = "7.0NG.716 PS171208"; # save program name for logging my $progname = basename($0); From e1583f1903877d70ae0b8d78cb087edd0395470a Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 9 Dec 2017 00:01:11 +0100 Subject: [PATCH 08/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 6b82234647..5236858f65 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171208 +Version: 7.0NG.716-171209 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 7b51dc6506..36d47b084a 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171208" +pandora_version="7.0NG.716-171209" 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 b5f232e70a..6997d1a503 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171208'; +use constant AGENT_BUILD => '171209'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index c3f193a586..334fa8d125 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 7.0NG.716 -%define release 171208 +%define release 171209 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 519fd666b9..d5017b7a34 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 7.0NG.716 -%define release 171208 +%define release 171209 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 61288b5d35..3b572b1e0b 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171208" +PI_BUILD="171209" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 04248341cb..5916e2c621 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171208} +{171209} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d3eff81daf..ff861aa93e 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171208)") +#define PANDORA_VERSION ("7.0NG.716(Build 171209)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index cb551cb417..51029ca56c 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171208))" + VALUE "ProductVersion", "(7.0NG.716(Build 171209))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8794234010..812fd2d4e9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171208 +Version: 7.0NG.716-171209 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 314a081f5d..00e0a2377b 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171208" +pandora_version="7.0NG.716-171209" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 834e3adc10..e991729931 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 = 'PC171208'; +$build_version = 'PC171209'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 1b91ed2cd6..ea8366ce83 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 4ea0ef9f75..751f174429 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171208 +%define release 171209 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 58a57a428f..1c58968195 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171208 +%define release 171209 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9fe24f77a2..54470ec4f6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171208" +PI_BUILD="171209" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f0f2d8bccc..1da8b634aa 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171208"; +my $version = "7.0NG.716 PS171209"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8d8f7d3965..8c6fb94d89 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171208"; +my $version = "7.0NG.716 PS171209"; # save program name for logging my $progname = basename($0); From 4734283cd8459f9e375b613a945d88be47670d4a Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 10 Dec 2017 00:01:11 +0100 Subject: [PATCH 09/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 5236858f65..b8943a5415 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171209 +Version: 7.0NG.716-171210 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 36d47b084a..fa209c8e86 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171209" +pandora_version="7.0NG.716-171210" 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 6997d1a503..5ba35c361c 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171209'; +use constant AGENT_BUILD => '171210'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 334fa8d125..fecca36e41 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 7.0NG.716 -%define release 171209 +%define release 171210 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 d5017b7a34..278b193e28 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 7.0NG.716 -%define release 171209 +%define release 171210 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 3b572b1e0b..a8d677d618 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171209" +PI_BUILD="171210" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 5916e2c621..7c855bf570 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171209} +{171210} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ff861aa93e..7416fdd229 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171209)") +#define PANDORA_VERSION ("7.0NG.716(Build 171210)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 51029ca56c..b2628a1b11 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171209))" + VALUE "ProductVersion", "(7.0NG.716(Build 171210))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 812fd2d4e9..edc9f50d24 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171209 +Version: 7.0NG.716-171210 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 00e0a2377b..6599616e99 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171209" +pandora_version="7.0NG.716-171210" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e991729931..dfce7b3f77 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 = 'PC171209'; +$build_version = 'PC171210'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ea8366ce83..dc46df9f00 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 751f174429..7b8b534472 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171209 +%define release 171210 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 1c58968195..8210cff916 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171209 +%define release 171210 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 54470ec4f6..7a027122a1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171209" +PI_BUILD="171210" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1da8b634aa..cf0fe16edb 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171209"; +my $version = "7.0NG.716 PS171210"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8c6fb94d89..0f4ba34ebe 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171209"; +my $version = "7.0NG.716 PS171210"; # save program name for logging my $progname = basename($0); From 6b76392a60cbcada070f22adf5d0ea365fb06e78 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 11 Dec 2017 00:01:12 +0100 Subject: [PATCH 10/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 b8943a5415..940de49905 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171210 +Version: 7.0NG.716-171211 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 fa209c8e86..350482b4ac 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171210" +pandora_version="7.0NG.716-171211" 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 5ba35c361c..7a32f204eb 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171210'; +use constant AGENT_BUILD => '171211'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index fecca36e41..02e2ed2bca 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 7.0NG.716 -%define release 171210 +%define release 171211 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 278b193e28..dca043ea75 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 7.0NG.716 -%define release 171210 +%define release 171211 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 a8d677d618..63b11ac272 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171210" +PI_BUILD="171211" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7c855bf570..6a032762d2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171210} +{171211} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7416fdd229..f008a4ba72 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171210)") +#define PANDORA_VERSION ("7.0NG.716(Build 171211)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b2628a1b11..e174dc6a9b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171210))" + VALUE "ProductVersion", "(7.0NG.716(Build 171211))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index edc9f50d24..007a5952b0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171210 +Version: 7.0NG.716-171211 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 6599616e99..f9d51ca8c1 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171210" +pandora_version="7.0NG.716-171211" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index dfce7b3f77..09c5709234 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 = 'PC171210'; +$build_version = 'PC171211'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index dc46df9f00..93b81c9434 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7b8b534472..828d841b63 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171210 +%define release 171211 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8210cff916..05585a4fb9 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171210 +%define release 171211 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7a027122a1..6bbcbc1156 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171210" +PI_BUILD="171211" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cf0fe16edb..30cd489834 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171210"; +my $version = "7.0NG.716 PS171211"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0f4ba34ebe..916b43686c 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171210"; +my $version = "7.0NG.716 PS171211"; # save program name for logging my $progname = basename($0); From 84ff86fedef6a56c06fc5b912127c662913073a2 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 11 Dec 2017 15:47:38 +0100 Subject: [PATCH 11/21] keepalive modules are boolean too (console function fix) --- pandora_console/include/functions_modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index e46334dbef..257eb6d62b 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -998,6 +998,7 @@ function modules_is_string($id_agentmodule) { function modules_is_boolean_type ($id_type) { $type_name = modules_get_type_name($id_type); + if ($type_name === "keep_alive") return true; return (bool)preg_match('/_proc$/', $type_name); } From b6b0c8532d035d42babef1ee177fd1d8832c6f87 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 11 Dec 2017 16:30:09 +0100 Subject: [PATCH 12/21] Carrefour auto loginhash existing session - #1679 --- pandora_console/index.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pandora_console/index.php b/pandora_console/index.php index a60adf1f8e..2ffe3ee2f3 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -719,6 +719,29 @@ if (! isset ($config['id_user'])) { } } else { + + if ( ($_GET["loginhash_data"]) && ($_GET["loginhash_data"])) { + + $loginhash_data = get_parameter("loginhash_data", ""); + $loginhash_user = str_rot13(get_parameter("loginhash_user", "")); + $iduser = $_SESSION["id_usuario"]; + //logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]); check why is not available + unset($_SESSION["id_usuario"]); + unset($iduser); + + if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { + db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); + $_SESSION['id_usuario'] = $loginhash_user; + $config["id_user"] = $loginhash_user; + } + else { + require_once ('general/login_page.php'); + db_pandora_audit("Logon Failed (loginhash", "", "system"); + while (@ob_end_flush ()); + exit (""); + } + } + $user_in_db = db_get_row_filter('tusuario', array('id_user' => $config['id_user']), '*'); if ($user_in_db == false) { From 741df27ba0e19dd19ae057b87fcbf0a03348ff24 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 11 Dec 2017 17:19:52 +0100 Subject: [PATCH 13/21] Added ldapsearch system command --- pandora_console/include/auth/mysql.php | 242 ++++++++++++++++--------- 1 file changed, 158 insertions(+), 84 deletions(-) diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index bb3bea97b1..77ce04e257 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -709,36 +709,52 @@ function ldap_process_user_login ($login, $password) { $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($login) . ")"; $justthese = array("objectclass=group"); - $sr = ldap_search($ds, $dc, $filter, $justthese); + $sr=local_ldap_search($config["ldap_server"], $config["ldap_port"], $config["ldap_version"], $dc, $config['ldap_login_attr'], io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'], io_safe_output($login)); + + if (!$sr == false){ + $user_dn=$sr["dn"]; + + $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; - $memberof = ldap_get_entries($ds, $sr); - - if ($memberof["count"] == 0 && !isset($memberof[0]["memberof"])) { + $correct = false; + if(!empty($ldap_base_dn)) { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($user_dn), $password) ) { + $correct = true; + } + } else { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { + $correct = true; + } + } @ldap_close ($ds); - return false; - } - else { - $memberof = $memberof[0]; - } - - unset($memberof["count"]); + + } else { + $sr = ldap_search($ds, $dc, $filter, $justthese); - $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; - - $correct = false; - if(!empty($ldap_base_dn)) { - if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($memberof['dn']), $password) ) { - $correct = true; - } - } - else { - if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { - $correct = true; - } - } - - @ldap_close ($ds); + $memberof = ldap_get_entries($ds, $sr); + if ($memberof["count"] == 0 && !isset($memberof[0]["memberof"])) { + @ldap_close ($ds); + return false; + } else { + $memberof = $memberof[0]; + } + unset($memberof["count"]); + + $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; + $correct = false; + if(!empty($ldap_base_dn)) { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($memberof['dn']), $password) ) { + $correct = true; + } + } else { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { + $correct = true; + } + } + @ldap_close ($ds); + } + if ($correct) { return true; } @@ -802,22 +818,26 @@ function get_ldap_login_attr ($login) { $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")"; $justthese = array("mail"); - $sr = ldap_search($ds, $dc, $filter, $justthese); - - $info = ldap_get_entries($ds, $sr); + $sr=local_ldap_search($config["ldap_server"], $config["ldap_port"], $config["ldap_version"], $dc, $config['ldap_login_attr'],io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'], io_safe_output($login)); - if ($info["count"] == 0 && !isset($info[0]["mail"])) { + if (!$sr == false){ + $id_user=$sr["mail"]; + @ldap_close ($ds); + } else { + $sr = ldap_search($ds, $dc, $filter, $justthese, 0, 0 ,2); + + $info = ldap_get_entries($ds, $sr); + if ($info["count"] == 0 && !isset($info[0]["mail"])) { + @ldap_close ($ds); + return $id_user; + } else { + $info = $info[0]; + } + + $id_user = $info['mail'][0]; @ldap_close ($ds); - return $id_user; } - else { - $info = $info[0]; - } - - $id_user = $info['mail'][0]; - - @ldap_close ($ds); - + break; } @@ -904,39 +924,58 @@ function prepare_permissions_groups_of_user_ldap ($id_user, $password, #Search group of this user it belong. $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")"; $justthese = array("objectclass=group"); - - $sr = ldap_search($ds, $dc, $filter, $justthese); - - $memberof = ldap_get_entries($ds, $sr); - - if ($memberof["count"] == 0 && !isset($memberof[0]["memberof"])) { - @ldap_close ($ds); - return false; - } - else { - $memberof = $memberof[0]; - } - - unset($memberof["count"]); - $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; - - $correct = false; - if(!empty($ldap_base_dn)) { - if (strlen($password) != 0 && @ldap_bind($ds, $memberof['dn'], $password) ) { - $correct = true; - } - } - else { - if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { - $correct = true; - } - } - - if (!$correct) { - @ldap_close ($ds); + $sr=local_ldap_search($config["ldap_server"], $config["ldap_port"], $config["ldap_version"], $dc, $config['ldap_login_attr'], io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'], io_safe_output($id_user)); - return false; + if (!$sr == false) { + $user_dn=$sr["dn"]; + $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; + + $correct = false; + if(!empty($ldap_base_dn)) { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($user_dn), $password) ) { + $correct = true; + } + } else { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { + $correct = true; + } + } + if (!$correct) { + @ldap_close ($ds); + return false; + } + } else { + $sr = ldap_search($ds, $dc, $filter, $justthese, 0, 0, 2); + + $memberof = ldap_get_entries($ds, $sr); + + if ($memberof["count"] == 0 && !isset($memberof[0]["memberof"])) { + @ldap_close ($ds); + return false; + } else { + $memberof = $memberof[0]; + } + + unset($memberof["count"]); + + $ldap_base_dn = !empty($config["ldap_base_dn"]) ? "," . io_safe_output($config["ldap_base_dn"]) : ''; + + $correct = false; + if(!empty($ldap_base_dn)) { + if (strlen($password) != 0 && @ldap_bind($ds, $memberof['dn'], $password) ) { + $correct = true; + } + } else { + if (strlen($password) != 0 && @ldap_bind($ds, io_safe_output($login), $password) ) { + $correct = true; + } + } + + if (!$correct) { + @ldap_close ($ds); + return false; + } } $permissions = array(); @@ -1014,21 +1053,27 @@ function prepare_permissions_groups_of_user_ldap ($id_user, $password, $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")"; $justthese = array("mail"); - $sr = ldap_search($ds, $dc, $filter, $justthese); + $sr=local_ldap_search($config["ldap_server"], $config["ldap_port"], $config["ldap_version"], $dc, $config['ldap_login_attr'], io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'], io_safe_output($id_user)); + + if (!$sr == false){ + $id_user=$sr["mail"]; + $user_info['fullname']=$sr["mail"]; + } else { + $sr = ldap_search($ds, $dc, $filter, $justthese, 0, 0, 2); + + $info = ldap_get_entries($ds, $sr); + if ($info["count"] == 0 && !isset($info[0]["mail"])) { + @ldap_close ($ds); + return false; + } else { + $info = $info[0]; + } + + $id_user = $info['mail'][0]; + $user_info['fullname'] = $id_user; + + } - $info = ldap_get_entries($ds, $sr); - - if ($info["count"] == 0 && !isset($info[0]["mail"])) { - @ldap_close ($ds); - return false; - } - else { - $info = $info[0]; - } - - $id_user = $info['mail'][0]; - $user_info['fullname'] = $id_user; - break; } } @@ -1341,6 +1386,35 @@ function delete_user_pass_ldap ($id_user) { return; } +function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $access_attr, $ldap_admin_user, $ldap_admin_pass, $user) { + $filter="(" . $access_attr . "=" . $user . ")"; + $shell_ldap_search = explode("\n", shell_exec('ldapsearch -LLL -o ldif-wrap=no -x -h ' . $ldap_host . ' -p ' . $ldap_port . ' -P ' . $ldap_version . ' -E pr=10000/noprompt -D "' . $ldap_admin_user . '" -w ' . $ldap_admin_pass . ' -b "' . $dn . '" -s sub "' . $filter . '" | grep -v "^#\|^$" | sed "s/:\+ /=>/g"')); + foreach($shell_ldap_search as $line) { + $values = explode("=>", $line); + if(!empty($values[0]) && !empty($values[1])) { + $user_attr[$values[0]] = $values[1]; + } + } + + if (empty($user_attr)) { + return false; + } + + $user_dn = safe_output_accute(base64_decode($user_attr["dn"])); + if(strlen($user_dn) > 0) { + $user_attr["dn"]=$user_dn; + } + + return $user_attr; +} + +function safe_output_accute($string) { + $no_allowed= array ("á","é","í","ó","ú","Á","É","Í","Ó","Ú","ñ","Ñ"); + $allowed= array ("a","e","i","o","u","A","E","I","O","U","n","N"); + $result = str_replace($no_allowed, $allowed ,$string); + return $result; +} + //Reference the global use authorization error to last auth error. $config["auth_error"] = &$mysql_cache["auth_error"]; ?> \ No newline at end of file From 3d233645c505e2a036d92657ad4e6ed5da7a411f Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 12 Dec 2017 00:01:14 +0100 Subject: [PATCH 14/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 940de49905..fce9f16d4a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171211 +Version: 7.0NG.716-171212 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 350482b4ac..4306a1b712 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171211" +pandora_version="7.0NG.716-171212" 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 7a32f204eb..20feaf5d11 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171211'; +use constant AGENT_BUILD => '171212'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 02e2ed2bca..9fc2a94f46 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 7.0NG.716 -%define release 171211 +%define release 171212 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 dca043ea75..693b36361f 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 7.0NG.716 -%define release 171211 +%define release 171212 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 63b11ac272..74d1e0890d 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171211" +PI_BUILD="171212" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 6a032762d2..d3db26580c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171211} +{171212} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f008a4ba72..f794ec92cc 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171211)") +#define PANDORA_VERSION ("7.0NG.716(Build 171212)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e174dc6a9b..bff6086dc6 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171211))" + VALUE "ProductVersion", "(7.0NG.716(Build 171212))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 007a5952b0..428b000cf1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171211 +Version: 7.0NG.716-171212 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 f9d51ca8c1..265c70dbe4 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171211" +pandora_version="7.0NG.716-171212" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 09c5709234..8a1d424e61 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 = 'PC171211'; +$build_version = 'PC171212'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 93b81c9434..303d4fe854 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 828d841b63..b1869cafcb 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171211 +%define release 171212 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 05585a4fb9..624fdfe1a1 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171211 +%define release 171212 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6bbcbc1156..9761213418 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171211" +PI_BUILD="171212" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 30cd489834..27e4e7a123 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171211"; +my $version = "7.0NG.716 PS171212"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 916b43686c..1894b95d1a 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171211"; +my $version = "7.0NG.716 PS171212"; # save program name for logging my $progname = basename($0); From 1b32a4da7cd599bc97206891830fda05a7f73f2a Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 13 Dec 2017 00:01:14 +0100 Subject: [PATCH 15/21] 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_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.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 fce9f16d4a..be260988d7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.716-171212 +Version: 7.0NG.716-171213 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 4306a1b712..33c99951e0 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171212" +pandora_version="7.0NG.716-171213" 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 20feaf5d11..9b282f3de7 100755 --- 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 => '7.0NG.716'; -use constant AGENT_BUILD => '171212'; +use constant AGENT_BUILD => '171213'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 9fc2a94f46..95982e5d7c 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 7.0NG.716 -%define release 171212 +%define release 171213 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 693b36361f..310103bddf 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 7.0NG.716 -%define release 171212 +%define release 171213 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 74d1e0890d..ae359d7249 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171212" +PI_BUILD="171213" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d3db26580c..f3bd68d178 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171212} +{171213} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f794ec92cc..2e1df353a1 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.716(Build 171212)") +#define PANDORA_VERSION ("7.0NG.716(Build 171213)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bff6086dc6..a3622b0ec5 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.716(Build 171212))" + VALUE "ProductVersion", "(7.0NG.716(Build 171213))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 428b000cf1..c3c3361d94 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.716-171212 +Version: 7.0NG.716-171213 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 265c70dbe4..33f8ef0df1 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.716-171212" +pandora_version="7.0NG.716-171213" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8a1d424e61..c7f40ecead 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 = 'PC171212'; +$build_version = 'PC171213'; $pandora_version = 'v7.0NG.716'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 303d4fe854..0b90ffddb0 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index b1869cafcb..3d03341410 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171212 +%define release 171213 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 624fdfe1a1..574f5c7336 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.716 -%define release 171212 +%define release 171213 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9761213418..56f98ea3ab 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.716" -PI_BUILD="171212" +PI_BUILD="171213" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 27e4e7a123..2707d3989f 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.716 PS171212"; +my $version = "7.0NG.716 PS171213"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1894b95d1a..f8852a15d8 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.716 PS171212"; +my $version = "7.0NG.716 PS171213"; # save program name for logging my $progname = basename($0); From e01f00ac3dbdc7c93f3f58ac47abe1f41ed6cea8 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 31 Oct 2017 11:51:19 +0100 Subject: [PATCH 16/21] code backup --- .../godmode/reporting/graph_builder.main.php | 13 +++++ .../godmode/reporting/graph_builder.php | 12 +++- .../include/functions_custom_graphs.php | 8 ++- pandora_console/include/functions_graph.php | 57 +++++++++++++++++-- .../include/graphs/functions_flot.php | 3 +- 5 files changed, 83 insertions(+), 10 deletions(-) diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 9c95f2263b..53f8d47835 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -66,6 +66,8 @@ if ($edit_graph) { $height = $graphInTgraph['height']; $check = false; $percentil = $graphInTgraph['percentil']; + $summatory_series = $graphInTgraph['summatory_series']; + $average_series = $graphInTgraph['average_series']; if ($stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $stacked = CUSTOM_GRAPH_BULLET_CHART; @@ -84,6 +86,8 @@ else { $stacked = 4; $check = false; $percentil = 0; + $summatory_series = 0; + $average_series = 0; } @@ -174,6 +178,15 @@ echo "
"; echo "
"; +echo "".__('Add summatory series')."" . + ui_print_help_tip (__("This will add a synthetic series to the graph, + using all series to give a SUM or an average of all present series values + in each interval. This feature could be used instead synthetic modules + if you only want to see a graph"), true).""; +echo "" . html_print_checkbox ("summatory_series", 1, $summatory_series, true) . " +".__('Add average series').""; +echo "" . html_print_checkbox ("average_series", 1, $average_series, true) . ""; + echo "".__('Percentil').""; echo "" . html_print_checkbox ("percentil", 1, $percentil, true) . ""; diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 317f562e6f..0d4cdcc2f9 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -87,6 +87,8 @@ if ($add_graph) { $period = get_parameter_post ("period"); $threshold = get_parameter('threshold'); $percentil = get_parameter ("percentil", 0); + $summatory_series = get_parameter ("summatory_series", 0); + $average_series = get_parameter ("average_series", 0); if ($threshold == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $stacked = $threshold; @@ -103,7 +105,9 @@ if ($add_graph) { 'private' => 0, 'id_group' => $idGroup, 'stacked' => $stacked, - 'percentil' => $percentil + 'percentil' => $percentil, + 'summatory_series' => $summatory_series, + 'average_series' => $average_series ); if (trim($name) != "") { @@ -131,6 +135,8 @@ if ($update_graph) { $period = get_parameter('period'); $stacked = get_parameter('stacked'); $percentil = get_parameter('percentil'); + $summatory_series = get_parameter ("summatory_series"); + $average_series = get_parameter ("average_series"); $alerts = get_parameter('alerts'); $threshold = get_parameter('threshold'); @@ -141,7 +147,9 @@ if ($update_graph) { if (trim($name) != "") { $success = db_process_sql_update('tgraph', - array('name' => $name, 'id_group' => $id_group, 'description' => $description, 'width' => $width, 'height' => $height, 'period' => $period, 'stacked' => $stacked, 'percentil' => $percentil ), + array('name' => $name, 'id_group' => $id_group, 'description' => $description, + 'width' => $width, 'height' => $height, 'period' => $period, 'stacked' => $stacked, + 'percentil' => $percentil, 'summatory_series' => $summatory_series, 'average_series' => $average_series), array('id_graph' => $id_graph)); if ($success !== false) db_pandora_audit("Report management", "Update graph #$id_graph"); diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index adf077ec6a..f61a7ee944 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -202,6 +202,10 @@ function custom_graphs_print($id_graph, $height, $width, $period, $sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph', $id_graph); + $series = db_get_all_rows_sql('SELECT summatory_series,average_series FROM tgraph WHERE id_graph = '.$id_graph); + $summatory = $series[0]['summatory_series']; + $average = $series[0]['average_series']; + $modules = array (); $weights = array (); $labels = array (); @@ -262,7 +266,9 @@ function custom_graphs_print($id_graph, $height, $width, $period, $percentil, $from_interface, $id_widget_dashboard, - $fullscale); + $fullscale, + $summatory, + $average); if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 88e67981e0..b17bd224e5 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1114,11 +1114,11 @@ function graphic_combined_module ($module_list, $weight_list, $period, $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, $show_min = true, $show_avg = true, $labels = array(), $dashboard = false, $vconsole = false, $percentil = null, $from_interface = false, - $id_widget_dashboard=false, $fullscale = false) { + $id_widget_dashboard=false, $fullscale = false, $summatory = 0, $average = 0) { global $config; global $graphic_type; - + if(!$fullscale){ $time_format_2 = ''; $temp_range = $period; @@ -1205,7 +1205,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, $weight_list[$i] = 1; } } - + + $aux_array = array(); // Set data containers for ($i = 0; $i < $resolution; $i++) { $timestamp = $datelimit + ($interval * $i);/* @@ -1257,12 +1258,12 @@ function graphic_combined_module ($module_list, $weight_list, $period, // If its a projection graph, // first module will be data and second will be the projection + if ($projection != false && $i != 0) { if ($automatic_custom_graph_meta) $agent_module_id = $module_list[0]['module']; else $agent_module_id = $module_list[0]; - $id_module_type = modules_get_agentmodule_type ($agent_module_id); $module_type = modules_get_moduletype_name ($id_module_type); $uncompressed_module = is_module_uncompressed ($module_type); @@ -1273,7 +1274,6 @@ function graphic_combined_module ($module_list, $weight_list, $period, else $agent_module_id = $module_list[$i]; - $id_module_type = modules_get_agentmodule_type ($agent_module_id); $module_type = modules_get_moduletype_name ($id_module_type); $uncompressed_module = is_module_uncompressed ($module_type); @@ -1346,6 +1346,21 @@ function graphic_combined_module ($module_list, $weight_list, $period, continue; } + // if(empty($aux_array)){ + // foreach ($data as $key => $value) { + // $aux_array[$value['utimestamp']] = $value['datos']; + // } + // } else { + // foreach ($data as $key => $value) { + // if(array_key_exists($value['utimestamp'],$aux_array)){ + // $aux_array[$value['utimestamp']] = $aux_array[$value['utimestamp']] + $value['datos']; + // } else { + // $aux_array[$value['utimestamp']] = $value['datos']; + // } + // } + // } + + // html_debug($aux_array); if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) { if ($labels[$agent_module_id] != '') $module_name_list[$i] = $labels[$agent_module_id]; @@ -2114,7 +2129,37 @@ function graphic_combined_module ($module_list, $weight_list, $period, $threshold_data['red_inverse'] = (bool)$red_inverse; } } - + + //summatory and average series + if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE) { + if($summatory && $average){ + foreach ($graph_values as $key => $value) { + $cont = count($value); + $summ = array_sum($value); + array_push($value,$summ); + array_push($value,$summ/$cont); + $graph_values[$key] = $value; + } + array_push($module_name_list,'' . __('summatory'). ''); + array_push($module_name_list,'' . __('average'). ''); + + } elseif($summatory) { + foreach ($graph_values as $key => $value) { + array_push($value,array_sum($value)); + $graph_values[$key] = $value; + } + array_push($module_name_list,'' . __('summatory'). ''); + + } elseif($average) { + foreach ($graph_values as $key => $value) { + $summ = array_sum($value) / count($value); + array_push($value,$summ); + $graph_values[$key] = $value; + } + array_push($module_name_list,'' . __('average'). ''); + } + } + switch ($stacked) { case CUSTOM_GRAPH_AREA: return area_graph($flash_charts, $graph_values, $width, diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 75569c5922..54259ba6b0 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -185,7 +185,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, include_javascript_dependencies_flot_graph(); $menu = (int)$menu; - + html_debug($legend); // Get a unique identifier to graph $graph_id = uniqid('graph_'); @@ -500,6 +500,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $short_data = false; } + // Javascript code $return .= "'; ?> diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 0d4cdcc2f9..9a171e6cba 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -89,6 +89,7 @@ if ($add_graph) { $percentil = get_parameter ("percentil", 0); $summatory_series = get_parameter ("summatory_series", 0); $average_series = get_parameter ("average_series", 0); + $modules_series = get_parameter ("modules_series", 0); if ($threshold == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $stacked = $threshold; @@ -107,7 +108,8 @@ if ($add_graph) { 'stacked' => $stacked, 'percentil' => $percentil, 'summatory_series' => $summatory_series, - 'average_series' => $average_series + 'average_series' => $average_series, + 'modules_series' => $modules_series ); if (trim($name) != "") { @@ -137,6 +139,7 @@ if ($update_graph) { $percentil = get_parameter('percentil'); $summatory_series = get_parameter ("summatory_series"); $average_series = get_parameter ("average_series"); + $modules_series = get_parameter ("modules_series"); $alerts = get_parameter('alerts'); $threshold = get_parameter('threshold'); @@ -149,7 +152,8 @@ if ($update_graph) { $success = db_process_sql_update('tgraph', array('name' => $name, 'id_group' => $id_group, 'description' => $description, 'width' => $width, 'height' => $height, 'period' => $period, 'stacked' => $stacked, - 'percentil' => $percentil, 'summatory_series' => $summatory_series, 'average_series' => $average_series), + 'percentil' => $percentil, 'summatory_series' => $summatory_series, + 'average_series' => $average_series, 'modules_series' => $modules_series), array('id_graph' => $id_graph)); if ($success !== false) db_pandora_audit("Report management", "Update graph #$id_graph"); diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index f61a7ee944..d037e773e7 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -202,9 +202,10 @@ function custom_graphs_print($id_graph, $height, $width, $period, $sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph', $id_graph); - $series = db_get_all_rows_sql('SELECT summatory_series,average_series FROM tgraph WHERE id_graph = '.$id_graph); + $series = db_get_all_rows_sql('SELECT summatory_series,average_series,modules_series FROM tgraph WHERE id_graph = '.$id_graph); $summatory = $series[0]['summatory_series']; $average = $series[0]['average_series']; + $modules_series = $series[0]['modules_series']; $modules = array (); $weights = array (); @@ -268,7 +269,8 @@ function custom_graphs_print($id_graph, $height, $width, $period, $id_widget_dashboard, $fullscale, $summatory, - $average); + $average, + $modules_series); if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index b17bd224e5..26dfe0a45f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1114,7 +1114,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $name_list = array(), $unit_list = array(), $show_last = true, $show_max = true, $show_min = true, $show_avg = true, $labels = array(), $dashboard = false, $vconsole = false, $percentil = null, $from_interface = false, - $id_widget_dashboard=false, $fullscale = false, $summatory = 0, $average = 0) { + $id_widget_dashboard=false, $fullscale = false, $summatory = 0, $average = 0, $modules_series = 0) { global $config; global $graphic_type; @@ -2131,7 +2131,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, } //summatory and average series - if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE) { + if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE && $modules_series) { if($summatory && $average){ foreach ($graph_values as $key => $value) { $cont = count($value); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 2ebd99bd6f..efd3183810 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1192,6 +1192,7 @@ CREATE TABLE IF NOT EXISTS `tgraph` ( `percentil` tinyint(1) UNSIGNED NOT NULL default 0, `summatory_series` tinyint(1) UNSIGNED NOT NULL default 0, `average_series` tinyint(1) UNSIGNED NOT NULL default 0, + `modules_series` tinyint(1) UNSIGNED NOT NULL default 0, PRIMARY KEY(`id_graph`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; From 1d3efb9d9ebfd7cd61446e505d8bcc3f18fc5b02 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 11 Dec 2017 09:29:24 +0100 Subject: [PATCH 18/21] Updated functions_graph --- pandora_console/include/functions_graph.php | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 26dfe0a45f..431a248ed4 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2131,32 +2131,50 @@ function graphic_combined_module ($module_list, $weight_list, $period, } //summatory and average series - if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE && $modules_series) { - if($summatory && $average){ + if($stacked == CUSTOM_GRAPH_AREA || $stacked == CUSTOM_GRAPH_LINE) { + if($summatory && $average) { foreach ($graph_values as $key => $value) { $cont = count($value); $summ = array_sum($value); array_push($value,$summ); array_push($value,$summ/$cont); $graph_values[$key] = $value; + if(!$modules_series) { + array_splice($graph_values[$key],0,count($graph_values[$key])-2); + } } array_push($module_name_list,'' . __('summatory'). ''); array_push($module_name_list,'' . __('average'). ''); + if(!$modules_series){ + array_splice($module_name_list,0,count($module_name_list)-2); + } } elseif($summatory) { foreach ($graph_values as $key => $value) { array_push($value,array_sum($value)); $graph_values[$key] = $value; + if(!$modules_series){ + array_splice($graph_values[$key],0,count($graph_values[$key])-1); + } } array_push($module_name_list,'' . __('summatory'). ''); + if(!$modules_series){ + array_splice($module_name_list,0,count($module_name_list)-1); + } } elseif($average) { foreach ($graph_values as $key => $value) { $summ = array_sum($value) / count($value); array_push($value,$summ); $graph_values[$key] = $value; + if(!$modules_series){ + array_splice($graph_values[$key],0,count($graph_values[$key])-1); + } } array_push($module_name_list,'' . __('average'). ''); + if(!$modules_series){ + array_splice($module_name_list,0,count($module_name_list)-1); + } } } From 85ac142c6ca68be3c2ac800db33e547c0d367fb1 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 13 Dec 2017 10:23:00 +0100 Subject: [PATCH 19/21] Updated functions_graph and fixed percentil issue --- pandora_console/include/functions_graph.php | 56 +++++++++++++++++---- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 431a248ed4..76df8957cf 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2143,10 +2143,24 @@ function graphic_combined_module ($module_list, $weight_list, $period, array_splice($graph_values[$key],0,count($graph_values[$key])-2); } } - array_push($module_name_list,'' . __('summatory'). ''); - array_push($module_name_list,'' . __('average'). ''); - if(!$modules_series){ - array_splice($module_name_list,0,count($module_name_list)-2); + + if(!$modules_series) { + if(is_null($percentil)) { + array_splice($module_name_list,0,count($module_name_list)); + } else { + array_splice($module_name_list,0,count($module_name_list)-(count($module_name_list)/2)); + } + array_unshift($module_name_list,'' . __('summatory'). ''); + array_unshift($module_name_list,'' . __('average'). ''); + } else { + if(is_null($percentil)) { + array_push($module_name_list,'' . __('summatory'). ''); + array_push($module_name_list,'' . __('average'). ''); + } else { + array_splice($module_name_list,(count($module_name_list)/2),0,'' . __('average'). ''); + array_splice($module_name_list,(count($module_name_list)/2),0,'' . __('summatory'). ''); + } + } } elseif($summatory) { @@ -2157,9 +2171,20 @@ function graphic_combined_module ($module_list, $weight_list, $period, array_splice($graph_values[$key],0,count($graph_values[$key])-1); } } - array_push($module_name_list,'' . __('summatory'). ''); - if(!$modules_series){ - array_splice($module_name_list,0,count($module_name_list)-1); + + if(!$modules_series) { + if(is_null($percentil)) { + array_splice($module_name_list,0,count($module_name_list)); + } else { + array_splice($module_name_list,0,count($module_name_list)-(count($module_name_list)/2)); + } + array_unshift($module_name_list,'' . __('summatory'). ''); + } else { + if(is_null($percentil)) { + array_push($module_name_list,'' . __('summatory'). ''); + } else { + array_splice($module_name_list,(count($module_name_list)/2),0,'' . __('summatory'). ''); + } } } elseif($average) { @@ -2171,9 +2196,20 @@ function graphic_combined_module ($module_list, $weight_list, $period, array_splice($graph_values[$key],0,count($graph_values[$key])-1); } } - array_push($module_name_list,'' . __('average'). ''); - if(!$modules_series){ - array_splice($module_name_list,0,count($module_name_list)-1); + + if(!$modules_series) { + if(is_null($percentil)) { + array_splice($module_name_list,0,count($module_name_list)); + } else { + array_splice($module_name_list,0,count($module_name_list)-(count($module_name_list)/2)); + } + array_unshift($module_name_list,'' . __('average'). ''); + } else { + if(is_null($percentil)) { + array_push($module_name_list,'' . __('average'). ''); + } else { + array_splice($module_name_list,(count($module_name_list)/2),0,'' . __('average'). ''); + } } } } From 43e697a1cbaab1225c0d2744f1e10c2cc5aa8b27 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 13 Dec 2017 11:50:15 +0100 Subject: [PATCH 20/21] Added hint in field Add summatory series --- pandora_console/extras/mr/10.sql | 4 ++++ .../godmode/reporting/graph_builder.main.php | 12 ++++++------ pandora_console/include/ajax/snmp.ajax.php | 1 - pandora_console/include/graphs/functions_flot.php | 1 - 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pandora_console/extras/mr/10.sql b/pandora_console/extras/mr/10.sql index 2b58ce08c4..3333da3157 100644 --- a/pandora_console/extras/mr/10.sql +++ b/pandora_console/extras/mr/10.sql @@ -4,4 +4,8 @@ ALTER TABLE tsnmp_filter ADD unified_filters_id int(10) NOT NULL DEFAULT 0; ALTER TABLE treport_content_template ADD COLUMN hide_no_data tinyint(1) DEFAULT 0; ALTER TABLE tgraph_source ADD COLUMN `order` int(10) NOT NULL default 0; +ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL default '0'; +ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0'; +ALTER TABLE tgraph ADD COLUMN `modules_series` tinyint(1) UNSIGNED NOT NULL default '0'; + COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 89a0917265..cb2c5f265c 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -180,18 +180,18 @@ echo "
"; echo "
"; -// echo "".__('Add summatory series')."" . -// ui_print_help_tip (__("This will add a synthetic series to the graph, -// using all series to give a SUM or an average of all present series values -// in each interval. This feature could be used instead synthetic modules -// if you only want to see a graph"), true).""; echo "".__('Percentil').""; echo "" . html_print_checkbox ("percentil", 1, $percentil, true) . ""; -echo "".__('Add summatory series').""; + +echo "".__('Add summatory series') . + ui_print_help_tip (__("Adds synthetic series to the graph, using all module + values to calculate the summation and/or average in each time interval. + This feature could be used instead of synthetic modules if you only want to see a graph."), true) . ""; echo "" . html_print_checkbox ("summatory_series", 1, $summatory_series, true) . " ".__('Add average series').""; echo "" . html_print_checkbox ("average_series", 1, $average_series, true) . ""; echo "".__('Modules and series').""; + echo "" . html_print_checkbox ("modules_series", 1, $modules_series, true) . ""; echo ""; diff --git a/pandora_console/include/ajax/snmp.ajax.php b/pandora_console/include/ajax/snmp.ajax.php index a372d50e11..29fefa026e 100644 --- a/pandora_console/include/ajax/snmp.ajax.php +++ b/pandora_console/include/ajax/snmp.ajax.php @@ -60,7 +60,6 @@ if ($update_snmp_translation) { if ($delete_snmp_filter) { $filter_id = get_parameter('filter_id'); -html_debug($filter_id, true); db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $filter_id)); return; diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 54259ba6b0..897a11b093 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -185,7 +185,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, include_javascript_dependencies_flot_graph(); $menu = (int)$menu; - html_debug($legend); // Get a unique identifier to graph $graph_id = uniqid('graph_'); From d0d0f8b229b4a88a9a41839f434561075ebdbb6a Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 13 Dec 2017 13:08:41 +0100 Subject: [PATCH 21/21] Fix custom graph builder order bar - #1382 --- pandora_console/extras/mr/10.sql | 3 ++- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- .../reporting/graph_builder.graph_editor.php | 22 +++++++++---------- .../godmode/reporting/graph_builder.php | 12 ++++++---- pandora_console/pandoradb.sql | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/pandora_console/extras/mr/10.sql b/pandora_console/extras/mr/10.sql index 3333da3157..53c7c7bcc6 100644 --- a/pandora_console/extras/mr/10.sql +++ b/pandora_console/extras/mr/10.sql @@ -2,7 +2,8 @@ START TRANSACTION; ALTER TABLE tsnmp_filter ADD unified_filters_id int(10) NOT NULL DEFAULT 0; ALTER TABLE treport_content_template ADD COLUMN hide_no_data tinyint(1) DEFAULT 0; -ALTER TABLE tgraph_source ADD COLUMN `order` int(10) NOT NULL default 0; +ALTER TABLE tgraph_source ADD COLUMN `field_order` int(10) NOT NULL default 0; +UPDATE tgraph_source c, (SELECT @n := 0) m SET c.field_order = @n := @n + 1; ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL default '0'; ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0'; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 70fd0a6868..78ff5bf563 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1435,7 +1435,7 @@ ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default '' -- --------------------------------------------------------------------- ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0; -ALTER TABLE tgraph_source ADD COLUMN `order` int(10) NOT NULL default 0; +ALTER TABLE tgraph_source ADD COLUMN `field_order` int(10) NOT NULL default 0; -- --------------------------------------------------------------------- -- Table `tserver_export_data` diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index 4daaf0c18d..da612b6e33 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -61,10 +61,10 @@ switch ($action) { switch ($config["dbtype"]) { case "mysql": $items = db_get_all_rows_sql(' - SELECT id_gs, `order` + SELECT id_gs, `field_order` FROM tgraph_source WHERE id_graph = ' . $id_graph . ' - ORDER BY `order`'); + ORDER BY `field_order`'); break; } @@ -77,7 +77,7 @@ switch ($action) { switch ($config["dbtype"]) { case "mysql": db_process_sql_update('tgraph_source', - array('`order`' => $order_temp), + array('`field_order`' => $order_temp), array('id_gs' => $item['id_rc'])); break; } @@ -89,10 +89,10 @@ switch ($action) { switch ($config["dbtype"]) { case "mysql": $items = db_get_all_rows_sql(' - SELECT id_gs, `order` + SELECT id_gs, `field_order` FROM tgraph_source WHERE id_graph = ' . $id_graph . ' - ORDER BY `order`'); + ORDER BY `field_order`'); break; } @@ -106,7 +106,7 @@ switch ($action) { foreach ($items as $item) { //Remove the contents from the block to sort if (array_search($item['id_gs'], $ids) === false) { - $temp[$item['order']] = $item['id_gs']; + $temp[$item['field_order']] = $item['id_gs']; } } $items = $temp; @@ -142,7 +142,7 @@ switch ($action) { case "mysql": db_process_sql_update('tgraph_source', - array('`order`' => ($order + 1)), + array('`field_order`' => ($order + 1)), array('id_gs' => $id)); break; } @@ -166,7 +166,7 @@ if ($editGraph) { WHERE t2.id_agente_modulo = t1.id_agent_module)) AS agent_name FROM tgraph_source t1 - WHERE t1.id_graph = " . $id_graph . " order by `order`"); + WHERE t1.id_graph = " . $id_graph . " order by `field_order`"); $position_array = array(); $module_array = array(); $weight_array = array(); @@ -183,7 +183,7 @@ if ($editGraph) { $weight_array[] = $graphRow['weight']; $label_array[] = $graphRow['label']; $agent_array[] = $graphRow['agent_name']; - $position_array[] = $graphRow['order']; + $position_array[] = $graphRow['field_order']; } $graphInTgraph = db_get_row_sql("SELECT * FROM tgraph WHERE id_graph = " . $id_graph); @@ -280,9 +280,9 @@ if (defined("METACONSOLE")) { else { $table->data[0][0] = "". __("Sort items") . ""; } -$table->data[1][0] = __('Sort selected items from position: '); +$table->data[1][0] = __('Sort selected items'); $table->data[1][1] = html_print_select_style( - array('before' => __('Move before to'), 'after' => __('Move after to')), 'move_to', + array('before' => __('before to'), 'after' => __('after to')), 'move_to', '', '', '', '', 0, true); $table->data[1][2] = html_print_input_text_extended('position_to_sort', 1, 'text-position_to_sort', '', 3, 10, false, "only_numbers('position_to_sort');", '', true); diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 9a171e6cba..79cb82302a 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -191,10 +191,14 @@ if ($add_module) { implode("','", $id_modules). "')"); - if (count($id_agent_modules) > 0 && $id_agent_modules != '') { - foreach($id_agent_modules as $id_agent_module) - $result = db_process_sql_insert('tgraph_source', array('id_graph' => $id_graph, 'id_agent_module' => $id_agent_module['id_agente_modulo'], 'weight' => $weight)); - } + if (count($id_agent_modules) > 0 && $id_agent_modules != '') { + $order = db_get_row_sql("SELECT `field_order` from tgraph_source ORDER BY `field_order` DESC"); + $order = $order['field_order']; + foreach($id_agent_modules as $id_agent_module){ + $order++; + $result = db_process_sql_insert('tgraph_source', array('id_graph' => $id_graph, 'id_agent_module' => $id_agent_module['id_agente_modulo'], 'weight' => $weight, 'field_order' => $order)); + } + } else $result = false; } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index efd3183810..be28107f04 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1206,7 +1206,7 @@ CREATE TABLE IF NOT EXISTS `tgraph_source` ( `id_agent_module` int(11) NOT NULL default 0, `weight` float(8,3) NOT NULL DEFAULT 0, `label` varchar(150) DEFAULT '', - `order` int(10) DEFAULT 0, + `field_order` int(10) DEFAULT 0, PRIMARY KEY(`id_gs`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8;