diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index 16db89b622..aa8c68175e 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -740,12 +740,9 @@ switch ($action) {
break;
case 'agents_inventory':
-
-
-
$description = $item['description'];
$es = json_decode($item['external_source'], true);
- // hd($es);
+
$date = $es['date'];
$selected_agent_group_filter = $es['agent_group_filter'];
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
@@ -754,6 +751,7 @@ switch ($action) {
$selected_agent_status_filter = $es['agent_status_filter'];
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
$selected_agent_version_filter = $es['agent_version_filter'];
+ $selected_agent_remote = $es['agent_remote_conf'];
$idAgent = $es['id_agents'];
$idAgentModule = $inventory_modules;
@@ -3201,7 +3199,7 @@ $class = 'databox filters';
?>
-
+
|
- |
+ |
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index 0e7d4c2705..6a2c9b9d34 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -2108,6 +2108,7 @@ switch ($action) {
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
+ $es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
@@ -2745,6 +2746,7 @@ switch ($action) {
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
+ $es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index d4965815b0..76c9986fb4 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -2284,26 +2284,27 @@ function reporting_agents_inventory($report, $content)
$es_agent_module_search_filter = $external_source['agent_module_search_filter'];
$es_agent_group_filter = $external_source['agent_group_filter'];
$es_users_groups = $external_source['users_groups'];
-
+ $es_agent_remote_conf = $external_source['agent_remote_conf'];
+ hd($es_agent_group_filter);
$search_sql = '';
- if ($es_custom_fields != 0) {
+ if ($es_custom_fields != '') {
$search_sql .= ' AND id_os = '.$es_custom_fields;
}
- if ($es_os_filter != 0) {
+ if ($es_os_filter != '') {
$search_sql .= ' AND id_os = '.$es_os_filter;
}
- if ($es_agent_status_filter != 0) {
+ if ($es_agent_status_filter != '') {
$search_sql .= ' AND tae.estado = '.$es_agent_status_filter;
}
- if ($es_agent_version_filter != 0) {
- $search_sql .= ' AND tagente.agent_version = '.$es_agent_version_filter;
+ if ($es_agent_version_filter != '') {
+ $search_sql .= ' AND tagente.agent_version = "'.$es_agent_version_filter.'"';
}
- if ($es_agent_module_search_filter != 0) {
+ if ($es_agent_module_search_filter != '') {
$search_sql .= ' AND tam.nombre = '.$es_agent_module_search_filter;
}
@@ -2311,8 +2312,13 @@ function reporting_agents_inventory($report, $content)
$search_sql .= ' AND tagente.id_grupo = '.$es_agent_group_filter;
}
- $user_groups_to_sql = implode(',', array_keys(users_get_groups()));
+ hd($es_agent_remote);
+ if ($es_agent_remote_conf != '') {
+ $search_sql .= ' AND tagente.remote = '.$es_agent_remote_conf;
+ }
+ $user_groups_to_sql = implode(',', array_keys(users_get_groups()));
+ hd($search_sql);
$sql = sprintf(
'SELECT DISTINCT(tagente.id_agente) AS id_agente,
tagente.id_os,