X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fthreshold.c;h=a5e50a22ffe5e9209049331155e6dc3f467014e9;hb=0657d95eaa686d64efe6bbccda346ebd6467bd0b;hp=8dcb711d5e6004bb82d266b8d9e950242681c50d;hpb=a09f2fdf0450eb76317e1b7575a12ffb926068f4;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,