ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in
(Generate patch)

Comparing projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in (file contents):
Revision 1.1 by ats, Thu Aug 28 11:26:42 2003 UTC vs.
Revision 1.7 by tdb, Tue Apr 6 14:53:00 2004 UTC

# Line 1 | Line 1
1   #!/usr/bin/perl -w
2 < # i-scream central monitoring system
2 > # i-scream libstatgrab
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
# Line 16 | Line 16
16   # You should have received a copy of the GNU General Public License
17   # along with this program; if not, write to the Free Software
18   # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 + #
20 + # $Id$
21  
22   use strict;
23   use Getopt::Long;
# Line 29 | Line 31 | Usage: $progname [OPTION]... [CONFIGFILE]...
31   Generate an XHTML index page on stdout from MRTG config files specified
32   on the command line or read from stdin.
33  
34 + --title TITLE                Use TITLE as the title of the generated page
35   --help                       Display this help and exit
36  
37   Version $package_version - report bugs to $package_bugreport.
38   EOF
39  
40   sub main () {
41 <        GetOptions('help' => \my $help) or die $help_text;
41 >        my $hostname = `hostname`;
42 >        chomp $hostname;
43 >        my $pagetitle = "MRTG: $hostname";
44 >
45 >        GetOptions('title=s' => \$pagetitle,
46 >                   'help' => \my $help) or die $help_text;
47          if ($help) {
48                  print "$help_text";
49                  exit 0;
# Line 53 | Line 61 | sub main () {
61      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
62   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
63   <head>
64 <    <title>MRTG</title>
64 >    <title>$pagetitle</title>
65   </head>
66   <body>
67 < <h1>MRTG</h1>
67 > <h1>$pagetitle</h1>
68   EOF
69          foreach my $title (sort keys %pages) {
70                  my $page = $pages{$title};
71                  print "<h2><a href=\"$page.html\">$title</a></h2>\n";
72 <                print "<img src=\"$page-day.png\" />\n";
72 >                print "<p><img src=\"$page-day.png\" alt=\"$page\" /></p>\n";
73          }
74          print <<EOF;
75 + <p>Generated by <a href="http://www.i-scream.org/libstatgrab">
76 + libstatgrab</a> version $package_version.</p>
77   </body>
78   </html>
79   EOF

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines