Code

thresholds: Fix calculation of hysteresis
authorJan Kundrát <jan.kundrat@cesnet.cz>
Tue, 11 Mar 2014 10:00:22 +0000 (11:00 +0100)
committerJan Kundrát <jan.kundrat@cesnet.cz>
Tue, 11 Mar 2014 10:05:08 +0000 (11:05 +0100)
commit1a739fc3bfd9627784e35d793452cd2d0da4513d
tree0cde1944c0e7175c3dc849296f5066b05cc863e8
parent9ea1cc9352ecd3ea9644fa9e93a4f4cd11cd7350
thresholds: Fix calculation of hysteresis

The old code would never emit a notification when the value changed between the
WARNING and FAILURE; the reason was that each branch in the switch statement
only checked the "old" thresholds valid for the previously encountered state.
That is wrong and pretty dangerous, as there will be no notification when a
values progresses slowly from OK to WARN to FAIL.

Fixes #578.
src/threshold.c