Subject: | minimal_heartbeat calculation in add_source function |
Dear all,
when adding a new data source (to an existing RRD archive) the heartbeat
value of this data source may be wrong. For further details please have
a look at the attachment (patch).
Thanks!
Regards,
Roland Abfalterer
Subject: | RRDSimple-addsource.patch |
--- Simple.pm 2006-01-16 00:20:20.000000000 +0100
+++ /usr/local/share/perl/5.8.3/RRD/Simple.pm 2006-01-19 17:31:12.000000000 +0100
@@ -304,13 +304,15 @@
my $rrdfileBackup = "$rrdfile.bak";
confess "$rrdfileBackup already exists; please investigate"
if -e $rrdfileBackup;
# Decide what heartbeat to use
- my $heartbeat = (sort { $info->{ds}->{$b}->{minimal_heartbeat} <=>
- $info->{ds}->{$b}->{minimal_heartbeat} }
- keys %{$info->{ds}})[0];
+ my $minhbds = (sort { $info->{ds}->{$a}->{minimal_heartbeat} <=>
+ $info->{ds}->{$b}->{minimal_heartbeat}}
+ keys %{$info->{ds}})[0];
+ my $heartbeat = $info->{ds}->{$minhbds}->{minimal_heartbeat};
+
TRACE("\$heartbeat = $heartbeat");
# Make a list of expected sources after the addition
my $TgtSources = join(',',sort(($self->sources($rrdfile),$ds)));