projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/pr/1883'
[collectd.git]
/
contrib
/
collectd2html.pl
diff --git
a/contrib/collectd2html.pl
b/contrib/collectd2html.pl
index
210fd64
..
511b3f9
100644
(file)
--- a/
contrib/collectd2html.pl
+++ b/
contrib/collectd2html.pl
@@
-68,7
+68,7
@@
$HOST = $tmp[0] if (! defined $HOST);
my $svg_p = ($IMG_FMT eq "SVG");
my $IMG_SFX = $svg_p ? ".svg" : ".png";
my $IMG_DIR = "${HOST}.dir";
my $svg_p = ($IMG_FMT eq "SVG");
my $IMG_SFX = $svg_p ? ".svg" : ".png";
my $IMG_DIR = "${HOST}.dir";
-my $HTML = "${HOST}.html";
+my $HTML = "${HOST}.
x
html";
################################################################################
#
################################################################################
#
@@
-118,14
+118,20
@@
open(OUT, ">$HTML");
my $title="Rrd plot for $HOST";
print OUT <<END;
my $title="Rrd plot for $HOST";
print OUT <<END;
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
+<style type="text/css" media="screen">
+.graph { text-align: center; }
+object.graph { width: 670; height: 179; }
+</style>
<title>$title</title>
<title>$title</title>
+<meta http-equiv="Content-Type"
+ content="application/xhtml+xml; charset=us-ascii" />
</head>
<body>
</head>
<body>
-<center>
END
# list interesting rrd
END
# list interesting rrd
@@
-148,20
+154,20
@@
foreach my $rrd (@list){
# table of contents
print OUT <<END;
# table of contents
print OUT <<END;
-<
A name="top"></A><H1>$title</H
1>
-<
P
>
+<
h1><a id="top">$title</a></h
1>
+<
p
>
END
foreach my $bn (@rrds){
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
END
foreach my $bn (@rrds){
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
-<
A href="#$cleaned_bn">$bn</A
>
+<
a href="#$cleaned_bn">$bn</a
>
END
}
print OUT <<END;
END
}
print OUT <<END;
-</
P
>
+</
p
>
END
# graph interesting rrd
END
# graph interesting rrd
@@
-206,11
+212,11
@@
for (my $i = 0; $i < scalar(@rrds); ++$i) {
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
my $cleaned_bn = $bn;
$cleaned_bn =~ tr/%\//__/;
print OUT <<END;
-<
A name="$cleaned_bn"></A><H1>$bn</H1
>
+<
h2><a id="$cleaned_bn">$bn</a></h2
>
END
# graph various ranges
END
# graph various ranges
- foreach my $span
qw(1hour 1day 1week 1month
){
+ foreach my $span
(qw(1hour 1day 1week 1month)
){
system("mkdir -p $IMG_DIR/" . dirname($bn));
my $img = "$IMG_DIR/${bn}-$span$IMG_SFX";
system("mkdir -p $IMG_DIR/" . dirname($bn));
my $img = "$IMG_DIR/${bn}-$span$IMG_SFX";
@@
-223,24
+229,28
@@
END
my $cleaned_img = $img; $cleaned_img =~ s/%/%25/g;
if (! $svg_p) {
print OUT <<END;
my $cleaned_img = $img; $cleaned_img =~ s/%/%25/g;
if (! $svg_p) {
print OUT <<END;
-<
P><IMG src="$cleaned_img" alt="${bn} $span"></P
>
+<
p class="graph"><img src="$cleaned_img" alt="${bn} $span" /></p
>
END
} else {
print OUT <<END;
END
} else {
print OUT <<END;
-<P><object data="$cleaned_img" type="image/svg+xml"
- width="670" height="179">
- ${bn} $span</object></P>
+<p class="graph"><object data="$cleaned_img" type="image/svg+xml">
+ ${bn} $span</object></p>
END
}
}
print OUT <<END;
END
}
}
print OUT <<END;
-<
A href="#top">[top]</A
>
+<
p><a href="#top">[top]</a></p
>
END
}
print OUT <<END;
END
}
print OUT <<END;
-</center>
+<hr />
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
+</p>
</body>
</html>
END
</body>
</html>
END