Fixed wrong count when using threshold-overload option and memories are not equipped

This commit is contained in:
Lucie Dubrunfaut 2025-01-10 11:49:25 +01:00 committed by Evan-Adam
parent 295cb0d494
commit 2aecd211bf
2 changed files with 7 additions and 2 deletions

View File

@ -77,8 +77,10 @@ sub check {
);
next;
}
$self->{components}->{memory}->{total}++;
if($result->{cucsMemoryUnitPresence} eq "equipped") {
$self->{components}->{memory}->{total}++;
}
$exit = $self->get_severity(section => 'memory.operability', label => 'default.operability', value => $result2->{cucsMemoryUnitOperState});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {

View File

@ -89,6 +89,9 @@ Use this option to override the status returned by the plugin when the status la
Example: --threshold-overload='fan.operability,OK,poweredOff|removed'
--threshold-overload='presence,OK,missing'
--threshold-overload='operability,OK,removed'
NB: For the memory component you may need to set this option twice if presence status doesn't
return OK state and you want to override the operability status. Example when memories are missing because of removing.
--threshold-overload='presence,OK,missing' --threshold-overload='operability,OK,removed'
=back