#!/usr/tardis/local/gnu/bin/perl5 # mrtgidx - generate html index page based on mrtg.cfg # # Syntax: mrtgidx # # v0.1 1996-11 by Axel Dunkel (ad@Dunkel.de) # # --- start of configuration section --- $include_inactive = 1; # include interfaces that are commented out # --- eof of configuration section --- if ($#ARGV < 0) { print "mrtgidx: generate HTML index page based on MRTG config file\n"; print "\nUsage: mrtgidx \n"; exit 2; } while ($line = <>) { chop $line; if ($line =~ /^(#*).*Title\[(\S+)\]:\s*([^:]*):\s*(.*)$/) { $cmt = $1; $itf = $2; $title = $3; $title_if = $4; if ($cmt ne "#" || $include_inactive) { if ($itf =~ /(.*)\.([0-9]+)/) { $router{$1,$2} = $title_if; $router_f{$1,$2} = $itf; $router_n{$1} = $title; $active{$1,$2} = $cmt; } else { print STDERR "Warning: can not interpret : $itf\n"; } } } } # print HTML header print "MRTG Index\n"; print "\n"; print "

MRTG - Index

\n"; print "generated by mrtgidx by Axel Dunkel\n"; print "\n";