% unless ($ok) {

Map data missing

Have you run netdisco -g yet?

netmap.gif : <% $have_gif ? "OK" : "unaccessible" %>.
netmap.map : <% $have_map ? "OK" : $! %>.

You can also do this from the Admin Panel if you have administrative rights. %# % } else { %# %# % foreach my $line (@map){ <%$line%> % }
Map Data is <%$map_days%> days old. % }

Key

% for(my $i = 0; $i <= $#{$left_key} || $i <= $#{$right_key}; $i++) { % if (defined($left_key->[$i])) { % } else { % } % if (defined($right_key->[$i])) { % } else { % } % }
<%$left_key->[$i]->[0]%> <%$left_key->[$i]->[1]%> <%$right_key->[$i]->[0]%> <%$right_key->[$i]->[1]%> 
<%init> my $comp = $m->current_comp; my $dir = $comp->source_dir; my $have_map = open (MAP, "< $dir/netmap.map"); my (@map, $map_age, $secs_per_day, $map_days); my $have_gif = -r "$dir/netmap.gif"; my $ok = ($have_map && $have_gif); if ($ok){ @map = (); close (MAP); $map_age = (stat("$dir/netmap.gif"))[9]; $map_age = time - $map_age; $secs_per_day = 60*60*24; $map_days = sprintf("%-2.2f", $map_age/$secs_per_day); } my $right_key = [ [ '--------', 'Green Lines - WAN' ], [ '-------', 'Thin lines - 10Mbps' ], [ '=======', 'Thick lines - 100Mbps' ], [ '=======', 'Cyan lines - 1.0 Gbps' ] ]; my $left_key = []; foreach my $map (@{$netdisco::CONFIG{node_map}}) { my ($var,$regex,$attr,$val,$name,$label) = split(':',$map); next unless $name && $label; my ($textcolor) = $netdisco::CONFIG{node_fontcolor} || 'white'; my ($bracketcolor) = $netdisco::CONFIG{graph_color} || 'white'; if ($attr eq 'fillcolor') { $textcolor = $bracketcolor = $val; } elsif ($attr eq 'color') { $bracketcolor = $val; } my($txt) = '['; if ($textcolor ne $bracketcolor) { $txt .= ''; } $txt .= $name; if ($textcolor ne $bracketcolor) { $txt .= ''; } $txt .= ']'; push(@{$left_key}, [ $txt, $label ]); } my $problem = $netdisco::CONFIG{node_problem} || 'red'; my $colorname = $problem; $colorname =~ s/^./\U$&/; push(@{$left_key}, [ '[bad-dev]', $colorname . ' Box - Device unaccessable' ]); <%method title> - Network Map \ %# $Id: netmap.html,v 1.6 2006/01/03 21:44:46 fenner Exp $ %# vim:syntax=mason