summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 991b55b)
raw | patch | inline | side by side (parent: 991b55b)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 2 Apr 2010 08:58:01 +0000 (08:58 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 2 Apr 2010 08:58:01 +0000 (08:58 +0000) |
contrib/rrdjig/rrdjig.pl | patch | blob | history |
index 7c90f622f405327e52b861415becfc4ff998cf9b..8e56660ce2d90481f59a9cf962f091101ea1b97f 100755 (executable)
--- a/contrib/rrdjig/rrdjig.pl
+++ b/contrib/rrdjig/rrdjig.pl
die "RRD Error: $err\n";
}
}
+sub rrd_warn_check(){
+ my $err = RRDs::error();
+ if ($err){
+ warn "RRD Warning: $err\n";
+ }
+}
# how should the data be fetched from the source
# to provide the best approximation of the original data
return (\%data);
}
-sub reupdate($$$){
+sub reupdate($$$$){
my $step = shift;
+ my $min_time = shift;
my $dst = shift;
my $data = shift;
my @min;
$hide_cnt = 0;
# show the result;
my $row = "$t:".join(':',map {defined $_ ? $_ : 'U'} @out);
- print STDERR " ",$row,"\n" if $opt{verbose};
- push @up, $row;
+ print STDERR " ",$row,"\n" if $opt{verbose};
+ push @up, $row if $t > $min_time;
}
}
pop @up; # the last update is most likely one too many ...
if (@up == 0) {
warn "WARNING: src has no entries new enough to fill dst\n";
} else {
+ print STDERR ".";
RRDs::update($dst,
$opt{'dst-tmpl'} ? '--template='.$opt{'dst-tmpl'} : (),
@up);
- rrd_err_check();
+ rrd_warn_check();
}
}
my ($first,$fetch_tasks) = prep_fetch_tasks($src_info,$dst_info);
my $updates = fetch_data($src,$first,$fetch_tasks);
set_gauge($dst,$dst_info);
- reupdate($src_info->{step},$dst,$updates);
+ reupdate($src_info->{step},$dst_info->{last_update},$dst,$updates);
unset_gauge($dst,$dst_info);
}