--- projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in 2003/08/28 11:26:42 1.1 +++ projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in 2004/01/16 15:54:56 1.5 @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # i-scream central monitoring system # http://www.i-scream.org -# Copyright (C) 2000-2003 i-scream +# Copyright (C) 2000-2004 i-scream # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -29,13 +29,19 @@ Usage: $progname [OPTION]... [CONFIGFILE]... Generate an XHTML index page on stdout from MRTG config files specified on the command line or read from stdin. +--title TITLE Use TITLE as the title of the generated page --help Display this help and exit Version $package_version - report bugs to $package_bugreport. EOF sub main () { - GetOptions('help' => \my $help) or die $help_text; + my $hostname = `hostname`; + chomp $hostname; + my $pagetitle = "MRTG: $hostname"; + + GetOptions('title=s' => \$pagetitle, + 'help' => \my $help) or die $help_text; if ($help) { print "$help_text"; exit 0; @@ -53,17 +59,19 @@ sub main () { "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - MRTG + $pagetitle -

MRTG

+

$pagetitle

EOF foreach my $title (sort keys %pages) { my $page = $pages{$title}; print "

$title

\n"; - print "\n"; + print "

\"$page\"

\n"; } print <Generated by +libstatgrab version $package_version.

EOF