X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fthreshold.c;h=b753d37445166c4facfdd9facf2cabbf8e4fa1be;hb=4825cf6e51535f5c1550bc753bbc2f5161905543;hp=38c7efb016d73a1d62bd10bb3efb0e5670caf1e1;hpb=9b39918bdadabb12ec040f0f191c0d21cb6ddd53;p=collectd.git diff --git a/src/threshold.c b/src/threshold.c index 38c7efb0..b753d374 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,