From 0fc33f3fa265614326e7bdefd3161eb5b96547e1 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 23 Feb 2018 14:38:26 +0100 Subject: [PATCH 001/112] Fixed module filter in view events --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index a7e6523c7e..9564e87b5e 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -275,7 +275,7 @@ if ($id_agent != 0) { } $text_module = (string) get_parameter('module_search', ''); -$id_agent_module = get_parameter('module_search_hidden', 0); +$id_agent_module = get_parameter('module_search_hidden', get_parameter('id_agent_module',0)); if ($id_agent_module != 0) { $text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); if ($text_module == false) { From 25bed4d5c20bd62abac16c155d553dcaaf9da508 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 26 Feb 2018 13:42:28 +0100 Subject: [PATCH 002/112] Fixed tags in alert list --- pandora_console/include/functions_tags.php | 9 +++- .../operation/agentes/alerts_status.php | 47 +++++++++++-------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 08cfecf26e..b754e90f56 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -975,10 +975,11 @@ function tags_has_user_acl_tags($id_user = false) { * * @param string ID of the user (with false the user will be taked from config) * @param string Access flag where check what tags have the user + * @param bool returns 0 if the user has all the tags * * @return string SQL condition for tagente_module */ -function tags_get_user_tags($id_user = false, $access = 'AR') { +function tags_get_user_tags($id_user = false, $access = 'AR', $return_tag_any = false) { global $config; //users_is_strict_acl @@ -1036,7 +1037,11 @@ function tags_get_user_tags($id_user = false, $access = 'AR') { return array(); } else { - return $all_tags; + if($return_tag_any) { + return 0; + } else { + return $all_tags; + } } } diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 848d5e04f7..6667a73291 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -46,30 +46,37 @@ $offset_simple = (int) get_parameter_get ("offset_simple", 0); $id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups) $free_search = get_parameter("free_search", ''); -$user_tag_array = array_values(array_keys(tags_get_user_tags($config['id_user']))); -$user_tag = ''; +$user_tag_array = tags_get_user_tags($config['id_user'],'AR', true); -foreach ($user_tag_array as $key => $value) { - if ($value === end($user_tag_array)) { - $user_tag .= $value; - } - else{ - $user_tag .= $value.','; - } -} +if ($user_tag_array) { + $user_tag_array = array_values(array_keys($user_tag_array)); + + $user_tag = ''; -$tag_filter = get_parameter("tag_filter", $user_tag); - -$tag_param_validate = explode(',',$tag_filter); - -foreach ($tag_param_validate as $key => $value) { - if (!in_array($value,$user_tag_array)) { - db_pandora_audit("ACL Violation", - "Trying to access Alert view"); - require ("general/noaccess.php"); - exit; + foreach ($user_tag_array as $key => $value) { + if ($value === end($user_tag_array)) { + $user_tag .= $value; + } + else{ + $user_tag .= $value.','; + } } + $tag_filter = get_parameter("tag_filter", $user_tag); + + $tag_param_validate = explode(',',$tag_filter); + + foreach ($tag_param_validate as $key => $value) { + if (!in_array($value,$user_tag_array)) { + db_pandora_audit("ACL Violation", + "Trying to access Alert view"); + require ("general/noaccess.php"); + exit; + } + } + +} else { + $tag_filter = get_parameter("tag_filter", 0); } if ($tag_filter) { From 892d17f65c89f9094581a6bf04e9fabe34667505 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 27 Feb 2018 00:02:10 +0100 Subject: [PATCH 003/112] 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 e5ecc44071..25afc44c64 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.719-180226 +Version: 7.0NG.719-180227 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 837b2398dd..78490f5087 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.719-180226" +pandora_version="7.0NG.719-180227" 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 e8d543c1f2..9d129cfe63 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.719'; -use constant AGENT_BUILD => '180226'; +use constant AGENT_BUILD => '180227'; # 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 684559de55..a9cb6e1796 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.719 -%define release 180226 +%define release 180227 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 ffbf19ef95..b7a1b03951 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.719 -%define release 180226 +%define release 180227 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 f6732f6f13..26efeb059e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.719" -PI_BUILD="180226" +PI_BUILD="180227" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ebf8fada1f..79ab9d7832 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180226} +{180227} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9afe1e2a32..daa9b2603f 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.719(Build 180226)") +#define PANDORA_VERSION ("7.0NG.719(Build 180227)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index dcee24bb35..2971e903f0 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.719(Build 180226))" + VALUE "ProductVersion", "(7.0NG.719(Build 180227))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ce8be97e8c..3e633cadbe 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.719-180226 +Version: 7.0NG.719-180227 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 e4412ceb18..57b912165f 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.719-180226" +pandora_version="7.0NG.719-180227" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 5d68a1f175..c4640173c1 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 = 'PC180226'; +$build_version = 'PC180227'; $pandora_version = 'v7.0NG.719'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 138def79ac..6d29a7019e 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 2d87c9e6c5..889d226a44 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.719 -%define release 180226 +%define release 180227 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 894f23297d..70cc2dc26e 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.719 -%define release 180226 +%define release 180227 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6498162f16..af94338f0c 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.719" -PI_BUILD="180226" +PI_BUILD="180227" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a0c7e0a0bc..46e7645989 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.719 PS180226"; +my $version = "7.0NG.719 PS180227"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 90db5fa2f7..a27b9699a3 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.719 PS180226"; +my $version = "7.0NG.719 PS180227"; # save program name for logging my $progname = basename($0); From 3fc010135bdc8275df2c525bf5322e8c8cf662ae Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 27 Feb 2018 11:04:49 +0100 Subject: [PATCH 004/112] [Console Tree view] Removed empty childs --- pandora_console/include/class/Tree.class.php | 32 ++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 507d1d2b1c..805e46376a 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1212,12 +1212,7 @@ class Tree { Tree::processCounters($groups); // Filter groups and eliminates the reference to empty groups if ($remove_empty) { - // Filter empty groups - $groups = array_filter($groups, function ($group) { - return (isset($group['counters']) && - isset($group['counters']['total']) && - !empty($group['counters']['total'])); - }); + $groups = Tree::deleteEmptyGroups($groups); } usort($groups, array("Tree", "cmpSortNames")); return $groups; @@ -1892,6 +1887,31 @@ class Tree { } } + /** + * @brief Recursive function to remove the empty groups + * + * @param groups All groups structure + * + * @return new_groups A new groups structure without empty groups + */ + protected static function deleteEmptyGroups ($groups) { + $new_groups = array(); + foreach ($groups as $group) { + // If a group is empty, do not add to new_groups. + if (!isset($group['counters']['total']) || $group['counters']['total'] == 0) { + continue; + } + // Tray to remove the children groups + if (!empty($group['children'])) { + $children = Tree::deleteEmptyGroups ($group['children']); + if (empty($children)) unset($group['children']); + else $group['children'] = $children; + } + $new_groups[] = $group; + } + return $new_groups; + } + private static function extractGroupsWithIDs ($groups, $ids_hash) { $result_groups = array(); foreach ($groups as $group) { From 80ecb6f3669e7c5c062dc4dca404f548c6ab0887 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 27 Feb 2018 11:46:28 +0100 Subject: [PATCH 005/112] [Console Tree view] Added counter --- .../include/javascript/tree/TreeController.js | 10 ++++++++++ pandora_console/operation/tree.php | 1 + 2 files changed, 11 insertions(+) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 75acddc3f6..0927276200 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -20,6 +20,7 @@ var TreeController = { recipient: '', tree: [], emptyMessage: "No data found.", + foundMessage: "Found items", errorMessage: "Error", baseURL: "", ajaxURL: "ajax.php", @@ -683,6 +684,12 @@ var TreeController = { } controller.recipient.empty(); + controller.recipient.html( + "
" + + controller.foundMessage + ": " + controller.tree.length + + "
" + + "
" + ); var $children = _processGroup(this.recipient, this.tree, true); $children.show(); @@ -712,6 +719,9 @@ var TreeController = { if (typeof data.emptyMessage !== 'undefined' && data.emptyMessage.length > 0) { this.emptyMessage = data.emptyMessage; } + if (typeof data.foundMessage !== 'undefined' && data.foundMessage.length > 0) { + this.foundMessage = data.foundMessage; + } if (typeof data.errorMessage !== 'undefined' && data.errorMessage.length > 0) { this.errorMessage = data.errorMessage; } diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index d65d662fd8..75d29cd434 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -283,6 +283,7 @@ enterprise_hook('close_meta_frame'); detailRecipient: $.fixedBottomBox({ width: 400, height: window.innerHeight * 0.9 }), page: parameters['page'], emptyMessage: "", + foundMessage: "", tree: data.tree, baseURL: "", ajaxURL: "", From 3e56e9310846e5564d65c0fb771d0773e7010f3c Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 27 Feb 2018 15:04:18 +0100 Subject: [PATCH 006/112] [Server Policies] Check autodisable mode when a policy is apllied --- pandora_server/lib/PandoraFMS/Core.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 1d3784348c..3403b55a67 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -209,6 +209,7 @@ our @EXPORT = qw( pandora_process_event_replication pandora_process_module pandora_reset_server + pandora_safe_mode_modules_update pandora_server_keep_alive pandora_set_event_storm_protection pandora_set_master @@ -5529,6 +5530,29 @@ sub safe_mode($$$$$$) { } } +########################################################################## +=head2 C<< safe_mode_modules_update (I<$pa_config>, I<$agent>, I<$dbh>) >> + +Check if agent safe module is critical and turn all modules to disabled. + +=cut +########################################################################## +sub pandora_safe_mode_modules_update { + my ($pa_config, $agent_id, $dbh) = @_; + + my $agent = get_db_single_row ($dbh, 'SELECT alias, safe_mode_module FROM tagente WHERE id_agente = ?', $agent_id); + # Does nothing if safe_mode is disabled + return unless $agent->{'safe_mode_module'} > 0; + + my $status = get_agentmodule_status($pa_config, $dbh, $agent->{'safe_mode_module'}); + + # If status is critical, disable the rest of the modules. + if ($status == MODULE_CRITICAL) { + logger($pa_config, "Update modules for safe mode agent with alias:" . $agent->{'alias'} . ".", 10); + db_do($dbh, 'UPDATE tagente_modulo SET disabled=1 WHERE id_agente=? AND id_agente_modulo!=?', $agent_id, $agent->{'safe_mode_module'}); + } +} + # End of function declaration # End of defined Code From 789f908b0883f11e2c62ab81f1c1cadb161adeed Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 28 Feb 2018 00:01:39 +0100 Subject: [PATCH 007/112] 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 25afc44c64..090ab35d1e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.719-180227 +Version: 7.0NG.719-180228 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 78490f5087..677317a2cf 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.719-180227" +pandora_version="7.0NG.719-180228" 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 9d129cfe63..d4b862cebf 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.719'; -use constant AGENT_BUILD => '180227'; +use constant AGENT_BUILD => '180228'; # 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 a9cb6e1796..f24e83b7a8 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.719 -%define release 180227 +%define release 180228 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 b7a1b03951..2790257e7e 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.719 -%define release 180227 +%define release 180228 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 26efeb059e..2b75296efa 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.719" -PI_BUILD="180227" +PI_BUILD="180228" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 79ab9d7832..ca356b1b9c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180227} +{180228} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index daa9b2603f..5b1e18770d 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.719(Build 180227)") +#define PANDORA_VERSION ("7.0NG.719(Build 180228)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 2971e903f0..4fa5009cd3 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.719(Build 180227))" + VALUE "ProductVersion", "(7.0NG.719(Build 180228))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3e633cadbe..e382c27ae1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.719-180227 +Version: 7.0NG.719-180228 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 57b912165f..d307396a37 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.719-180227" +pandora_version="7.0NG.719-180228" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index c4640173c1..2912855fc0 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 = 'PC180227'; +$build_version = 'PC180228'; $pandora_version = 'v7.0NG.719'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 6d29a7019e..d24d412b7f 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 889d226a44..5db9f32391 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.719 -%define release 180227 +%define release 180228 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 70cc2dc26e..0bb84e02c3 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.719 -%define release 180227 +%define release 180228 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index af94338f0c..fcd7dca083 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.719" -PI_BUILD="180227" +PI_BUILD="180228" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 46e7645989..5a98d5a967 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.719 PS180227"; +my $version = "7.0NG.719 PS180228"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a27b9699a3..e489254f75 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.719 PS180227"; +my $version = "7.0NG.719 PS180228"; # save program name for logging my $progname = basename($0); From 7c5756a7269fa9b8ebf71120955d455c488cdfb7 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 28 Feb 2018 10:15:32 +0100 Subject: [PATCH 008/112] Fixed list of latest events in tactical view --- pandora_console/include/functions_tags.php | 126 ++++++++++----------- 1 file changed, 62 insertions(+), 64 deletions(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 8fe2fc3993..9440200047 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -850,83 +850,81 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group // Juanma (08/05/2014) Fix : Will have all groups retrieved (also propagated ones) $_groups_not_in = ''; - if($acltags[0]){ - foreach ($acltags as $group_id => $group_tags) { - // Group condition (The module belongs to an agent of the group X) - $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_id_recursive($group_id, true)))); - //$_groups_not_in .= implode(',', array_values(groups_get_id_recursive($group_id))) . ','; + foreach ($acltags as $group_id => $group_tags) { + // Group condition (The module belongs to an agent of the group X) + $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_id_recursive($group_id, true)))); + //$_groups_not_in .= implode(',', array_values(groups_get_id_recursive($group_id))) . ','; - // Tags condition (The module has at least one of the restricted tags) - $tags_condition = ''; - if (empty($group_tags)) { - $tags_condition = "id_grupo = ".$group_id; + // Tags condition (The module has at least one of the restricted tags) + $tags_condition = ''; + if (empty($group_tags)) { + $tags_condition = "id_grupo = ".$group_id; + } + else { + if (!is_array($group_tags)) { + $group_tags = explode(',', $group_tags); } - else { - if (!is_array($group_tags)) { - $group_tags = explode(',', $group_tags); - } - foreach ($group_tags as $tag) { - // If the tag ID doesnt exist, ignore - if (!isset($all_tags[$tag])) { - continue; - } + foreach ($group_tags as $tag) { + // If the tag ID doesnt exist, ignore + if (!isset($all_tags[$tag])) { + continue; + } - if ($tags_condition != '') { - $tags_condition .= " OR \n"; - } + if ($tags_condition != '') { + $tags_condition .= " OR \n"; + } - //~ // Add as condition all the posibilities of the serialized tags - //~ $tags_condition .= sprintf('tags LIKE "%s,%%"',io_safe_input($all_tags[$tag])); - //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s,%%"',io_safe_input($all_tags[$tag])); - //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s"',io_safe_input($all_tags[$tag])); - //~ $tags_condition .= sprintf(' OR tags LIKE "%s %%"',io_safe_input($all_tags[$tag])); - //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s %%"',io_safe_input($all_tags[$tag])); + //~ // Add as condition all the posibilities of the serialized tags + //~ $tags_condition .= sprintf('tags LIKE "%s,%%"',io_safe_input($all_tags[$tag])); + //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s,%%"',io_safe_input($all_tags[$tag])); + //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s"',io_safe_input($all_tags[$tag])); + //~ $tags_condition .= sprintf(' OR tags LIKE "%s %%"',io_safe_input($all_tags[$tag])); + //~ $tags_condition .= sprintf(' OR tags LIKE "%%,%s %%"',io_safe_input($all_tags[$tag])); - if ($force_group_and_tag) { - if (!empty($all_tags[$tag])) { - if ($force_equal) { - $tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag])); - } else { - $tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'"; - } - $childrens = groups_get_childrens($group_id, null, true); - - if (empty($childrens)) { - $tags_condition .= sprintf(' AND id_grupo = %d )', $group_id); - } else { - $childrens_ids[] = $group_id; - foreach ($childrens as $child) { - $childrens_ids[] = (int)$child['id_grupo']; - } - $ids_str = implode(',', $childrens_ids); - - $tags_condition .= sprintf(' AND id_grupo IN (%s) )', $ids_str); - } + if ($force_group_and_tag) { + if (!empty($all_tags[$tag])) { + if ($force_equal) { + $tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag])); } else { - $tags_condition .= "id_grupo = ".$group_id; + $tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'"; + } + $childrens = groups_get_childrens($group_id, null, true); + + if (empty($childrens)) { + $tags_condition .= sprintf(' AND id_grupo = %d )', $group_id); + } else { + $childrens_ids[] = $group_id; + foreach ($childrens as $child) { + $childrens_ids[] = (int)$child['id_grupo']; + } + $ids_str = implode(',', $childrens_ids); + + $tags_condition .= sprintf(' AND id_grupo IN (%s) )', $ids_str); } } else { - if ($force_equal) { - $tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag])); - } else { - $tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'"; - } + $tags_condition .= "id_grupo = ".$group_id; + } + } else { + if ($force_equal) { + $tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag])); + } else { + $tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'"; } } } - - // If there is not tag condition ignore - if (empty($tags_condition)) { - continue; - } - - if ($condition != '') { - $condition .= ' OR '; - } - - $condition .= "($tags_condition)\n"; } + + // If there is not tag condition ignore + if (empty($tags_condition)) { + continue; + } + + if ($condition != '') { + $condition .= ' OR '; + } + + $condition .= "($tags_condition)\n"; } //Commented because ACLs propagation don't work From 6093f6a0d872b3b4b18860e20e84fd9387d67a7d Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 28 Feb 2018 12:08:15 +0100 Subject: [PATCH 009/112] [Metaconsole] Fixed img broken links on metaconsole --- pandora_console/include/functions_ui.php | 21 ++++++++++++++----- .../agentes/interface_traffic_graph_win.php | 8 ++++++- .../operation/agentes/stat_win.php | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index edcbad7ee4..56865d09e7 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1091,10 +1091,11 @@ function ui_print_alert_template_example ($id_alert_template, $return = false, $ * @param bool Whether to return or output the result * @param string Home url if its necessary * @param string Image path + * @param bool Route is relative or not * * @return string The help tip */ -function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = "images/help.png") { +function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = "images/help.png", $is_relative = false) { global $config; if (empty($home_url)) @@ -1104,10 +1105,16 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = $home_url = "../../" . $home_url; } - $output = html_print_image ($image, true, + $output = html_print_image ( + $image, + true, array ("class" => "img_help", "title" => __('Help'), - "onclick" => "open_help ('" . $help_id . "','" . $home_url . "','" . $config['id_user'] . "')")); + "onclick" => "open_help ('" . $help_id . "','" . $home_url . "','" . $config['id_user'] . "')" + ), + false, + $is_relative + ); if (!$return) echo $output; @@ -1904,11 +1911,15 @@ function ui_print_session_action_icon ($action, $return = false) { * @param string Complete text to show in the tip * @param bool whether to return an output string or echo now * @param img displayed image + * @param bool Print image in relative way * * @return string HTML code if return parameter is true. */ -function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png') { - $output = '' . html_print_image ($img, true, array('title' => $text)) . ''; +function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png', $is_relative = false) { + $output = + '' . + html_print_image ($img, true, array('title' => $text), false, $is_relative) . + ''; if ($return) return $output; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index c232af6e91..d002194846 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -271,7 +271,13 @@ $interface_traffic_modules = array( $table->rowclass[] =''; $data = array(); - $data[0] = __('Show full scale graph (TIP)') . ui_print_help_tip(__('This option may cause performance issues'), true); + $data[0] = __('Show full scale graph (TIP)') . + ui_print_help_tip( + __('This option may cause performance issues'), + true, + 'images/tip.png', + true + ); $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true); $table->data[] = $data; $table->rowclass[] =''; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 8e27312304..7465dfd144 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -290,7 +290,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $params = array(); // TOP TEXT //Use the no_meta parameter because this image is only in the base console - $params['top_text'] = "
" . html_print_image('images/wrench_blanco.png', true, array('width' => '16px'), false, false, true) . ' ' . __('Pandora FMS Graph configuration menu') . ui_print_help_icon ("graphs",true, $config["homeurl"], "images/help_w.png") . "
"; + $params['top_text'] = "
" . html_print_image('images/wrench_blanco.png', true, array('width' => '16px'), false, false, true) . ' ' . __('Pandora FMS Graph configuration menu') . ui_print_help_icon ("graphs",true, $config["homeurl"], "images/help_w.png", true) . "
"; $params['body_text'] = "