X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_riemann_threshold.c;h=9d8267dcafd184c611f3465c2c4c9dcf1b29f9a2;hb=711f5b6c86f51061c21bedcaa46214a01de0125c;hp=35f3814a5f26b8c4d64bf47867f658fce80ac05b;hpb=d544398864bc02dfd1623e6d005591b512e2f6c6;p=collectd.git diff --git a/src/write_riemann_threshold.c b/src/write_riemann_threshold.c index 35f3814a..9d8267dc 100644 --- a/src/write_riemann_threshold.c +++ b/src/write_riemann_threshold.c @@ -63,7 +63,7 @@ static int ut_check_one_data_source( if (ds != NULL) { ds_name = ds->ds[ds_index].name; if ((th->data_source[0] != 0) && (strcmp(ds_name, th->data_source) != 0)) - return STATE_OKAY; + return STATE_UNKNOWN; } if ((th->flags & UT_FLAG_INVERT) != 0) { @@ -73,8 +73,9 @@ static int ut_check_one_data_source( /* XXX: This is an experimental code, not optimized, not fast, not reliable, * and probably, do not work as you expect. Enjoy! :D */ - if ((th->hysteresis > 0) && - ((prev_state = uc_get_state(ds, vl)) != STATE_OKAY)) { + prev_state = uc_get_state(ds, vl); + if ((th->hysteresis > 0) && (prev_state != STATE_OKAY) && + (prev_state != STATE_UNKNOWN)) { switch (prev_state) { case STATE_ERROR: if ((!isnan(th->failure_min) &&