Correcting with return code from 2014 official Checkpoint Doc

This commit is contained in:
Simon BOMM 2014-10-03 16:05:28 +02:00
parent 49353d703e
commit f07aa3e415
3 changed files with 11 additions and 17 deletions

View File

@ -39,9 +39,7 @@ use strict;
use warnings;
my %map_status = (
1 => 'Out of range',
2 => 'OK',
3 => 'Error reading',
0 => 'OK',
);
sub check {
@ -73,8 +71,8 @@ sub check {
$instance, $map_status{$status}));
if ($status != 2) {
$self->{output}->output_add(severity => 'CRITICAL',
short_msg => sprintf("Fan '%s' status is %s",
$instance, $map_status{$status}));
short_msg => sprintf("Fan '%s' status is in an error state",
$instance));
}
$self->{output}->perfdata_add(label => $fan_name , unit => 'rpm', value => sprintf("%d", $result->{$oid_fanSpeedSensorValue . '.' . $instance})),

View File

@ -39,9 +39,7 @@ use strict;
use warnings;
my %map_status = (
1 => 'Out of range',
2 => 'OK',
3 => 'Error reading',
0 => 'OK',
);
sub check {
@ -70,10 +68,10 @@ sub check {
$self->{components}->{psus}->{total}++;
$self->{output}->output_add(long_msg => sprintf("Power Supply '%s' status is %s.",
$instance, $map_status{$status}));
if ($status != 2) {
if ($status != 0) {
$self->{output}->output_add(severity => 'CRITICAL',
short_msg => sprintf("Power Supply '%s' status is %s",
$instance, $map_status{$status}));
short_msg => sprintf("Power Supply '%s' status is in an error state",
$instance));
}
$self->{output}->perfdata_add(label => $psu_name , unit => 'V', value => sprintf("%d", $result->{$oid_voltageSensorValue . '.' . $instance})),

View File

@ -39,9 +39,7 @@ use strict;
use warnings;
my %map_status = (
1 => 'Out of range',
2 => 'OK',
3 => 'Error reading',
0 => 'OK',
);
sub check {
@ -72,10 +70,10 @@ sub check {
$self->{output}->output_add(long_msg => sprintf("Temperature '%s' status is %s.",
$instance, $map_status{$status}));
if ($status != 2) {
if ($status != 0) {
$self->{output}->output_add(severity => 'CRITICAL',
short_msg => sprintf("Temperature '%s' status is %s",
$instance, $map_status{$status}));
short_msg => sprintf("Temperature '%s' status is in an error state",
$instance));
}
$self->{output}->perfdata_add(label => $temperature_name , unit => 'C', value => sprintf("%.2f", $result->{$oid_tempertureSensorValue . '.' . $instance})),