my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
0xffff77, 0x55aaff);
my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
0xffff77, 0x55aaff);
$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";
$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";
-<!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">
-foreach my $rrd (sort @list){
- my $bn = basename($rrd);
- $bn =~ s/\.rrd$//;
- push(@rrds, $bn);
+if ($RECURSIVE) {
+ @list = `find $DIR -type f -name '*.rrd'`;
+}
+else {
+ @list = `ls $DIR/*.rrd`;
+}
+chomp(@list);
+
+@list = sort @list;
+foreach my $rrd (@list){
+ $rrd =~ m/^$DIR\/(.*)\.rrd$/;
+ push(@rrds, $1);
my $cmd = "rrdtool info $rrd |grep 'ds\\[' |sed 's/^ds\\[//'"
." |sed 's/\\].*//' |sort |uniq";
my @dss = `$cmd`; chomp(@dss);
# all DEF
my $cmd = "rrdtool info $rrd |grep 'ds\\[' |sed 's/^ds\\[//'"
." |sed 's/\\].*//' |sort |uniq";
my @dss = `$cmd`; chomp(@dss);
# all DEF
my $faded_color = fade_color($color);
$defs .= sprintf(" AREA:${ds}_max#%06x ", $faded_color);
}
# all LINE
my $faded_color = fade_color($color);
$defs .= sprintf(" AREA:${ds}_max#%06x ", $faded_color);
}
# all LINE
$defs .= sprintf(" LINE2:${ds}_avg#%06x:$ds"
." GPRINT:${ds}_avg:AVERAGE:%%5.1lf%%sAvg"
." GPRINT:${ds}_max:MAX:%%5.1lf%%sMax"
, $color);
}
$defs .= sprintf(" LINE2:${ds}_avg#%06x:$ds"
." GPRINT:${ds}_avg:AVERAGE:%%5.1lf%%sAvg"
." GPRINT:${ds}_max:MAX:%%5.1lf%%sMax"
, $color);
}
-<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>