diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8c913e381b..11e1da6c70 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.756-210830 +Version: 7.0NG.756-210831 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 3f6f1e8df9..a292079f2b 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.756-210830" +pandora_version="7.0NG.756-210831" 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 e7a77d93c0..6b9097720d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.756'; -use constant AGENT_BUILD => '210830'; +use constant AGENT_BUILD => '210831'; # 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 1dad75c43a..817b0a58e2 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.756 -%define release 210830 +%define release 210831 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 60581ed39d..97fde29cae 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.756 -%define release 210830 +%define release 210831 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 35b6e207be..cdbabb774e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.756" -PI_BUILD="210830" +PI_BUILD="210831" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 49c50f4dd3..6b883eb8c5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210830} +{210831} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 42f598c87d..1302d61fc6 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.756 Build 210830") +#define PANDORA_VERSION ("7.0NG.756 Build 210831") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1a2c6ce144..d83a66104b 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.756(Build 210830))" + VALUE "ProductVersion", "(7.0NG.756(Build 210831))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c40dd50d2f..bd2392d2dc 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.756-210830 +Version: 7.0NG.756-210831 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 65a343c6f9..7bcdf489cb 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.756-210830" +pandora_version="7.0NG.756-210831" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 2a4f1de300..e5b47dd219 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -748,6 +748,7 @@ switch ($action) { $selected_agent_group_filter = $es['agent_group_filter']; $selected_agents_inventory_display_options = $es['agents_inventory_display_options']; $selected_agent_os_filter = $es['agent_os_filter']; + $selected_agent_custom_fields = $es['agent_custom_fields']; $selected_agent_custom_field_filter = $es['agent_custom_field_filter']; $selected_agent_status_filter = $es['agent_status_filter']; $selected_agent_module_search_filter = $es['agent_module_search_filter']; @@ -3158,6 +3159,28 @@ $class = 'databox filters'; + + + + + + + + + 0) { + $('#text-agent_custom_field_filter').removeAttr('disabled'); + } else { + $('#text-agent_custom_field_filter').prop('disabled', true); + } + + $("#agent_custom_fields").change(function(e) { + if ($('#agent_custom_fields :selected').length > 0) { + $('#text-agent_custom_field_filter').removeAttr('disabled'); + } else { + $('#text-agent_custom_field_filter').prop('disabled', true); + } + }); + break; case 'inventory': diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index e72eab78a3..9b8982f29a 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2219,6 +2219,7 @@ switch ($action) { $es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options'); $es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter'); $es['agent_os_filter'] = get_parameter('agent_os_filter'); + $es['agent_custom_fields'] = get_parameter('agent_custom_fields'); $es['agent_status_filter'] = get_parameter('agent_status_filter'); $es['agent_version_filter'] = get_parameter('agent_version_filter'); $es['agent_module_search_filter'] = get_parameter('agent_module_search_filter'); @@ -2858,6 +2859,7 @@ switch ($action) { $es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options'); $es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter'); $es['agent_os_filter'] = get_parameter('agent_os_filter'); + $es['agent_custom_fields'] = get_parameter('agent_custom_fields'); $es['agent_status_filter'] = get_parameter('agent_status_filter'); $es['agent_version_filter'] = get_parameter('agent_version_filter'); $es['agent_module_search_filter'] = get_parameter('agent_module_search_filter'); diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 236b7531b6..aec55d97c7 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -593,7 +593,7 @@ class Tree $module['type'] = 'module'; $module['id'] = (int) $module['id']; - $module['name'] = io_safe_output($module['name']); + $module['name'] = $module['name']; $module['id_module_type'] = (int) $module['id_tipo_modulo']; $module['server_type'] = (int) $module['id_modulo']; $module['status'] = $module['estado']; @@ -1097,7 +1097,7 @@ class Tree protected function getThirdLevelSql() { - // Get the server id + // Get the server id. $serverID = $this->serverID; $group_acl = $this->getGroupAclCondition(); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 27a49bdfbd..31b0e6cdd1 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210830'; +$build_version = 'PC210831'; $pandora_version = 'v7.0NG.756'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 6b10b7c439..5773908386 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2285,6 +2285,7 @@ function reporting_agents_inventory($report, $content) $external_source = io_safe_input(json_decode($content['external_source'], true)); $es_agents_inventory_display_options = $external_source['agents_inventory_display_options']; + $es_agent_custom_fields = $external_source['agent_custom_fields']; $es_custom_fields = $external_source['agent_custom_field_filter']; $es_os_filter = $external_source['agent_os_filter']; $es_agent_status_filter = $external_source['agent_status_filter']; @@ -2299,10 +2300,20 @@ function reporting_agents_inventory($report, $content) $es_agents_inventory_display_options = []; } + $custom_field_sql = ''; $search_sql = ''; - if ($es_custom_fields != '') { - $search_sql .= ' AND id_os = '.$es_custom_fields; + if (!empty($es_agent_custom_fields)) { + $custom_field_sql = 'INNER JOIN tagent_custom_data tacd ON tacd.id_agent = tagente.id_agente'; + if ($es_agent_custom_fields[0] != 0) { + $custom_field_sql .= ' AND tacd.id_field IN ('.implode(',', $es_agent_custom_fields).')'; + } + + if (!empty($es_custom_fields)) { + $custom_field_sql .= ' AND tacd.description like "%'.$es_custom_fields.'%"'; + } else { + $custom_field_sql .= ' AND tacd.description <> ""'; + } } if (in_array('0', $es_os_filter) === false) { @@ -2341,8 +2352,10 @@ function reporting_agents_inventory($report, $content) ON tagente.id_agente = tasg.id_agent LEFT JOIN tagente_modulo tam ON tam.id_agente = tagente.id_agente + %s WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s)) %s', + $custom_field_sql, $user_groups_to_sql, $user_groups_to_sql, $search_sql diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 28066781d5..082e1ab5eb 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -69,9 +69,9 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals // Module name if ($module['disabled']) { - $cellName = ''.ui_print_truncate_text(io_safe_output($module['nombre']), GENERIC_SIZE_TEXT, true, true, true, '[…]', 'text-transform: uppercase;').ui_print_help_tip(__('Disabled'), true).''; + $cellName = ''.ui_print_truncate_text($module['nombre'], GENERIC_SIZE_TEXT, true, true, true, '[…]', 'text-transform: uppercase;').ui_print_help_tip(__('Disabled'), true).''; } else { - $cellName = ui_print_truncate_text(io_safe_output($module['nombre']), GENERIC_SIZE_TEXT, true, true, true, '[…]', 'text-transform: uppercase;'); + $cellName = ui_print_truncate_text($module['nombre'], GENERIC_SIZE_TEXT, true, true, true, '[…]', 'text-transform: uppercase;'); } $row = []; diff --git a/pandora_console/include/javascript/pandora_dashboards.js b/pandora_console/include/javascript/pandora_dashboards.js index ffd3cacf74..e1de0ba834 100644 --- a/pandora_console/include/javascript/pandora_dashboards.js +++ b/pandora_console/include/javascript/pandora_dashboards.js @@ -1169,6 +1169,10 @@ function dashboardLoadVC(settings) { // eslint-disable-next-line no-unused-vars function dashboardShowEventDialog(settings) { settings = JSON.parse(atob(settings)); + var dialog_exist = $("div[aria-describedby='event_details_window']"); + if (dialog_exist.length == 1) { + $("div[aria-describedby='event_details_window']").remove(); + } $.ajax({ method: "post", url: settings.ajaxUrl, diff --git a/pandora_console/include/lib/Dashboard/Widgets/events_list.php b/pandora_console/include/lib/Dashboard/Widgets/events_list.php index e457df69bf..45633b08c2 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/events_list.php +++ b/pandora_console/include/lib/Dashboard/Widgets/events_list.php @@ -761,11 +761,6 @@ class EventsListWidget extends Widget $output .= "
"; $output .= "
"; - $output .= \ui_require_javascript_file( - 'pandora_events', - 'include/javascript/', - true - ); } else { $output .= '
'; $output .= \ui_print_info_message( diff --git a/pandora_console/install.php b/pandora_console/install.php index 809ca908b9..0cde6a0213 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 2d24610815..16e4f10efb 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.756 -%define release 210830 +%define release 210831 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 158ea86b84..20b8b4387e 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.756 -%define release 210830 +%define release 210831 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 0330baf456..fcfb10e8fa 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.756" -PI_BUILD="210830" +PI_BUILD="210831" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 71dafc3476..6abd5b20d8 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.756 Build 210830"; +my $version = "7.0NG.756 Build 210831"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index fa9b9a5b9a..0254f9123c 100755 --- 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.756 Build 210830"; +my $version = "7.0NG.756 Build 210831"; # save program name for logging my $progname = basename($0);