Subversion Repositories sysadmin_scripts

Rev

Rev 128 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 128 Rev 132
Line 18... Line 18...
18
 
18
 
19
# where the script is located
19
# where the script is located
20
my $scriptDir = dirname( File::Spec->rel2abs( __FILE__ ) );
20
my $scriptDir = dirname( File::Spec->rel2abs( __FILE__ ) );
21
# put the statefile in there
21
# put the statefile in there
22
my $STATEFILE = $scriptDir . '/mapSwitches.yaml';
22
my $STATEFILE = $scriptDir . '/mapSwitches.yaml';
-
 
23
my $tsvFileName = 'mapswitches.tsv';
23
 
24
 
24
my %switchports;
25
my %switchports;
25
 
26
 
26
# pretty up the MAC addresses by inserting colons between
27
# pretty up the MAC addresses by inserting colons between
27
# every pair of numbers
28
# every pair of numbers
Line 81... Line 82...
81
            $switchports{$switch}{'ports'}{$port}{$connection}{'hostname'},
82
            $switchports{$switch}{'ports'}{$port}{$connection}{'hostname'},
82
            &prettyTime( $switchports{$switch}{'ports'}{$port}{$connection}{'lastseen'} )
83
            &prettyTime( $switchports{$switch}{'ports'}{$port}{$connection}{'lastseen'} )
83
         ) ;
84
         ) ;
84
      }
85
      }
85
   }
86
   }
86
   print "</table>\n</body>\n</html>\n";
87
   print "</table>\n<p align='center'><a href='$tsvFileName'>Download as Tab Delimited</a></p></body>\n</html>\n";
87
}
88
}
88
 
89
 
89
1;
90
1;