From 2717420da0d07c0ac5c90975280de94a9f444d22 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 23 May 2017 11:21:06 +0200 Subject: [PATCH] + Fix #256 --- .../common/cisco/standard/snmp/mode/components/sensor.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm index 5190a05d4..26d33e60a 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/sensor.pm @@ -129,11 +129,11 @@ sub get_default_warning_threshold { my $value = $result->{entSensorThresholdValue} * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision}))); if ($result->{entSensorThresholdRelation} eq 'greaterOrEqual') { - $high_th = $value - 0.01; + $high_th = $value - (1 * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision})))); } elsif ($result->{entSensorThresholdRelation} eq 'greaterThan') { $high_th = $value; } elsif ($result->{entSensorThresholdRelation} eq 'lessOrEqual') { - $low_th = $value + 0.01; + $low_th = $value + (1 * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision})))); } elsif ($result->{entSensorThresholdRelation} eq 'lessThan') { $low_th = $value; } @@ -157,11 +157,11 @@ sub get_default_critical_threshold { my $value = $result->{entSensorThresholdValue} * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision}))); if ($result->{entSensorThresholdRelation} eq 'greaterOrEqual') { - $high_th = $value - 0.01; + $high_th = $value - (1 * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision})))); } elsif ($result->{entSensorThresholdRelation} eq 'greaterThan') { $high_th = $value; } elsif ($result->{entSensorThresholdRelation} eq 'lessOrEqual') { - $low_th = $value + 0.01; + $low_th = $value + (1 * (10 ** ($options{result}->{entSensorScale}) * (10 ** -($options{result}->{entSensorPrecision})))); } elsif ($result->{entSensorThresholdRelation} eq 'lessThan') { $low_th = $value; }