From f0abdc0dc627343fdbc8821fb46a90d41bc47d35 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 12 Jan 2015 15:40:02 +0100 Subject: [PATCH] Fixed the topology networkmaps, sometimes the relationships of agents showed bad --- .../include/functions_networkmap.php | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 2844fdd3df..9f0383c59f 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -333,16 +333,6 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $node_ref[$agent['id_agente']] = $node_count; - // Save node parent information to define edges later - if ($agent['id_parent'] != "0" && - array_key_exists($agent['id_parent'], $node_ref)) { - - $parents[$node_count] = $node_ref[$agent['id_parent']]; - } - else { - $orphans[$node_count] = 1; - } - $agent['id_node'] = $node_count; $agent['type'] = 'agent'; @@ -389,6 +379,19 @@ function networkmap_generate_dot ($pandora_name, $group = 0, } } + // Addded the relationship of parents of agents + foreach ($agents as $agent) { + if ($agent['id_parent'] != "0" && + array_key_exists($agent['id_parent'], $node_ref)) { + + + $parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']]; + } + else { + $orphans[$node_ref[$agent['id_agente']]] = 1; + } + } + // Drop the modules without a partner if l2_network is true // and the snmp interfaces token is false if ($l2_network) {