Merge branch 'collectd-4.2'
[collectd.git] / src / configfile.c
index e6b8ce8..867338d 100644 (file)
@@ -27,6 +27,7 @@
 #include "common.h"
 #include "plugin.h"
 #include "configfile.h"
+#include "utils_threshold.h"
 
 #define ESCAPE_NULL(str) ((str) == NULL ? "(null)" : (str))
 
@@ -83,12 +84,13 @@ static int cf_value_map_num = STATIC_ARRAY_LEN (cf_value_map);
 
 static cf_global_option_t cf_global_options[] =
 {
-       {"BaseDir",   NULL, PKGLOCALSTATEDIR},
-       {"PIDFile",   NULL, PIDFILE},
-       {"Hostname",  NULL, NULL},
-       {"Interval",  NULL, "10"},
+       {"BaseDir",     NULL, PKGLOCALSTATEDIR},
+       {"PIDFile",     NULL, PIDFILE},
+       {"Hostname",    NULL, NULL},
+       {"FQDNLookup",  NULL, "false"},
+       {"Interval",    NULL, "10"},
        {"ReadThreads", NULL, "5"},
-       {"TypesDB",   NULL, PLUGINDIR"/types.db"} /* FIXME: Configure path */
+       {"TypesDB",     NULL, PLUGINDIR"/types.db"} /* FIXME: Configure path */
 };
 static int cf_global_options_num = STATIC_ARRAY_LEN (cf_global_options);
 
@@ -175,6 +177,13 @@ static int dispatch_global_option (const oconfig_item_t *ci)
                tmp[127] = '\0';
                return (global_option_set (ci->key, tmp));
        }
+       else if (ci->values[0].type == OCONFIG_TYPE_BOOLEAN)
+       {
+               if (ci->values[0].value.boolean)
+                       return (global_option_set (ci->key, "true"));
+               else
+                       return (global_option_set (ci->key, "false"));
+       }
 
        return (-1);
 } /* int dispatch_global_option */
@@ -300,6 +309,8 @@ static int dispatch_block (oconfig_item_t *ci)
 {
        if (strcasecmp (ci->key, "Plugin") == 0)
                return (dispatch_block_plugin (ci));
+       else if (strcasecmp (ci->key, "Threshold") == 0)
+               return (ut_config (ci));
 
        return (0);
 }