From 43b036939c5235aac40d584ea7006941403da825 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 1 Dec 2015 13:18:21 +0100 Subject: [PATCH] + fix cisco environment voltage threshold --- .../common/cisco/standard/snmp/mode/components/voltage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm index 33530f526..99647b622 100644 --- a/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm +++ b/centreon-plugins/centreon/common/cisco/standard/snmp/mode/components/voltage.pm @@ -77,8 +77,8 @@ sub check { my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'voltage', instance => $instance, value => $result->{ciscoEnvMonVoltageStatusValue}); if ($checked == 0) { my $warn_th = undef; - my $crit_th = (defined($result->{ciscoEnvMonVoltageThresholdLow}) ? sprintf("%.3f", $result->{ciscoEnvMonVoltageThresholdLow}) : 0) . ':' . - (defined($result->{ciscoEnvMonVoltageThresholdHigh}) ? sprintf("%.3f", $result->{ciscoEnvMonVoltageThresholdHigh}) : ''); + my $crit_th = ((defined($result->{ciscoEnvMonVoltageThresholdLow}) && $result->{ciscoEnvMonVoltageThresholdLow} =~ /\d/) ? sprintf("%.3f", $result->{ciscoEnvMonVoltageThresholdLow} / 1000) : 0) . ':' . + ((defined($result->{ciscoEnvMonVoltageThresholdHigh}) && $result->{ciscoEnvMonVoltageThresholdHigh} =~ /\d/) ? sprintf("%.3f", $result->{ciscoEnvMonVoltageThresholdHigh} / 1000) : ''); $self->{perfdata}->threshold_validate(label => 'warning-voltage-instance-' . $instance, value => $warn_th); $self->{perfdata}->threshold_validate(label => 'critical-voltage-instance-' . $instance, value => $crit_th); $warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-voltage-instance-' . $instance);