The network interfaces table now accepts the 'ifOperStatus' modules with more types

The types are remote_snmp_proc, remote_icmp_proc, remote_tcp_proc and generic_proc.
This commit is contained in:
Alejandro Gallardo Escobar 2015-03-02 14:21:09 +01:00
parent 52e3926c71
commit 3da480908b
1 changed files with 20 additions and 6 deletions

View File

@ -2229,17 +2229,31 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
$agent_name = $agent['nombre'];
$agent_interfaces = array();
$accepted_module_types = array();
$remote_snmp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc");
if ($remote_snmp_proc)
$accepted_module_types[] = $remote_snmp_proc;
$remote_icmp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_icmp_proc");
if ($remote_icmp_proc)
$accepted_module_types[] = $remote_icmp_proc;
$remote_tcp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_tcp_proc");
if ($remote_tcp_proc)
$accepted_module_types[] = $remote_tcp_proc;
$generic_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "generic_proc");
if ($generic_proc)
$accepted_module_types[] = $generic_proc;
if (empty($accepted_module_types))
$accepted_module_types[] = 0; // No modules will be returned
$columns = array(
"id_agente_modulo",
"nombre",
"descripcion",
"ip_target"
);
$filter = array(
"id_agente" => $agent_id,
"id_tipo_modulo" => (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc"),
"disabled" => 0
);
$filter = " id_agente = $agent_id AND disabled = 0 AND id_tipo_modulo IN (".implode(",", $accepted_module_types).")";
$modules = agents_get_modules($agent_id, $columns, $filter, true, false);
if (!empty($modules)) {