Code

src/configfile.c: Warn if an unexpected block is found.
authorFlorian Forster <octo@noris.net>
Wed, 15 Jul 2009 08:09:48 +0000 (10:09 +0200)
committerFlorian Forster <octo@noris.net>
Wed, 15 Jul 2009 08:09:48 +0000 (10:09 +0200)
If the `snmp' plugin isn't loaded (but a configuration exists), no
warning is printed because there are only blocks in the SNMP
configuration..

src/configfile.c

index 0bb46e4004d679a504c51a699408774b70f81b07..4ebd620084e6efbb14ea63800433493d1d9ba7ca 100644 (file)
@@ -336,7 +336,15 @@ static int dispatch_block_plugin (oconfig_item_t *ci)
                if (ci->children[i].children == NULL)
                        dispatch_value_plugin (name, ci->children + i);
                else
-                       {DEBUG ("No nested config blocks allowed for this plugin.");}
+               {
+                       WARNING ("There is a `%s' block within the "
+                                       "configuration for the %s plugin. "
+                                       "The plugin either only expects "
+                                       "\"simple\" configuration statements "
+                                       "or wasn't loaded using `LoadPlugin'."
+                                       " Please check your configuration.",
+                                       ci->children[i].key, name);
+               }
        }
 
        return (0);