$UPSGRAPH::keep = ($UPSGRAPH::daysCovered*24*60*60)/$UPSGRAPH::step;
$UPSGRAPH::keepHours = ($UPSGRAPH::daysCovered*24*60*60)/$UPSGRAPH::stepsPerHour/$UPSGRAPH::step;
$UPSGRAPH::hosts = ();
+$UPSGRAPH::regenerateOnStart = 1; #when set, regenerate graphs on script startup
do $ARGV[0] or die "can't read config: $!";
#
#exit 0 if ($child != 0);
+my $first = $UPSGRAPH::regenerateOnStart;
while(1) {
open(HTML, ">${outdir}/index.html.new");
};
}
- my @graphdef = ('-P', "--lazy", "-t", $hostname." - ".$vars->{$var}->{'name'});
+ my @graphdef = ('-P', "-t", $hostname." - ".$vars->{$var}->{'name'});
+ push @graphdef, "--lazy" if !$first;
push @graphdef, "DEF:${var}-avg=${rrdfile}.${var}:${var}:AVERAGE";
push @graphdef, "DEF:${var}-min=${rrdfile}.${var}:${var}:MIN";
rename("${outdir}/index.html.new", "${outdir}/index.html");
sleep(${step}/2);
+ $first = 0;
}