diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php
index 3c3fbc0091..00bbdddb39 100644
--- a/pandora_console/godmode/groups/group_list.php
+++ b/pandora_console/godmode/groups/group_list.php
@@ -107,6 +107,8 @@ if (is_ajax() === true) {
// Ids of agents to be include in the SQL clause as id_agent IN ().
$filter_agents_json = (string) get_parameter('filter_agents_json', '');
$status_agents = (int) get_parameter('status_agents', AGENT_STATUS_ALL);
+ $os_agent = (int) get_parameter('os_agent', 0);
+ $os_agent_version = (string) get_parameter('os_agent_version', '');
// Juanma (22/05/2014) Fix: If setted remove void agents from result
// (by default and for compatibility show void agents).
$show_void_agents = (int) get_parameter('show_void_agents', 1);
@@ -152,6 +154,14 @@ if (is_ajax() === true) {
$filter['status'] = $status_agents;
}
+ if ($os_agent !== 0) {
+ $filter['id_os'] = $os_agent;
+ }
+
+ if ($os_agent_version !== '') {
+ $filter['os_version'] = $os_agent_version;
+ }
+
if ($id_os !== 0) {
$filter['id_os'] = $id_os;
}
diff --git a/pandora_console/include/functions_massive_operations.php b/pandora_console/include/functions_massive_operations.php
index bd64e964d4..62ed23ab5e 100644
--- a/pandora_console/include/functions_massive_operations.php
+++ b/pandora_console/include/functions_massive_operations.php
@@ -214,10 +214,33 @@ function get_table_inputs_masive_agents($params)
);
}
- $table->data[3][0] = __('Agents');
- $table->data[3][0] .= '';
- $table->data[3][0] .= html_print_image('images/spinner.png', true);
- $table->data[3][0] .= '';
+ $os_list = os_get_os(true);
+
+ $table->data[3][0] = __('OS');
+ $table->data[3][1] = html_print_select(
+ $os_list,
+ 'os_agent',
+ 'selected',
+ '',
+ __('All'),
+ '',
+ true
+ );
+
+ $table->data[3][2] = __('OS Version');
+ $table->data[3][3] = html_print_input_text(
+ 'os_agent_version',
+ '',
+ __('Select OS version'),
+ 35,
+ 255,
+ true
+ );
+
+ $table->data[4][0] = __('Agents');
+ $table->data[4][0] .= '';
+ $table->data[4][0] .= html_print_image('images/spinner.png', true);
+ $table->data[4][0] .= '';
$agents = [];
if (is_metaconsole() === false) {
@@ -228,7 +251,7 @@ function get_table_inputs_masive_agents($params)
);
}
- $table->data[3][1] = html_print_select(
+ $table->data[4][1] = html_print_select(
$agents,
'id_agents[]',
0,
diff --git a/pandora_console/include/javascript/jquery.pandora.controls.js b/pandora_console/include/javascript/jquery.pandora.controls.js
index 731ce0c761..c42f205b60 100644
--- a/pandora_console/include/javascript/jquery.pandora.controls.js
+++ b/pandora_console/include/javascript/jquery.pandora.controls.js
@@ -22,7 +22,9 @@
privilege: "",
serialized: false,
serialized_separator: "",
- nodes: []
+ nodes: [],
+ id_os: -1,
+ os_agent_version: ""
};
/* public methods */
@@ -53,7 +55,7 @@
} else {
recursion_value = config.recursion;
}
-
+
var opts = {
page: "godmode/groups/group_list",
get_group_agents: 1,
@@ -74,7 +76,9 @@
nodes:
typeof config.nodes === "function"
? config.nodes()
- : config.disabled
+ : config.disabled,
+ os_agent: config.os_agent,
+ os_agent_version: config.os_agent_version
};
jQuery.post(
@@ -319,7 +323,6 @@
let href = $("a", config.spanPreview).attr("href");
let hrefPosition = href.search("group_id=");
let hrefNew = href.slice(0, hrefPosition) + "group_id=" + id_group;
-
jQuery.post(
"ajax.php",
{
diff --git a/pandora_console/include/javascript/massive_operations.js b/pandora_console/include/javascript/massive_operations.js
index 6a372f703e..e5edfe1dce 100644
--- a/pandora_console/include/javascript/massive_operations.js
+++ b/pandora_console/include/javascript/massive_operations.js
@@ -110,6 +110,18 @@ function form_controls_massive_operations_agents(metaconsole) {
$("#id_group").trigger("change");
});
+ var os_agent;
+ $("#os_agent").change(function() {
+ os_agent = this.value;
+ $("#id_group").trigger("change");
+ });
+
+ var os_agent_version;
+ $("#text-os_agent_version").keyup(function() {
+ os_agent_version = this.value;
+ $("#id_group").trigger("change");
+ });
+
if (metaconsole == 1) {
$("#nodes").change(function() {
disabled = $("#disabled").val();
@@ -142,6 +154,13 @@ function form_controls_massive_operations_agents(metaconsole) {
},
disabled: function() {
return disabled;
+ },
+ os_agent: function() {
+ return os_agent;
+ },
+ os_agent_version: function() {
+ console.log(os_agent_version);
+ return os_agent_version;
}
};