From ba694e62fcc41cbbdd8d00ecd3c23ddae3f5a08d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 10 Feb 2014 23:40:00 +0100 Subject: [PATCH] Fix counter turns and reboot --- snmp_standard/mode/numericvalue.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snmp_standard/mode/numericvalue.pm b/snmp_standard/mode/numericvalue.pm index 335bd182f..acb6678f0 100644 --- a/snmp_standard/mode/numericvalue.pm +++ b/snmp_standard/mode/numericvalue.pm @@ -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;