diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eed051e2b9..75221f7168 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-08-17 Dario Rodriguez + + * include/functions_networkmap.php: Fixed a bug with topology map + + 2011-08-17 Javier Lanz * operation/snmpconsole/snmp_view.php: Fixed an style icon small bug diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index cdbd9eb71a..b99258e603 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -72,11 +72,21 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_ // Parse agents $nodes = array (); $node_count = 1; + + // Add node + $node_ref = array(); + foreach ($agents as $agent) { + // Add node + $node_ref[$agent['id_agente']] = $node_count; + $node_count++; + } + + $node_count = 1; foreach ($agents as $agent) { // Save node parent information to define edges later if ($agent['id_parent'] != "0") { - $parents[$node_count] = $agent['id_parent']; + $parents[$node_count] = $node_ref[$agent['id_parent']]; } else { $orphans[$node_count] = 1; }