diff --git a/network/checkpoint/mode/components/fan.pm b/network/checkpoint/mode/components/fan.pm index c809d1496..e6e09643a 100644 --- a/network/checkpoint/mode/components/fan.pm +++ b/network/checkpoint/mode/components/fan.pm @@ -70,6 +70,7 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_fanSpeedSensorEntry}, instance => $instance); next if ($self->check_exclude(section => 'fan', instance => $instance)); + next if ($result->{fanSpeedSensorName} !~ /^[0-9a-zA-Z ]$/); # sometimes there is some wrong values in hex $self->{components}->{fan}->{total}++; $self->{output}->output_add(long_msg => sprintf("Fan '%s' sensor out of range status is '%s'", @@ -80,8 +81,10 @@ sub check { short_msg => sprintf("Fan '%s' sensor out of range status is '%s'", $result->{fanSpeedSensorName}, $result->{fanSpeedSensorStatus})); } - $self->{output}->perfdata_add(label => $result->{fanSpeedSensorName}, unit => 'rpm', - value => sprintf("%d", $result->{fanSpeedSensorValue})); + if (defined($result->{fanSpeedSensorValue}) && $result->{fanSpeedSensorValue} =~ /^[0-9\.]+$/) { + $self->{output}->perfdata_add(label => $result->{fanSpeedSensorName}, unit => 'rpm', + value => sprintf("%d", $result->{fanSpeedSensorValue})); + } } } diff --git a/network/checkpoint/mode/components/temperature.pm b/network/checkpoint/mode/components/temperature.pm index c2a7a4deb..6efee51ff 100644 --- a/network/checkpoint/mode/components/temperature.pm +++ b/network/checkpoint/mode/components/temperature.pm @@ -70,18 +70,21 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_tempertureSensorEntry}, instance => $instance); next if ($self->check_exclude(section => 'temperature', instance => $instance)); + next if ($result->{tempertureSensorName} !~ /^[0-9a-zA-Z ]$/); # sometimes there is some wrong values in hex $self->{components}->{temperature}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Temperature '%s' sensor out of range status is '%s'", - $result->{tempertureSensorName}, $result->{tempertureSensorStatus})); + $self->{output}->output_add(long_msg => sprintf("Temperature '%s' sensor out of range status is '%s' [instance: %s]", + $result->{tempertureSensorName}, $result->{tempertureSensorStatus}, $instance)); my $exit = $self->get_severity(section => 'temperature', value => $result->{tempertureSensorStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Temperature '%s' sensor out of range status is '%s'", $result->{tempertureSensorName}, $result->{tempertureSensorStatus})); + short_msg => sprintf("Temperature '%s/%s' sensor out of range status is '%s'", $result->{tempertureSensorName}, $instance, $result->{tempertureSensorStatus})); } - $self->{output}->perfdata_add(label => $result->{tempertureSensorName} , unit => 'C', - value => sprintf("%.2f", $result->{tempertureSensorValue})); + if (defined($result->{tempertureSensorValue}) && $result->{tempertureSensorValue} =~ /^[0-9\.]+$/) { + $self->{output}->perfdata_add(label => 'temp_' . $result->{tempertureSensorName} . '_' . $instance , unit => 'C', + value => sprintf("%.2f", $result->{tempertureSensorValue})); + } } } diff --git a/network/checkpoint/mode/components/voltage.pm b/network/checkpoint/mode/components/voltage.pm index da656b008..c1edd376f 100644 --- a/network/checkpoint/mode/components/voltage.pm +++ b/network/checkpoint/mode/components/voltage.pm @@ -70,18 +70,21 @@ sub check { my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_voltageSensorEntry}, instance => $instance); next if ($self->check_exclude(section => 'voltage', instance => $instance)); + next if ($result->{voltageSensorName} !~ /^[0-9a-zA-Z ]$/); # sometimes there is some wrong values in hex $self->{components}->{voltage}->{total}++; - $self->{output}->output_add(long_msg => sprintf("Voltage '%s' sensor out of range status is '%s'", - $result->{voltageSensorName}, $result->{voltageSensorStatus})); + $self->{output}->output_add(long_msg => sprintf("Voltage '%s' sensor out of range status is '%s' [instance: %s]", + $result->{voltageSensorName}, $result->{voltageSensorStatus}, $instance)); my $exit = $self->get_severity(section => 'voltage', value => $result->{voltageSensorStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Voltage '%s' sensor out of range status is '%s'", $result->{voltageSensorName}, $result->{voltageSensorStatus})); + short_msg => sprintf("Voltage '%s/%s' sensor out of range status is '%s'", $result->{voltageSensorName}, $instance, $result->{voltageSensorStatus})); + } + + if (defined($result->{voltageSensorValue}) && $result->{voltageSensorValue} =~ /^[0-9\.]+$/) { + $self->{output}->perfdata_add(label => 'volt_' . $result->{voltageSensorName} . '_' . $instance, unit => 'V', + value => sprintf("%.2f", $result->{voltageSensorValue})); } - $self->{output}->perfdata_add(label => $result->{voltageSensorName} , unit => 'V', - value => sprintf("%.2f", $result->{voltageSensorValue})); - } }