<%doc> Network Topology Graph <%attr> title => 'Network Topology Graph' <%args> $root => undef $submit1 => undef $submit2 => undef <%init> use File::stat; my $DEBUG = 0; my $ui = Netdot::UI->new(); my $netdot_path = Netdot->config->get('NETDOT_PATH'); my $web_path = $r->dir_config('NetdotPath'); my $filename1 = "whole_network_no_vlans.png"; my $filename2 = "whole_network_with_vlans.png"; my $graph_path1 = "img/graphs/$filename1"; my $graph_path2 = "img/graphs/$filename2"; my $rel_img_path1 = "$web_path" . "$graph_path1"; my $rel_img_path2 = "$web_path" . "$graph_path2"; my $abs_img_path1 = "$netdot_path/htdocs/$graph_path1"; my $abs_img_path2 = "$netdot_path/htdocs/$graph_path2"; my $depth = 99999; if ( $DEBUG ){ print '
', Dumper(%ARGS), '
'; } $root ||= Netdot->config->get('NMS_DEVICE'); <%perl> my $device_obj = Device->search(name=>$root)->first || $m->comp('/generic/error.mhtml', error=>"Cannot find root device: $root"); my $id = $device_obj->id;
Network Topology Graph

Note: Regenerating the topology graph for the whole network can consume a considerable amount of computing resources, depending on the number of devices and links in the database.
Please use cautiously!
<%perl> if ( $submit1 ){ $ui->build_device_topology_graph(id => $id, depth => $depth, show_vlans => 0, show_names => 0, filename => $abs_img_path1, ); }elsif ( $submit2 ){ $ui->build_device_topology_graph(id => $id, depth => $depth, show_vlans => 1, show_names => 0, filename => $abs_img_path2, ); }

Network Graph without VLANs

Network Graph with VLANs