diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e7484f6227..15734bfe1d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-06-25 Miguel de Dios + + * operation/agentes/networkmap.topology.php, + include/functions_networkmap.php: fixed the networkmaps of level 2, + now the nodes without conections with others are more or less + clean posicioned into the networkmap. + 2014-06-25 Junichi Satoh * include/help/ja/help_ff_interval.php, diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 62b987ee62..36d250689b 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -550,15 +550,36 @@ function networkmap_generate_dot ($pandora_name, $group = 0, } } } - - // Create a central node if orphan nodes exist - if (count ($orphans) || empty ($nodes)) { - $graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple, $stats); - } - // Define edges for orphan nodes - foreach (array_keys($orphans) as $node) { - $graph .= networkmap_create_edge ('0', $node, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'topology', $id_networkmap); + if ($l2_network) { + $count = 0; + $group_nodes = 10; + $graph .= networkmap_create_transparent_node($count); + foreach (array_keys($orphans) as $node) { + if ($group_nodes == 0) { + $count++; + $graph .= networkmap_create_transparent_node($count); + + $group_nodes = 10; + } + + $graph .= networkmap_create_transparent_edge('transp_' . $count, + $node); + + $group_nodes--; + } + } + else { + // Create a central node if orphan nodes exist + if (count ($orphans) || empty ($nodes)) { + $graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple, $stats); + } + + // Define edges for orphan nodes + foreach (array_keys($orphans) as $node) { + $graph .= networkmap_create_edge ('0', $node, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'topology', $id_networkmap); + } + } // Close graph @@ -824,6 +845,14 @@ function networkmap_create_edge ($head, $tail, $layout, $nooverlap, $pure, $zoom return $edge; } +function networkmap_create_transparent_edge($head, $tail) { + // edgeURL allows node navigation + $edge = "\n" . $head . ' -- ' . $tail . + '[color="#00000000", headclip=false, tailclip=false, edgeURL=""];' . "\n"; + + return $edge; +} + // Returns a group node definition function networkmap_create_group_node ($group, $simple = 0, $font_size = 10, $metaconsole = false, $id_server = null) { global $config; @@ -1245,6 +1274,14 @@ function networkmap_create_pandora_node ($name, $font_size = 10, $simple = 0, $s return $node; } +function networkmap_create_transparent_node($count = 0) { + + $node = 'transp_' .$count . ' [ color="#00000000", style="filled", fixedsize=true, width=0.8, height=0.6, label=<>, + shape="ellipse"];'; + + return $node; +} + // Opens a group definition function networkmap_open_group ($id) { $img = 'images/'.groups_get_icon ($id).'.png'; diff --git a/pandora_console/operation/agentes/networkmap.topology.php b/pandora_console/operation/agentes/networkmap.topology.php index c2badc0a43..1b92297469 100644 --- a/pandora_console/operation/agentes/networkmap.topology.php +++ b/pandora_console/operation/agentes/networkmap.topology.php @@ -84,6 +84,7 @@ else { $result = system ($cmd); fclose ($fh); unlink ($filename_dot); + //~ html_debug_print($cmd); } }