Fix counter turns and reboot

This commit is contained in:
garnier-quentin 2014-02-10 23:40:00 +01:00
parent 3cd433a4e9
commit ba694e62fc
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ sub run {
$self->{output}->exit();
}
# Reboot or counter goes back
if ($old_value > $value) {
$old_value = 0;
}
$value = $value - $old_value;
if (defined($self->{option_results}->{counter_per_seconds})) {
my $delta_time = $datas->{timestamp} - $old_timestamp;