END
foreach my $bn (@rrds){
- my $cleaned_bn = $bn; $cleaned_bn =~ s/%/_/g;
+ my $cleaned_bn = $bn;
+ $cleaned_bn =~ tr/%\//__/;
print OUT <$bn
+$bn
END
}
print OUT <
+
END
# graph interesting rrd
-foreach my $bn (@rrds){
+for (my $i = 0; $i < scalar(@rrds); ++$i) {
+ my $bn = $rrds[$i];
print "$bn\n";
- my $rrd = "$DIR/${bn}.rrd";
+ my $rrd = $list[$i];
my $cmd = "rrdtool info $rrd |grep 'ds\\[' |sed 's/^ds\\[//'"
." |sed 's/\\].*//' |sort |uniq";
my @dss = `$cmd`; chomp(@dss);
# all DEF
- my $i = 0;
+ my $j = 0;
my $defs = "";
foreach my $ds (@dss){
@@ -149,53 +190,67 @@ foreach my $bn (@rrds){
}
# all AREA
- $i = 0;
+ $j = 0;
foreach my $ds (@dss){
- my $color = $COLORS[$i % scalar(@COLORS)]; $i++;
+ my $color = $COLORS[$j % scalar(@COLORS)]; $j++;
my $faded_color = fade_color($color);
$defs .= sprintf(" AREA:${ds}_max#%06x ", $faded_color);
}
# all LINE
- $i = 0;
+ $j = 0;
foreach my $ds (@dss){
- my $color = $COLORS[$i % scalar(@COLORS)]; $i++;
+ my $color = $COLORS[$j % scalar(@COLORS)]; $j++;
$defs .= sprintf(" LINE2:${ds}_avg#%06x:$ds"
." GPRINT:${ds}_avg:AVERAGE:%%5.1lf%%sAvg"
." GPRINT:${ds}_max:MAX:%%5.1lf%%sMax"
, $color);
}
- my $cleaned_bn = $bn; $cleaned_bn =~ s/%/_/g;
+ my $cleaned_bn = $bn;
+ $cleaned_bn =~ tr/%\//__/;
print OUT <