Ent 6978 umbrales inversos fallan

This commit is contained in:
Daniel Maya 2021-05-17 13:00:59 +00:00 committed by Daniel Rodriguez
parent a6f41ede3d
commit fd372d53d1
1 changed files with 17 additions and 5 deletions

View File

@ -4652,11 +4652,17 @@ sub get_module_status ($$$) {
}
# (-inf, critical_min), [critical_max, +inf)
else {
return 1 if ($data < $critical_min || $data >= $critical_max);
return 1 if ($data <= $critical_max && $critical_max < $critical_min);
if ($critical_min == 0) {
return 1 if ($data > $critical_max);
}elsif ($critical_max == 0) {
return 1 if ($data <= $critical_min);
} else {
return 1 if ($data < $critical_min || $data >= $critical_max);
return 1 if ($data <= $critical_max && $critical_max < $critical_min);
}
}
}
# Warning
if ($warning_min ne $warning_max) {
# [warning_min, warning_max)
@ -4666,8 +4672,14 @@ sub get_module_status ($$$) {
}
# (-inf, warning_min), [warning_max, +inf)
else {
return 2 if ($data < $warning_min || $data >= $warning_max);
return 2 if ($data <= $warning_max && $warning_max < $warning_min);
if ($warning_min == 0) {
return 1 if ($data > $warning_max);
}elsif ($warning_max == 0) {
return 1 if ($data <= $warning_min);
} else {
return 2 if ($data < $warning_min || $data >= $warning_max);
return 2 if ($data <= $warning_max && $warning_max < $warning_min);
}
}
}
}