Fixed an error which relaxed the requirements to retrieve network interfaces

(cherry picked from commit 8f9db3917657ffc1626fb64e99077ac02647fe18)
This commit is contained in:
Alejandro Gallardo Escobar 2015-03-03 14:51:19 +01:00
parent 45589d7489
commit 867b10151b

View File

@ -2212,7 +2212,7 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
"descripcion",
"ip_target"
);
$filter = " id_agente = $agent_id AND disabled = 0 AND id_tipo_modulo IN (".implode(",", $accepted_module_types).")";
$filter = " id_agente = $agent_id AND disabled = 0 AND id_tipo_modulo IN (".implode(",", $accepted_module_types).") AND nombre LIKE 'ifOperStatus_%'";
$modules = agents_get_modules($agent_id, $columns, $filter, true, false);
@ -2228,9 +2228,7 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
$interface_name = $matches[1];
$interface_name_escaped = str_replace("/", "\/", $interface_name);
if (!isset($interfaces[$interface_name])
|| (isset($interfaces[$interface_name])
&& preg_match ("/^ifOperStatus_$interface_name_escaped$/i", $module_name, $matches))) {
if (preg_match ("/^ifOperStatus_$interface_name_escaped$/i", $module_name, $matches)) {
$interfaces[$interface_name] = $module;
}