diff --git a/src/threshold.c b/src/threshold.c
index 8dcb711d5e6004bb82d266b8d9e950242681c50d..45ee3b4d02c61b722419577ee607580dcdb4cb26 100644 (file)
--- a/src/threshold.c
+++ b/src/threshold.c
return (0);
} /* }}} int ut_missing */
return (0);
} /* }}} int ut_missing */
-int ut_config (oconfig_item_t *ci)
+static int ut_config (oconfig_item_t *ci)
{ /* {{{ */
int i;
int status = 0;
{ /* {{{ */
int i;
int status = 0;
+ int old_size = c_avl_size (threshold_tree);
threshold_t th;
threshold_t th;
break;
}
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,
plugin_register_missing ("threshold", ut_missing,
/* user data = */ NULL);
plugin_register_write ("threshold", ut_check_threshold,