X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fconfigfile.c;fp=src%2Fconfigfile.c;h=876ee23ee71c8c33d2f230170bf94147a6012404;hb=1c65936918f096a0730a4130a363393febcf163b;hp=e680aba771bf13b3b0bf76582f0019e1a78779f2;hpb=218dbd08e050c52bef00abd67b8a8296cbdabae9;p=collectd.git diff --git a/src/configfile.c b/src/configfile.c index e680aba7..876ee23e 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -110,6 +110,7 @@ static cf_global_option_t cf_global_options[] = {"ReadThreads", NULL, "5"}, {"WriteThreads", NULL, "5"}, {"Timeout", NULL, "2"}, + {"AutoLoadPlugin", NULL, "false"}, {"PreCacheChain", NULL, "PreCache"}, {"PostCacheChain", NULL, "PostCache"} }; @@ -379,6 +380,19 @@ static int dispatch_block_plugin (oconfig_item_t *ci) name = ci->values[0].value.string; + if (IS_TRUE (global_option_get ("AutoLoadPlugin"))) + { + int status; + + status = plugin_load (name, /* flags = */ 0); + if (status != 0) + { + ERROR ("Automatically loading plugin \"%s\" failed " + "with status %i.", name, status); + return (status); + } + } + /* Check for a complex callback first */ for (cb = complex_callback_head; cb != NULL; cb = cb->next) {