| 1 |
|
#!/usr/bin/perl -w |
| 2 |
|
# i-scream central monitoring system |
| 3 |
|
# http://www.i-scream.org |
| 4 |
< |
# Copyright (C) 2000-2003 i-scream |
| 4 |
> |
# Copyright (C) 2000-2004 i-scream |
| 5 |
|
# |
| 6 |
|
# This program is free software; you can redistribute it and/or |
| 7 |
|
# modify it under the terms of the GNU General Public License |
| 29 |
|
Generate an XHTML index page on stdout from MRTG config files specified |
| 30 |
|
on the command line or read from stdin. |
| 31 |
|
|
| 32 |
+ |
--title TITLE Use TITLE as the title of the generated page |
| 33 |
|
--help Display this help and exit |
| 34 |
|
|
| 35 |
|
Version $package_version - report bugs to $package_bugreport. |
| 36 |
|
EOF |
| 37 |
|
|
| 38 |
|
sub main () { |
| 39 |
< |
GetOptions('help' => \my $help) or die $help_text; |
| 39 |
> |
my $hostname = `hostname`; |
| 40 |
> |
chomp $hostname; |
| 41 |
> |
my $pagetitle = "MRTG: $hostname"; |
| 42 |
> |
|
| 43 |
> |
GetOptions('title=s' => \$pagetitle, |
| 44 |
> |
'help' => \my $help) or die $help_text; |
| 45 |
|
if ($help) { |
| 46 |
|
print "$help_text"; |
| 47 |
|
exit 0; |
| 59 |
|
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 60 |
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 61 |
|
<head> |
| 62 |
< |
<title>MRTG</title> |
| 62 |
> |
<title>$pagetitle</title> |
| 63 |
|
</head> |
| 64 |
|
<body> |
| 65 |
< |
<h1>MRTG</h1> |
| 65 |
> |
<h1>$pagetitle</h1> |
| 66 |
|
EOF |
| 67 |
|
foreach my $title (sort keys %pages) { |
| 68 |
|
my $page = $pages{$title}; |
| 69 |
|
print "<h2><a href=\"$page.html\">$title</a></h2>\n"; |
| 70 |
< |
print "<img src=\"$page-day.png\" />\n"; |
| 70 |
> |
print "<p><img src=\"$page-day.png\" alt=\"$page\" /></p>\n"; |
| 71 |
|
} |
| 72 |
|
print <<EOF; |
| 73 |
+ |
<p>Generated by <a href="http://www.i-scream.org/libstatgrab"> |
| 74 |
+ |
libstatgrab</a> version $package_version.</p> |
| 75 |
|
</body> |
| 76 |
|
</html> |
| 77 |
|
EOF |