Cisco-ShowIPRoute-Parser
view release on metacpan or search on metacpan
plot-route.pl view on Meta::CPAN
unless( $addednode{$h} )
{
addnode($graph,$h,$hip);
$addednode{$h}++;
}
unless( $addednode{$p} )
{
addnode($graph,$p,$pip);
$addednode{$p}++;
}
unless( $addededge{"$h$hip->$p$pip"} )
{
$graph->add_edge({ from => $h, to => $p , color=>$col});
$addededge{"$h$hip->$p$pip"}++;
}
$i++;
}
$dest = $p;
return($src,$dest);
}
sub addnode
{
my $self = shift;
my $name = shift;
my $ip = shift;
my $l = '';
if($name eq $ip)
{
$l = $name;
}
else
{
$l = "$name\n$ip";
}
$self->add_node({ name=> $name, label=>$l, color => 'red',
URL => "http://www/place/$name-log.html" })
}
sub printhtml
{
my $from = shift;
my $to = shift;
open O, "> $name.html" || die;
if($from && $to)
{
$to = 'ACCESS' if $to eq 'TCNZA2';
print O <<EOT;
<h3>Note:</h3>
<h4>Created $date</h4>
<p>
This graph shows only the active routes from $from to $to
</p>
<p>
It does not include '<i>feasible succesors</i>' or '<i>inactive</i>'
backup links (eg BRI interface on branch routers).
</p>
<img src="http://www/customer/routegraphs/$name.png" border="1" vspace="1"
hspace="1" alt="active routes from $from to $to" align="left">
EOT
}
else
{
print O <<EOT;
<h3>No Graph Available</h3>
<h4>Created $date</h4>
EOT
}
}
( run in 1.899 second using v1.01-cache-2.11-cpan-39bf76dae61 )