<%doc> Network Topology Graph <%attr> title => 'Network Topology Graph' <%args> $root => undef $graph1 => undef $graph2 => undef $show_names => 0 $minlen => 1 <%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'); my $device_obj = Device->search(name=>$root)->first || $m->comp('/generic/error.mhtml', error=>"Cannot find root device: $root"); my $id = $device_obj->id; if ( $graph1 || $graph2 ){ # Build args my %bargs = ( id => $id, depth => $depth, show_names => $show_names, minlen => $minlen, ); if ( $graph1 ){ $bargs{show_vlans} = 0; $bargs{filename} = $abs_img_path1; }elsif ( $graph2 ){ $bargs{show_vlans} = 1; $bargs{filename} = $abs_img_path2; } $ui->build_device_topology_graph(%bargs); }
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!

Network Graph without VLANs

    %if ( -r $abs_img_path1 ){ % my $inode = stat($abs_img_path1); % my $size = $inode->size; % my $ctime = $inode->ctime;
  • <% $filename1 %> - Generated at: <% scalar localtime($ctime) %>, Size: <% $size %> bytes. %}else{
  • Graph has not been generated yet %}
    Regenerate:

Network Graph with VLANs

    %if ( -r $abs_img_path2 ){ % my $inode = stat($abs_img_path2); % my $size = $inode->size; % my $ctime = $inode->ctime;
  • <% $filename2 %> - Generated at: <% scalar localtime($ctime) %>, Size: <% $size %> bytes. %}else{
  • Graph has not been generated yet %}
    Regenerate: