diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | lib/Smokeping/RRDtools.pm | 7 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,5 @@ +* Perl 5.8.0 compatibility fix ("missing max for DS uptime") + -- niko, reported by Steve Wickert and Kennedy Clark <hkclark *gmail.com> * RRDtool 1.2.x compatibility fix ("unknown RRD version: 0003" on restart) -- niko, reported by Sam Stickland <sam_ml *spacething.org> diff --git a/lib/Smokeping/RRDtools.pm b/lib/Smokeping/RRDtools.pm index ac70837..4a695d1 100644 --- a/lib/Smokeping/RRDtools.pm +++ b/lib/Smokeping/RRDtools.pm @@ -93,6 +93,7 @@ use RRDs; sub info2create { my $file = shift; my @create; + my $buggy_perl_version = 1 if $^V and $^V eq v5.8.0; my $info = RRDs::info($file); my $error = RRDs::error; die("RRDs::info $file: ERROR: $error") if $error; @@ -112,7 +113,8 @@ sub info2create { my @s = ("DS", $ds); for (qw(type minimal_heartbeat min max)) { die("$file: missing $_ for DS $ds?") - unless exists $info->{"ds[$ds].$_"}; + unless exists $info->{"ds[$ds].$_"} + or $buggy_perl_version; my $val = $info->{"ds[$ds].$_"}; push @s, defined $val ? $val : "U"; } @@ -122,7 +124,8 @@ sub info2create { my @s = ("RRA", $info->{"rra[$i].cf"}); for (qw(xff pdp_per_row rows)) { die("$file: missing $_ for RRA $i") - unless exists $info->{"rra[$i].$_"}; + unless exists $info->{"rra[$i].$_"} + or $buggy_perl_version; push @s, $info->{"rra[$i].$_"}; } push @create, join(":", @s); |