X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fthreshold.c;h=a5e50a22ffe5e9209049331155e6dc3f467014e9;hb=40e77dd34f9a8466165a8b7d724faeb337c90414;hp=8dcb711d5e6004bb82d266b8d9e950242681c50d;hpb=142fb2ea490118e62f34df41f907ef1e58fb0be4;p=collectd.git diff --git a/src/threshold.c b/src/threshold.c index 8dcb711d..a5e50a22 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -872,6 +872,7 @@ int ut_config (oconfig_item_t *ci) { /* {{{ */ int i; int status = 0; + int old_size = c_avl_size (threshold_tree); threshold_t th; @@ -915,7 +916,9 @@ int ut_config (oconfig_item_t *ci) break; } - if (c_avl_size (threshold_tree) > 0) { + /* register callbacks if this is the first time we see a valid config */ + if ((old_size == 0) && (c_avl_size (threshold_tree) > 0)) + { plugin_register_missing ("threshold", ut_missing, /* user data = */ NULL); plugin_register_write ("threshold", ut_check_threshold,