Fix correspondance table and output refs #5168

This commit is contained in:
Simon Bomm 2014-10-24 09:32:00 +02:00
parent b87b369e01
commit a9fb4ee395
5 changed files with 49 additions and 17 deletions

View File

@ -82,18 +82,18 @@ sub check {
$self->{components}->{blade}->{total}++;
$self->{output}->output_add(long_msg => sprintf("blade '%s' state is '%s' [presence: %s].",
$blade_dn, ${$thresholds->{operability}->{$blade_operstate}}[0],
$blade_dn, ${$thresholds->{overall_status}->{$blade_operstate}}[0],
${$thresholds->{presence}->{$blade_presence}}[0]
));
$exit = $self->get_severity(section => 'blade', threshold => 'operability', value => $blade_operstate);
$exit = $self->get_severity(section => 'blade', threshold => 'overall_status', value => $blade_operstate);
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("blade '%s' state is '%s'.",
$blade_dn, ${$thresholds->{operability}->{$blade_operstate}}[0]
$blade_dn, ${$thresholds->{overall_status}->{$blade_operstate}}[0]
)
);
}
}
}
1;
1;

View File

@ -70,7 +70,7 @@ sub check {
$self->{components}->{chassis}->{total}++;
$self->{output}->output_add(long_msg => sprintf("chassis '%s' state is '%s'.",
$chassis_dn, ${$thresholds->{presence}->{$chassis_operstate}}[0]
$chassis_dn, ${$thresholds->{operability}->{$chassis_operstate}}[0]
));
my $exit = $self->get_severity(section => 'chassis', threshold => 'operability', value => $chassis_operstate);
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
@ -83,4 +83,4 @@ sub check {
}
}
1;
1;

View File

@ -82,18 +82,18 @@ sub check {
$self->{components}->{iocard}->{total}++;
$self->{output}->output_add(long_msg => sprintf("IO cards '%s' state is '%s' [presence: %s].",
$iocard_dn, ${$thresholds->{operability}->{$iocard_presence}}[0],
${$thresholds->{presence}->{$iocard_operstate}}[0]
$iocard_dn, ${$thresholds->{overall_status}->{$iocard_operstate}}[0],
${$thresholds->{presence}->{$iocard_presence}}[0]
));
$exit = $self->get_severity(section => 'iocard', threshold => 'operability', value => $iocard_operstate);
$exit = $self->get_severity(section => 'iocard', threshold => 'overall_status', value => $iocard_operstate);
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("IO cards '%s' state is '%s'.",
$iocard_dn, ${$thresholds->{operability}->{$iocard_operstate}}[0]
$iocard_dn, ${$thresholds->{overall_status}->{$iocard_operstate}}[0]
)
);
}
}
}
1;
1;

View File

@ -82,18 +82,18 @@ sub check {
$self->{components}->{psu}->{total}++;
$self->{output}->output_add(long_msg => sprintf("power supply '%s' state is '%s' [presence: %s].",
$psu_dn, ${$thresholds->{operability}->{$psu_presence}}[0],
${$thresholds->{presence}->{$psu_operstate}}[0]
$psu_dn, ${$thresholds->{overall_status}->{$psu_operstate}}[0],
${$thresholds->{presence}->{$psu_presence}}[0]
));
$exit = $self->get_severity(section => 'psu', threshold => 'operability', value => $psu_operstate);
$exit = $self->get_severity(section => 'psu', threshold => 'overall_status', value => $psu_operstate);
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("power supply '%s' state is '%s'.",
$psu_dn, ${$thresholds->{operability}->{$psu_operstate}}[0]
$psu_dn, ${$thresholds->{overall_status}->{$psu_operstate}}[0]
)
);
}
}
}
1;
1;

View File

@ -87,6 +87,38 @@ $thresholds = {
106 => ['peerCommProblem', 'WARNING'],
107 => ['autoUpgrade', 'OK'],
},
overall_status => {
0 => ['indeterminate', 'UNKNOWN'],
1 => ['unassociated', 'OK'],
10 => ['ok', 'OK'],
11 => ['discovery', 'OK'],
12 => ['config', 'OK'],
13 => ['unconfig', 'OK'],
14 => ['power-off', 'WARNING'],
15 => ['restart', 'WARNING'],
20 => ['maintenance', 'OK'],
21 => ['test', 'OK'],
29 => ['compute-mismatch', 'WARNING'],
30 => ['compute-failed', 'WARNING'],
31 => ['degraded', 'WARNING'],
32 => ['discovery-failed', 'WARNING'],
33 => ['config-failure', 'WARNING'],
34 => ['unconfig-failed', 'WARNING'],
35 => ['test-failed', 'WARNING'],
36 => ['maintenance-failed', 'WARNING'],
40 => ['removed', 'WARNING'],
41 => ['disabled', 'OK'],
50 => ['inaccessible', 'WARNING'],
60 => ['thermal-problem', 'CRITICAL'],
61 => ['power-problem', 'CRITICAL'],
62 => ['voltage-problem', 'CRITICAL'],
63 => ['inoperable', 'CRITICAL'],
101 => ['decommissioning', 'WARNING'],
201 => ['bios-restore', 'WARNING'],
202 => ['cmos-reset', 'WARNING'],
203 => ['diagnostics', 'OK'],
204 => ['diagnostic-failed', 'WARNING'],
},
};
1;
1;