]> arthur.barton.de Git - netdata.git/commitdiff
appconfig now supports different multiple configurations - added support for stream...
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Wed, 22 Feb 2017 00:07:25 +0000 (02:07 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Wed, 22 Feb 2017 00:07:25 +0000 (02:07 +0200)
18 files changed:
src/appconfig.c
src/appconfig.h
src/freebsd_sysctl.c
src/macos_sysctl.c
src/main.c
src/plugin_proc_diskspace.c
src/plugin_tc.c
src/proc_diskstats.c
src/proc_meminfo.c
src/proc_net_dev.c
src/proc_net_netstat.c
src/proc_net_snmp6.c
src/proc_net_stat_synproxy.c
src/proc_vmstat.c
src/sys_devices_system_edac_mc.c
src/sys_devices_system_node.c
src/sys_fs_cgroup.c
src/web_client.c

index 81ab01be2cda7016ad6ffcbe7a9465dec723b42a..bc7ba2b2cdf85357a9e821594e569a3910d92e9e 100644 (file)
@@ -2,8 +2,6 @@
 
 #define CONFIG_FILE_LINE_MAX ((CONFIG_MAX_NAME + CONFIG_MAX_VALUE + 1024) * 2)
 
-pthread_mutex_t config_mutex = PTHREAD_MUTEX_INITIALIZER;
-
 // ----------------------------------------------------------------------------
 // definitions
 
@@ -12,7 +10,7 @@ pthread_mutex_t config_mutex = PTHREAD_MUTEX_INITIALIZER;
 #define CONFIG_VALUE_CHANGED 0x04 // has been changed from the loaded value
 #define CONFIG_VALUE_CHECKED 0x08 // has been checked if the value is different from the default
 
-struct config_value {
+struct config_option {
     avl avl;                // the index - this has to be first!
 
     uint8_t flags;
@@ -22,10 +20,10 @@ struct config_value {
     char *name;
     char *value;
 
-    struct config_value *next; // config->mutex protects just this
+    struct config_option *next; // config->mutex protects just this
 };
 
-struct config {
+struct section {
     avl avl;
 
     uint32_t hash;          // a simple hash to speed up searching
@@ -33,32 +31,51 @@ struct config {
 
     char *name;
 
-    struct config *next;    // gloabl config_mutex protects just this
+    struct section *next;    // gloabl config_mutex protects just this
 
-    struct config_value *values;
+    struct config_option *values;
     avl_tree_lock values_index;
 
     pthread_mutex_t mutex;  // this locks only the writers, to ensure atomic updates
                             // readers are protected using the rwlock in avl_tree_lock
-} *config_root = NULL;
+};
+
+static int appconfig_section_compare(void *a, void *b);
 
+struct config netdata_config = {
+        .sections = NULL,
+        .mutex = PTHREAD_MUTEX_INITIALIZER,
+        .index = {
+            { NULL, appconfig_section_compare },
+            AVL_LOCK_INITIALIZER
+        }
+};
+
+struct config stream_config = {
+        .sections = NULL,
+        .mutex = PTHREAD_MUTEX_INITIALIZER,
+        .index = {
+                { NULL, appconfig_section_compare },
+                AVL_LOCK_INITIALIZER
+        }
+};
 
 // ----------------------------------------------------------------------------
 // locking
 
-static inline void config_global_write_lock(void) {
-    pthread_mutex_lock(&config_mutex);
+static inline void appconfig_wrlock(struct config *root) {
+    pthread_mutex_lock(&root->mutex);
 }
 
-static inline void config_global_unlock(void) {
-    pthread_mutex_unlock(&config_mutex);
+static inline void appconfig_unlock(struct config *root) {
+    pthread_mutex_unlock(&root->mutex);
 }
 
-static inline void config_section_write_lock(struct config *co) {
+static inline void config_section_wrlock(struct section *co) {
     pthread_mutex_lock(&co->mutex);
 }
 
-static inline void config_section_unlock(struct config *co) {
+static inline void config_section_unlock(struct section *co) {
     pthread_mutex_unlock(&co->mutex);
 }
 
@@ -66,78 +83,72 @@ static inline void config_section_unlock(struct config *co) {
 // ----------------------------------------------------------------------------
 // config name-value index
 
-static int config_value_compare(void* a, void* b) {
-    if(((struct config_value *)a)->hash < ((struct config_value *)b)->hash) return -1;
-    else if(((struct config_value *)a)->hash > ((struct config_value *)b)->hash) return 1;
-    else return strcmp(((struct config_value *)a)->name, ((struct config_value *)b)->name);
+static int appconfig_option_compare(void *a, void *b) {
+    if(((struct config_option *)a)->hash < ((struct config_option *)b)->hash) return -1;
+    else if(((struct config_option *)a)->hash > ((struct config_option *)b)->hash) return 1;
+    else return strcmp(((struct config_option *)a)->name, ((struct config_option *)b)->name);
 }
 
-#define config_value_index_add(co, cv) (struct config_value *)avl_insert_lock(&((co)->values_index), (avl *)(cv))
-#define config_value_index_del(co, cv) (struct config_value *)avl_remove_lock(&((co)->values_index), (avl *)(cv))
+#define appconfig_option_index_add(co, cv) (struct config_option *)avl_insert_lock(&((co)->values_index), (avl *)(cv))
+#define appconfig_option_index_del(co, cv) (struct config_option *)avl_remove_lock(&((co)->values_index), (avl *)(cv))
 
-static struct config_value *config_value_index_find(struct config *co, const char *name, uint32_t hash) {
-    struct config_value tmp;
+static struct config_option *appconfig_option_index_find(struct section *co, const char *name, uint32_t hash) {
+    struct config_option tmp;
     tmp.hash = (hash)?hash:simple_hash(name);
     tmp.name = (char *)name;
 
-    return (struct config_value *)avl_search_lock(&(co->values_index), (avl *) &tmp);
+    return (struct config_option *)avl_search_lock(&(co->values_index), (avl *) &tmp);
 }
 
 
 // ----------------------------------------------------------------------------
 // config sections index
 
-static int config_compare(void* a, void* b) {
-    if(((struct config *)a)->hash < ((struct config *)b)->hash) return -1;
-    else if(((struct config *)a)->hash > ((struct config *)b)->hash) return 1;
-    else return strcmp(((struct config *)a)->name, ((struct config *)b)->name);
+static int appconfig_section_compare(void *a, void *b) {
+    if(((struct section *)a)->hash < ((struct section *)b)->hash) return -1;
+    else if(((struct section *)a)->hash > ((struct section *)b)->hash) return 1;
+    else return strcmp(((struct section *)a)->name, ((struct section *)b)->name);
 }
 
-avl_tree_lock config_root_index = {
-        { NULL, config_compare },
-        AVL_LOCK_INITIALIZER
-};
+#define appconfig_index_add(root, cfg) (struct section *)avl_insert_lock(&root->index, (avl *)(cfg))
+#define appconfig_index_del(root, cfg) (struct section *)avl_remove_lock(&root->index, (avl *)(cfg))
 
-#define config_index_add(cfg) (struct config *)avl_insert_lock(&config_root_index, (avl *)(cfg))
-#define config_index_del(cfg) (struct config *)avl_remove_lock(&config_root_index, (avl *)(cfg))
-
-static struct config *config_index_find(const char *name, uint32_t hash) {
-    struct config tmp;
+static struct section *appconfig_index_find(struct config *root, const char *name, uint32_t hash) {
+    struct section tmp;
     tmp.hash = (hash)?hash:simple_hash(name);
     tmp.name = (char *)name;
 
-    return (struct config *)avl_search_lock(&config_root_index, (avl *) &tmp);
+    return (struct section *)avl_search_lock(&root->index, (avl *) &tmp);
 }
 
 
 // ----------------------------------------------------------------------------
 // config section methods
 
-static inline struct config *config_section_find(const char *section) {
-    return config_index_find(section, 0);
+static inline struct section *appconfig_section_find(struct config *root, const char *section) {
+    return appconfig_index_find(root, section, 0);
 }
 
-static inline struct config *config_section_create(const char *section)
-{
+static inline struct section *appconfig_section_create(struct config *root, const char *section) {
     debug(D_CONFIG, "Creating section '%s'.", section);
 
-    struct config *co = callocz(1, sizeof(struct config));
+    struct section *co = callocz(1, sizeof(struct section));
     co->name = strdupz(section);
     co->hash = simple_hash(co->name);
 
-    avl_init_lock(&co->values_index, config_value_compare);
+    avl_init_lock(&co->values_index, appconfig_option_compare);
 
-    if(unlikely(config_index_add(co) != co))
+    if(unlikely(appconfig_index_add(root, co) != co))
         error("INTERNAL ERROR: indexing of section '%s', already exists.", co->name);
 
-    config_global_write_lock();
-    struct config *co2 = config_root;
+    appconfig_wrlock(root);
+    struct section *co2 = root->sections;
     if(co2) {
         while (co2->next) co2 = co2->next;
         co2->next = co;
     }
-    else config_root = co;
-    config_global_unlock();
+    else root->sections = co;
+    appconfig_unlock(root);
 
     return co;
 }
@@ -146,20 +157,20 @@ static inline struct config *config_section_create(const char *section)
 // ----------------------------------------------------------------------------
 // config name-value methods
 
-static inline struct config_value *config_value_create(struct config *co, const char *name, const char *value)
+static inline struct config_option *appconfig_value_create(struct section *co, const char *name, const char *value)
 {
     debug(D_CONFIG, "Creating config entry for name '%s', value '%s', in section '%s'.", name, value, co->name);
 
-    struct config_value *cv = callocz(1, sizeof(struct config_value));
+    struct config_option *cv = callocz(1, sizeof(struct config_option));
     cv->name = strdupz(name);
     cv->hash = simple_hash(cv->name);
     cv->value = strdupz(value);
 
-    if(unlikely(config_value_index_add(co, cv) != cv))
+    if(unlikely(appconfig_option_index_add(co, cv) != cv))
         error("INTERNAL ERROR: indexing of config '%s' in section '%s': already exists.", cv->name, co->name);
 
-    config_section_write_lock(co);
-    struct config_value *cv2 = co->values;
+    config_section_wrlock(co);
+    struct config_option *cv2 = co->values;
     if(cv2) {
         while (cv2->next) cv2 = cv2->next;
         cv2->next = cv;
@@ -170,43 +181,43 @@ static inline struct config_value *config_value_create(struct config *co, const
     return cv;
 }
 
-int config_exists(const char *section, const char *name) {
-    struct config_value *cv;
+int appconfig_exists(struct config *root, const char *section, const char *name) {
+    struct config_option *cv;
 
     debug(D_CONFIG, "request to get config in section '%s', name '%s'", section, name);
 
-    struct config *co = config_section_find(section);
+    struct section *co = appconfig_section_find(root, section);
     if(!co) return 0;
 
-    cv = config_value_index_find(co, name, 0);
+    cv = appconfig_option_index_find(co, name, 0);
     if(!cv) return 0;
 
     return 1;
 }
 
-int config_rename(const char *section, const char *old, const char *new) {
-    struct config_value *cv, *cv2;
+int appconfig_rename(struct config *root, const char *section, const char *old, const char *new) {
+    struct config_option *cv, *cv2;
 
     debug(D_CONFIG, "request to rename config in section '%s', old name '%s', new name '%s'", section, old, new);
 
-    struct config *co = config_section_find(section);
+    struct section *co = appconfig_section_find(root, section);
     if(!co) return -1;
 
-    config_section_write_lock(co);
+    config_section_wrlock(co);
 
-    cv = config_value_index_find(co, old, 0);
+    cv = appconfig_option_index_find(co, old, 0);
     if(!cv) goto cleanup;
 
-    cv2 = config_value_index_find(co, new, 0);
+    cv2 = appconfig_option_index_find(co, new, 0);
     if(cv2) goto cleanup;
 
-    if(unlikely(config_value_index_del(co, cv) != cv))
+    if(unlikely(appconfig_option_index_del(co, cv) != cv))
         error("INTERNAL ERROR: deletion of config '%s' from section '%s', deleted tge wrong config entry.", cv->name, co->name);
 
     freez(cv->name);
     cv->name = strdupz(new);
     cv->hash = simple_hash(cv->name);
-    if(unlikely(config_value_index_add(co, cv) != cv))
+    if(unlikely(appconfig_option_index_add(co, cv) != cv))
         error("INTERNAL ERROR: indexing of config '%s' in section '%s', already exists.", cv->name, co->name);
 
     config_section_unlock(co);
@@ -218,18 +229,18 @@ cleanup:
     return -1;
 }
 
-char *config_get(const char *section, const char *name, const char *default_value)
+char *appconfig_get(struct config *root, const char *section, const char *name, const char *default_value)
 {
-    struct config_value *cv;
+    struct config_option *cv;
 
     debug(D_CONFIG, "request to get config in section '%s', name '%s', default_value '%s'", section, name, default_value);
 
-    struct config *co = config_section_find(section);
-    if(!co) co = config_section_create(section);
+    struct section *co = appconfig_section_find(root, section);
+    if(!co) co = appconfig_section_create(root, section);
 
-    cv = config_value_index_find(co, name, 0);
+    cv = appconfig_option_index_find(co, name, 0);
     if(!cv) {
-        cv = config_value_create(co, name, default_value);
+        cv = appconfig_value_create(co, name, default_value);
         if(!cv) return NULL;
     }
     cv->flags |= CONFIG_VALUE_USED;
@@ -246,67 +257,67 @@ char *config_get(const char *section, const char *name, const char *default_valu
     return(cv->value);
 }
 
-long long config_get_number(const char *section, const char *name, long long value)
+long long appconfig_get_number(struct config *root, const char *section, const char *name, long long value)
 {
     char buffer[100], *s;
     sprintf(buffer, "%lld", value);
 
-    s = config_get(section, name, buffer);
+    s = appconfig_get(root, section, name, buffer);
     if(!s) return value;
 
     return strtoll(s, NULL, 0);
 }
 
-int config_get_boolean(const char *section, const char *name, int value)
+int appconfig_get_boolean(struct config *root, const char *section, const char *name, int value)
 {
     char *s;
     if(value) s = "yes";
     else s = "no";
 
-    s = config_get(section, name, s);
+    s = appconfig_get(root, section, name, s);
     if(!s) return value;
 
     if(!strcmp(s, "yes") || !strcmp(s, "auto") || !strcmp(s, "on demand")) return 1;
     return 0;
 }
 
-int config_get_boolean_ondemand(const char *section, const char *name, int value)
+int appconfig_get_boolean_ondemand(struct config *root, const char *section, const char *name, int value)
 {
     char *s;
 
-    if(value == CONFIG_ONDEMAND_ONDEMAND)
+    if(value == CONFIG_BOOLEAN_AUTO)
         s = "auto";
 
-    else if(value == CONFIG_ONDEMAND_NO)
+    else if(value == CONFIG_BOOLEAN_NO)
         s = "no";
 
     else
         s = "yes";
 
-    s = config_get(section, name, s);
+    s = appconfig_get(root, section, name, s);
     if(!s) return value;
 
     if(!strcmp(s, "yes"))
-        return CONFIG_ONDEMAND_YES;
+        return CONFIG_BOOLEAN_YES;
     else if(!strcmp(s, "no"))
-        return CONFIG_ONDEMAND_NO;
+        return CONFIG_BOOLEAN_NO;
     else if(!strcmp(s, "auto") || !strcmp(s, "on demand"))
-        return CONFIG_ONDEMAND_ONDEMAND;
+        return CONFIG_BOOLEAN_AUTO;
 
     return value;
 }
 
-const char *config_set_default(const char *section, const char *name, const char *value)
+const char *appconfig_set_default(struct config *root, const char *section, const char *name, const char *value)
 {
-    struct config_value *cv;
+    struct config_option *cv;
 
     debug(D_CONFIG, "request to set config in section '%s', name '%s', value '%s'", section, name, value);
 
-    struct config *co = config_section_find(section);
-    if(!co) return config_set(section, name, value);
+    struct section *co = appconfig_section_find(root, section);
+    if(!co) return appconfig_set(root, section, name, value);
 
-    cv = config_value_index_find(co, name, 0);
-    if(!cv) return config_set(section, name, value);
+    cv = appconfig_option_index_find(co, name, 0);
+    if(!cv) return appconfig_set(root, section, name, value);
 
     cv->flags |= CONFIG_VALUE_USED;
 
@@ -323,17 +334,17 @@ const char *config_set_default(const char *section, const char *name, const char
     return cv->value;
 }
 
-const char *config_set(const char *section, const char *name, const char *value)
+const char *appconfig_set(struct config *root, const char *section, const char *name, const char *value)
 {
-    struct config_value *cv;
+    struct config_option *cv;
 
     debug(D_CONFIG, "request to set config in section '%s', name '%s', value '%s'", section, name, value);
 
-    struct config *co = config_section_find(section);
-    if(!co) co = config_section_create(section);
+    struct section *co = appconfig_section_find(root, section);
+    if(!co) co = appconfig_section_create(root, section);
 
-    cv = config_value_index_find(co, name, 0);
-    if(!cv) cv = config_value_create(co, name, value);
+    cv = appconfig_option_index_find(co, name, 0);
+    if(!cv) cv = appconfig_value_create(co, name, value);
     cv->flags |= CONFIG_VALUE_USED;
 
     if(strcmp(cv->value, value) != 0) {
@@ -346,23 +357,23 @@ const char *config_set(const char *section, const char *name, const char *value)
     return value;
 }
 
-long long config_set_number(const char *section, const char *name, long long value)
+long long appconfig_set_number(struct config *root, const char *section, const char *name, long long value)
 {
     char buffer[100];
     sprintf(buffer, "%lld", value);
 
-    config_set(section, name, buffer);
+    appconfig_set(root, section, name, buffer);
 
     return value;
 }
 
-int config_set_boolean(const char *section, const char *name, int value)
+int appconfig_set_boolean(struct config *root, const char *section, const char *name, int value)
 {
     char *s;
     if(value) s = "yes";
     else s = "no";
 
-    config_set(section, name, s);
+    appconfig_set(root, section, name, s);
 
     return value;
 }
@@ -371,10 +382,10 @@ int config_set_boolean(const char *section, const char *name, int value)
 // ----------------------------------------------------------------------------
 // config load/save
 
-int load_config(char *filename, int overwrite_used)
+int appconfig_load(struct config *root, char *filename, int overwrite_used)
 {
     int line = 0;
-    struct config *co = NULL;
+    struct section *co = NULL;
 
     char buffer[CONFIG_FILE_LINE_MAX + 1], *s;
 
@@ -404,8 +415,8 @@ int load_config(char *filename, int overwrite_used)
             s[len - 1] = '\0';
             s++;
 
-            co = config_section_find(s);
-            if(!co) co = config_section_create(s);
+            co = appconfig_section_find(root, s);
+            if(!co) co = appconfig_section_create(root, s);
 
             continue;
         }
@@ -437,9 +448,9 @@ int load_config(char *filename, int overwrite_used)
             continue;
         }
 
-        struct config_value *cv = config_value_index_find(co, name, 0);
+        struct config_option *cv = appconfig_option_index_find(co, name, 0);
 
-        if(!cv) cv = config_value_create(co, name, value);
+        if(!cv) cv = appconfig_value_create(co, name, value);
         else {
             if(((cv->flags & CONFIG_VALUE_USED) && overwrite_used) || !(cv->flags & CONFIG_VALUE_USED)) {
                 debug(D_CONFIG, "Line %d, overwriting '%s/%s'.", line, co->name, cv->name);
@@ -457,11 +468,11 @@ int load_config(char *filename, int overwrite_used)
     return 1;
 }
 
-void generate_config(BUFFER *wb, int only_changed)
+void appconfig_generate(struct config *root, BUFFER *wb, int only_changed)
 {
     int i, pri;
-    struct config *co;
-    struct config_value *cv;
+    struct section *co;
+    struct config_option *cv;
 
     for(i = 0; i < 3 ;i++) {
         switch(i) {
@@ -490,8 +501,8 @@ void generate_config(BUFFER *wb, int only_changed)
                 break;
         }
 
-        config_global_write_lock();
-        for(co = config_root; co ; co = co->next) {
+        appconfig_wrlock(root);
+        for(co = root->sections; co ; co = co->next) {
             if(!strcmp(co->name, "global") ||
                     !strcmp(co->name, "plugins")  ||
                     !strcmp(co->name, "registry") ||
@@ -506,7 +517,7 @@ void generate_config(BUFFER *wb, int only_changed)
                 int changed = 0;
                 int count = 0;
 
-                config_section_write_lock(co);
+                config_section_wrlock(co);
                 for(cv = co->values; cv ; cv = cv->next) {
                     used += (cv->flags & CONFIG_VALUE_USED)?1:0;
                     changed += (cv->flags & CONFIG_VALUE_CHANGED)?1:0;
@@ -523,7 +534,7 @@ void generate_config(BUFFER *wb, int only_changed)
 
                 buffer_sprintf(wb, "\n[%s]\n", co->name);
 
-                config_section_write_lock(co);
+                config_section_wrlock(co);
                 for(cv = co->values; cv ; cv = cv->next) {
 
                     if(used && !(cv->flags & CONFIG_VALUE_USED)) {
@@ -534,6 +545,6 @@ void generate_config(BUFFER *wb, int only_changed)
                 config_section_unlock(co);
             }
         }
-        config_global_unlock();
+        appconfig_unlock(root);
     }
 }
index 08aae8348891c08fda9298a9a68046b50a59b973..051736dd8f98a5f4ccf966044cdd9b395a95fb6f 100644 (file)
@@ -8,25 +8,54 @@
 #define CONFIG_MAX_NAME 1024
 #define CONFIG_MAX_VALUE 2048
 
-extern int load_config(char *filename, int overwrite_used);
+struct config {
+    struct section *sections;
+    pthread_mutex_t mutex;
+    avl_tree_lock index;
+};
 
-extern char *config_get(const char *section, const char *name, const char *default_value);
-extern long long config_get_number(const char *section, const char *name, long long value);
-extern int config_get_boolean(const char *section, const char *name, int value);
+extern struct config
+        netdata_config,
+        stream_config;
 
-#define CONFIG_ONDEMAND_NO 0
-#define CONFIG_ONDEMAND_YES 1
-#define CONFIG_ONDEMAND_ONDEMAND 2
-extern int config_get_boolean_ondemand(const char *section, const char *name, int value);
+#define CONFIG_BOOLEAN_NO   0
+#define CONFIG_BOOLEAN_YES  1
+#define CONFIG_BOOLEAN_AUTO 2
 
-extern const char *config_set(const char *section, const char *name, const char *value);
-extern const char *config_set_default(const char *section, const char *name, const char *value);
-extern long long config_set_number(const char *section, const char *name, long long value);
-extern int config_set_boolean(const char *section, const char *name, int value);
+extern int appconfig_load(struct config *root, char *filename, int overwrite_used);
 
-extern int config_exists(const char *section, const char *name);
-extern int config_rename(const char *section, const char *old, const char *new);
+extern char *appconfig_get(struct config *root, const char *section, const char *name, const char *default_value);
+extern long long appconfig_get_number(struct config *root, const char *section, const char *name, long long value);
+extern int appconfig_get_boolean(struct config *root, const char *section, const char *name, int value);
+extern int appconfig_get_boolean_ondemand(struct config *root, const char *section, const char *name, int value);
 
-extern void generate_config(BUFFER *wb, int only_changed);
+extern const char *appconfig_set(struct config *root, const char *section, const char *name, const char *value);
+extern const char *appconfig_set_default(struct config *root, const char *section, const char *name, const char *value);
+extern long long appconfig_set_number(struct config *root, const char *section, const char *name, long long value);
+extern int appconfig_set_boolean(struct config *root, const char *section, const char *name, int value);
+
+extern int appconfig_exists(struct config *root, const char *section, const char *name);
+extern int appconfig_rename(struct config *root, const char *section, const char *old, const char *new);
+
+extern void appconfig_generate(struct config *root, BUFFER *wb, int only_changed);
+
+// ----------------------------------------------------------------------------
+// shortcuts for the default netdata configuration
+
+#define config_load(filename, overwrite_used) appconfig_load(&netdata_config, filename, overwrite_used)
+#define config_get(section, name, default_value) appconfig_get(&netdata_config, section, name, default_value)
+#define config_get_number(section, name, value) appconfig_get_number(&netdata_config, section, name, value)
+#define config_get_boolean(section, name, value) appconfig_get_boolean(&netdata_config, section, name, value)
+#define config_get_boolean_ondemand(section, name, value) appconfig_get_boolean_ondemand(&netdata_config, section, name, value)
+
+#define config_set(section, name, default_value) appconfig_get(&netdata_config, section, name, default_value)
+#define config_set_default(section, name, value) appconfig_set_default(&netdata_config, section, name, value)
+#define config_set_number(section, name, value) appconfig_set_number(&netdata_config, section, name, value)
+#define config_set_boolean(section, name, value) appconfig_set_boolean(&netdata_config, section, name, value)
+
+#define config_exists(section, name) appconfig_exists(&netdata_config, section, name)
+#define config_rename(section, old, new) appconfig_rename(&netdata_config, section, old, new)
+
+#define config_generate(buffer, only_changed) appconfig_generate(&netdata_config, buffer, only_changed)
 
 #endif /* NETDATA_CONFIG_H */
index 8a864236a1580b85c8c5b4eaf5f7cfdd863d7618..83c3003c32fe1ed0009b2c91e65d543c057f4473 100644 (file)
@@ -93,10 +93,10 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
         do_tcp_packets          = config_get_boolean("plugin:freebsd:sysctl", "ipv4 TCP packets", 1);
         do_tcp_errors           = config_get_boolean("plugin:freebsd:sysctl", "ipv4 TCP errors", 1);
         do_tcp_handshake        = config_get_boolean("plugin:freebsd:sysctl", "ipv4 TCP handshake issues", 1);
-        do_ecn                  = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ECN packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_syscookies    = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP SYN cookies", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_ofo           = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP out-of-order queue", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_connaborts    = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP connection aborts", CONFIG_ONDEMAND_ONDEMAND);
+        do_ecn                  = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ECN packets", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_syscookies    = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP SYN cookies", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_ofo           = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP out-of-order queue", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_connaborts    = config_get_boolean_ondemand("plugin:freebsd:sysctl", "TCP connection aborts", CONFIG_BOOLEAN_AUTO);
         do_udp_packets          = config_get_boolean("plugin:freebsd:sysctl", "ipv4 UDP packets", 1);
         do_udp_errors           = config_get_boolean("plugin:freebsd:sysctl", "ipv4 UDP errors", 1);
         do_icmp_packets         = config_get_boolean("plugin:freebsd:sysctl", "ipv4 ICMP packets", 1);
@@ -105,17 +105,17 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
         do_ip_fragsout          = config_get_boolean("plugin:freebsd:sysctl", "ipv4 fragments sent", 1);
         do_ip_fragsin           = config_get_boolean("plugin:freebsd:sysctl", "ipv4 fragments assembly", 1);
         do_ip_errors            = config_get_boolean("plugin:freebsd:sysctl", "ipv4 errors", 1);
-        do_ip6_packets          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_fragsout         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 fragments sent", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_fragsin          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 fragments assembly", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_errors           = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6                = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_redir          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp redirects", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_errors         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_echos          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp echos", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_router         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp router", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_neighbor       = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp neighbor", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_types          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp types", CONFIG_ONDEMAND_ONDEMAND);
+        do_ip6_packets          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
+        do_ip6_fragsout         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
+        do_ip6_fragsin          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
+        do_ip6_errors           = config_get_boolean_ondemand("plugin:freebsd:sysctl", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
+        do_icmp6                = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_redir          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp redirects", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_errors         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp errors", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_echos          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp echos", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_router         = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp router", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_neighbor       = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_types          = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp types", CONFIG_BOOLEAN_AUTO);
         do_space                = config_get_boolean("plugin:freebsd:sysctl", "space usage for all disks", 1);
         do_inodes               = config_get_boolean("plugin:freebsd:sysctl", "inodes usage for all disks", 1);
         do_uptime               = config_get_boolean("plugin:freebsd:sysctl", "system uptime", 1);
@@ -1431,8 +1431,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_connaborts == CONFIG_ONDEMAND_YES || (do_tcpext_connaborts == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_rcvpackafterwin || tcpstat.tcps_rcvafterclose || tcpstat.tcps_rcvmemdrop || tcpstat.tcps_persistdrop || tcpstat.tcps_finwait2_drops))) {
-                do_tcpext_connaborts = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_connaborts == CONFIG_BOOLEAN_YES || (do_tcpext_connaborts == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_rcvpackafterwin || tcpstat.tcps_rcvafterclose || tcpstat.tcps_rcvmemdrop || tcpstat.tcps_persistdrop || tcpstat.tcps_finwait2_drops))) {
+                do_tcpext_connaborts = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpconnaborts");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpconnaborts", NULL, "tcp", NULL, "TCP Connection Aborts", "connections/s", 3010, update_every, RRDSET_TYPE_LINE);
@@ -1455,8 +1455,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_ofo == CONFIG_ONDEMAND_YES || (do_tcpext_ofo == CONFIG_ONDEMAND_ONDEMAND && tcpstat.tcps_rcvoopack)) {
-                do_tcpext_ofo = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO && tcpstat.tcps_rcvoopack)) {
+                do_tcpext_ofo = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpofo");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpofo", NULL, "tcp", NULL, "TCP Out-Of-Order Queue", "packets/s", 3050, update_every, RRDSET_TYPE_LINE);
@@ -1471,8 +1471,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_syscookies == CONFIG_ONDEMAND_YES || (do_tcpext_syscookies == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_sc_sendcookie || tcpstat.tcps_sc_recvcookie || tcpstat.tcps_sc_zonefail))) {
-                do_tcpext_syscookies = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_syscookies == CONFIG_BOOLEAN_YES || (do_tcpext_syscookies == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_sc_sendcookie || tcpstat.tcps_sc_recvcookie || tcpstat.tcps_sc_zonefail))) {
+                do_tcpext_syscookies = CONFIG_BOOLEAN_YES;
 
                 st = rrdset_find_localhost("ipv4.tcpsyncookies");
                 if (unlikely(!st)) {
@@ -1492,8 +1492,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ecn == CONFIG_ONDEMAND_YES || (do_ecn == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_ecn_ce || tcpstat.tcps_ecn_ect0 || tcpstat.tcps_ecn_ect1))) {
-                do_ecn = CONFIG_ONDEMAND_YES;
+            if (do_ecn == CONFIG_BOOLEAN_YES || (do_ecn == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_ecn_ce || tcpstat.tcps_ecn_ect0 || tcpstat.tcps_ecn_ect1))) {
+                do_ecn = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.ecnpkts");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "ecnpkts", NULL, "ecn", NULL, "IPv4 ECN Statistics", "packets/s", 8700, update_every, RRDSET_TYPE_LINE);
@@ -1772,10 +1772,10 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
             do_ip6_errors = 0;
             error("DISABLED: ipv6.errors");
         } else {
-            if (do_ip6_packets == CONFIG_ONDEMAND_YES || (do_ip6_packets == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_packets == CONFIG_BOOLEAN_YES || (do_ip6_packets == CONFIG_BOOLEAN_AUTO &&
                                                           (ip6stat.ip6s_localout || ip6stat.ip6s_total ||
                                                            ip6stat.ip6s_forward || ip6stat.ip6s_delivered))) {
-                do_ip6_packets = CONFIG_ONDEMAND_YES;
+                do_ip6_packets = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.packets");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "packets", NULL, "packets", NULL, "IPv6 Packets", "packets/s", 3000,
@@ -1797,10 +1797,10 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_fragsout == CONFIG_ONDEMAND_YES || (do_ip6_fragsout == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_fragsout == CONFIG_BOOLEAN_YES || (do_ip6_fragsout == CONFIG_BOOLEAN_AUTO &&
                                                            (ip6stat.ip6s_fragmented || ip6stat.ip6s_cantfrag ||
                                                             ip6stat.ip6s_ofragments))) {
-                do_ip6_fragsout = CONFIG_ONDEMAND_YES;
+                do_ip6_fragsout = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.fragsout");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "fragsout", NULL, "fragments", NULL, "IPv6 Fragments Sent",
@@ -1821,10 +1821,10 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_fragsin == CONFIG_ONDEMAND_YES || (do_ip6_fragsin == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_fragsin == CONFIG_BOOLEAN_YES || (do_ip6_fragsin == CONFIG_BOOLEAN_AUTO &&
                                                           (ip6stat.ip6s_reassembled || ip6stat.ip6s_fragdropped ||
                                                            ip6stat.ip6s_fragtimeout || ip6stat.ip6s_fragments))) {
-                do_ip6_fragsin = CONFIG_ONDEMAND_YES;
+                do_ip6_fragsin = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.fragsin");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "fragsin", NULL, "fragments", NULL, "IPv6 Fragments Reassembly",
@@ -1847,7 +1847,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_errors == CONFIG_ONDEMAND_YES || (do_ip6_errors == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_ip6_errors == CONFIG_BOOLEAN_YES || (do_ip6_errors == CONFIG_BOOLEAN_AUTO && (
                     ip6stat.ip6s_toosmall ||
                     ip6stat.ip6s_odropped ||
                     ip6stat.ip6s_badoptions ||
@@ -1857,7 +1857,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
                     ip6stat.ip6s_tooshort ||
                     ip6stat.ip6s_cantforward ||
                     ip6stat.ip6s_noroute))) {
-                do_ip6_errors = CONFIG_ONDEMAND_YES;
+                do_ip6_errors = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.errors");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "errors", NULL, "errors", NULL, "IPv6 Errors", "packets/s", 3002,
@@ -1903,8 +1903,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
                 icmp6_total.msgs_out += icmp6stat.icp6s_outhist[i];
             }
             icmp6_total.msgs_in += icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort;
-            if (do_icmp6 == CONFIG_ONDEMAND_YES || (do_icmp6 == CONFIG_ONDEMAND_ONDEMAND && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
-                do_icmp6 = CONFIG_ONDEMAND_YES;
+            if (do_icmp6 == CONFIG_BOOLEAN_YES || (do_icmp6 == CONFIG_BOOLEAN_AUTO && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
+                do_icmp6 = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmp");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages",
@@ -1922,8 +1922,8 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_redir == CONFIG_ONDEMAND_YES || (do_icmp6_redir == CONFIG_ONDEMAND_ONDEMAND && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
-                do_icmp6_redir = CONFIG_ONDEMAND_YES;
+            if (do_icmp6_redir == CONFIG_BOOLEAN_YES || (do_icmp6_redir == CONFIG_BOOLEAN_AUTO && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
+                do_icmp6_redir = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpredir");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects",
@@ -1941,7 +1941,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_errors == CONFIG_ONDEMAND_YES || (do_icmp6_errors == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_errors == CONFIG_BOOLEAN_YES || (do_icmp6_errors == CONFIG_BOOLEAN_AUTO && (
                                                                             icmp6stat.icp6s_badcode ||
                                                                             icmp6stat.icp6s_badlen ||
                                                                             icmp6stat.icp6s_checksum ||
@@ -1953,7 +1953,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
                                                                             icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH] ||
                                                                             icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED] ||
                                                                             icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]))) {
-                do_icmp6_errors = CONFIG_ONDEMAND_YES;
+                do_icmp6_errors = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmperrors");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors", "errors/s", 10100, update_every, RRDSET_TYPE_LINE);
@@ -1987,12 +1987,12 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_echos == CONFIG_ONDEMAND_YES || (do_icmp6_echos == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_echos == CONFIG_BOOLEAN_YES || (do_icmp6_echos == CONFIG_BOOLEAN_AUTO && (
                                                                  icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST] ||
                                                                  icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST] ||
                                                                  icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY] ||
                                                                  icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]))) {
-                do_icmp6_echos = CONFIG_ONDEMAND_YES;
+                do_icmp6_echos = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpechos");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo", "messages/s", 10200, update_every, RRDSET_TYPE_LINE);
@@ -2013,12 +2013,12 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_router == CONFIG_ONDEMAND_YES || (do_icmp6_router == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_router == CONFIG_BOOLEAN_YES || (do_icmp6_router == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT] ||
                                                                     icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT] ||
                                                                     icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT] ||
                                                                     icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]))) {
-                do_icmp6_router = CONFIG_ONDEMAND_YES;
+                do_icmp6_router = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmprouter");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages", "messages/s", 10400, update_every, RRDSET_TYPE_LINE);
@@ -2039,12 +2039,12 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_neighbor == CONFIG_ONDEMAND_YES || (do_icmp6_neighbor == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_neighbor == CONFIG_BOOLEAN_YES || (do_icmp6_neighbor == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT] ||
                                                                     icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT] ||
                                                                     icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT] ||
                                                                     icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]))) {
-                do_icmp6_neighbor = CONFIG_ONDEMAND_YES;
+                do_icmp6_neighbor = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpneighbor");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpneighbor", NULL, "icmp", NULL, "IPv6 Neighbor Messages", "messages/s", 10500, update_every, RRDSET_TYPE_LINE);
@@ -2065,7 +2065,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_types == CONFIG_ONDEMAND_YES || (do_icmp6_types == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_types == CONFIG_BOOLEAN_YES || (do_icmp6_types == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[1] ||
                                                                     icmp6stat.icp6s_inhist[128] ||
                                                                     icmp6stat.icp6s_inhist[129] ||
@@ -2076,7 +2076,7 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
                                                                     icmp6stat.icp6s_outhist[133] ||
                                                                     icmp6stat.icp6s_outhist[135] ||
                                                                     icmp6stat.icp6s_outhist[136]))) {
-                do_icmp6_types = CONFIG_ONDEMAND_YES;
+                do_icmp6_types = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmptypes");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types",
index 58a62832b36131fa28e6a922838fa3d53bba49aa..f43789de20265c1c5dd80c07b26e2ce2057f1859 100644 (file)
@@ -41,10 +41,10 @@ int do_macos_sysctl(int update_every, usec_t dt) {
         do_tcp_packets          = config_get_boolean("plugin:macos:sysctl", "ipv4 TCP packets", 1);
         do_tcp_errors           = config_get_boolean("plugin:macos:sysctl", "ipv4 TCP errors", 1);
         do_tcp_handshake        = config_get_boolean("plugin:macos:sysctl", "ipv4 TCP handshake issues", 1);
-        do_ecn                  = config_get_boolean_ondemand("plugin:macos:sysctl", "ECN packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_syscookies    = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP SYN cookies", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_ofo           = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP out-of-order queue", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_connaborts    = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP connection aborts", CONFIG_ONDEMAND_ONDEMAND);
+        do_ecn                  = config_get_boolean_ondemand("plugin:macos:sysctl", "ECN packets", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_syscookies    = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP SYN cookies", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_ofo           = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP out-of-order queue", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_connaborts    = config_get_boolean_ondemand("plugin:macos:sysctl", "TCP connection aborts", CONFIG_BOOLEAN_AUTO);
         do_udp_packets          = config_get_boolean("plugin:macos:sysctl", "ipv4 UDP packets", 1);
         do_udp_errors           = config_get_boolean("plugin:macos:sysctl", "ipv4 UDP errors", 1);
         do_icmp_packets         = config_get_boolean("plugin:macos:sysctl", "ipv4 ICMP packets", 1);
@@ -53,17 +53,17 @@ int do_macos_sysctl(int update_every, usec_t dt) {
         do_ip_fragsout          = config_get_boolean("plugin:macos:sysctl", "ipv4 fragments sent", 1);
         do_ip_fragsin           = config_get_boolean("plugin:macos:sysctl", "ipv4 fragments assembly", 1);
         do_ip_errors            = config_get_boolean("plugin:macos:sysctl", "ipv4 errors", 1);
-        do_ip6_packets          = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_fragsout         = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 fragments sent", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_fragsin          = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 fragments assembly", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip6_errors           = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6                = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_redir          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp redirects", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_errors         = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_echos          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp echos", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_router         = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp router", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_neighbor       = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp neighbor", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp6_types          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp types", CONFIG_ONDEMAND_ONDEMAND);
+        do_ip6_packets          = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
+        do_ip6_fragsout         = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
+        do_ip6_fragsin          = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
+        do_ip6_errors           = config_get_boolean_ondemand("plugin:macos:sysctl", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
+        do_icmp6                = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_redir          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp redirects", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_errors         = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp errors", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_echos          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp echos", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_router         = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp router", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_neighbor       = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
+        do_icmp6_types          = config_get_boolean_ondemand("plugin:macos:sysctl", "icmp types", CONFIG_BOOLEAN_AUTO);
         do_uptime               = config_get_boolean("plugin:macos:sysctl", "system uptime", 1);
     }
 
@@ -393,8 +393,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_connaborts == CONFIG_ONDEMAND_YES || (do_tcpext_connaborts == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_rcvpackafterwin || tcpstat.tcps_rcvafterclose || tcpstat.tcps_rcvmemdrop || tcpstat.tcps_persistdrop))) {
-                do_tcpext_connaborts = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_connaborts == CONFIG_BOOLEAN_YES || (do_tcpext_connaborts == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_rcvpackafterwin || tcpstat.tcps_rcvafterclose || tcpstat.tcps_rcvmemdrop || tcpstat.tcps_persistdrop))) {
+                do_tcpext_connaborts = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpconnaborts");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpconnaborts", NULL, "tcp", NULL, "TCP Connection Aborts"
@@ -416,8 +416,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_ofo == CONFIG_ONDEMAND_YES || (do_tcpext_ofo == CONFIG_ONDEMAND_ONDEMAND && tcpstat.tcps_rcvoopack)) {
-                do_tcpext_ofo = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO && tcpstat.tcps_rcvoopack)) {
+                do_tcpext_ofo = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpofo");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpofo", NULL, "tcp", NULL, "TCP Out-Of-Order Queue"
@@ -433,8 +433,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_tcpext_syscookies == CONFIG_ONDEMAND_YES || (do_tcpext_syscookies == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_sc_sendcookie || tcpstat.tcps_sc_recvcookie || tcpstat.tcps_sc_zonefail))) {
-                do_tcpext_syscookies = CONFIG_ONDEMAND_YES;
+            if (do_tcpext_syscookies == CONFIG_BOOLEAN_YES || (do_tcpext_syscookies == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_sc_sendcookie || tcpstat.tcps_sc_recvcookie || tcpstat.tcps_sc_zonefail))) {
+                do_tcpext_syscookies = CONFIG_BOOLEAN_YES;
 
                 st = rrdset_find_localhost("ipv4.tcpsyncookies");
                 if (unlikely(!st)) {
@@ -455,8 +455,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ecn == CONFIG_ONDEMAND_YES || (do_ecn == CONFIG_ONDEMAND_ONDEMAND && (tcpstat.tcps_ecn_recv_ce || tcpstat.tcps_ecn_not_supported))) {
-                do_ecn = CONFIG_ONDEMAND_YES;
+            if (do_ecn == CONFIG_BOOLEAN_YES || (do_ecn == CONFIG_BOOLEAN_AUTO && (tcpstat.tcps_ecn_recv_ce || tcpstat.tcps_ecn_not_supported))) {
+                do_ecn = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.ecnpkts");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "ecnpkts", NULL, "ecn", NULL, "IPv4 ECN Statistics"
@@ -728,10 +728,10 @@ int do_macos_sysctl(int update_every, usec_t dt) {
             do_ip6_errors = 0;
             error("DISABLED: ipv6.errors");
         } else {
-            if (do_ip6_packets == CONFIG_ONDEMAND_YES || (do_ip6_packets == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_packets == CONFIG_BOOLEAN_YES || (do_ip6_packets == CONFIG_BOOLEAN_AUTO &&
                                                           (ip6stat.ip6s_localout || ip6stat.ip6s_total ||
                                                            ip6stat.ip6s_forward || ip6stat.ip6s_delivered))) {
-                do_ip6_packets = CONFIG_ONDEMAND_YES;
+                do_ip6_packets = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.packets");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "packets", NULL, "packets", NULL, "IPv6 Packets", "packets/s"
@@ -753,10 +753,10 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_fragsout == CONFIG_ONDEMAND_YES || (do_ip6_fragsout == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_fragsout == CONFIG_BOOLEAN_YES || (do_ip6_fragsout == CONFIG_BOOLEAN_AUTO &&
                                                            (ip6stat.ip6s_fragmented || ip6stat.ip6s_cantfrag ||
                                                             ip6stat.ip6s_ofragments))) {
-                do_ip6_fragsout = CONFIG_ONDEMAND_YES;
+                do_ip6_fragsout = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.fragsout");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "fragsout", NULL, "fragments", NULL, "IPv6 Fragments Sent"
@@ -777,10 +777,10 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_fragsin == CONFIG_ONDEMAND_YES || (do_ip6_fragsin == CONFIG_ONDEMAND_ONDEMAND &&
+            if (do_ip6_fragsin == CONFIG_BOOLEAN_YES || (do_ip6_fragsin == CONFIG_BOOLEAN_AUTO &&
                                                           (ip6stat.ip6s_reassembled || ip6stat.ip6s_fragdropped ||
                                                            ip6stat.ip6s_fragtimeout || ip6stat.ip6s_fragments))) {
-                do_ip6_fragsin = CONFIG_ONDEMAND_YES;
+                do_ip6_fragsin = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.fragsin");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "fragsin", NULL, "fragments", NULL, "IPv6 Fragments Reassembly"
@@ -803,7 +803,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_ip6_errors == CONFIG_ONDEMAND_YES || (do_ip6_errors == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_ip6_errors == CONFIG_BOOLEAN_YES || (do_ip6_errors == CONFIG_BOOLEAN_AUTO && (
                     ip6stat.ip6s_toosmall ||
                     ip6stat.ip6s_odropped ||
                     ip6stat.ip6s_badoptions ||
@@ -813,7 +813,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
                     ip6stat.ip6s_tooshort ||
                     ip6stat.ip6s_cantforward ||
                     ip6stat.ip6s_noroute))) {
-                do_ip6_errors = CONFIG_ONDEMAND_YES;
+                do_ip6_errors = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.errors");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "errors", NULL, "errors", NULL, "IPv6 Errors", "packets/s"
@@ -859,8 +859,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
                 icmp6_total.msgs_out += icmp6stat.icp6s_outhist[i];
             }
             icmp6_total.msgs_in += icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort;
-            if (do_icmp6 == CONFIG_ONDEMAND_YES || (do_icmp6 == CONFIG_ONDEMAND_ONDEMAND && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
-                do_icmp6 = CONFIG_ONDEMAND_YES;
+            if (do_icmp6 == CONFIG_BOOLEAN_YES || (do_icmp6 == CONFIG_BOOLEAN_AUTO && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
+                do_icmp6 = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmp");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages", "messages/s"
@@ -878,8 +878,8 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_redir == CONFIG_ONDEMAND_YES || (do_icmp6_redir == CONFIG_ONDEMAND_ONDEMAND && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
-                do_icmp6_redir = CONFIG_ONDEMAND_YES;
+            if (do_icmp6_redir == CONFIG_BOOLEAN_YES || (do_icmp6_redir == CONFIG_BOOLEAN_AUTO && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
+                do_icmp6_redir = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpredir");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects"
@@ -897,7 +897,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_errors == CONFIG_ONDEMAND_YES || (do_icmp6_errors == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_errors == CONFIG_BOOLEAN_YES || (do_icmp6_errors == CONFIG_BOOLEAN_AUTO && (
                                                                             icmp6stat.icp6s_badcode ||
                                                                             icmp6stat.icp6s_badlen ||
                                                                             icmp6stat.icp6s_checksum ||
@@ -909,7 +909,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
                                                                             icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH] ||
                                                                             icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED] ||
                                                                             icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]))) {
-                do_icmp6_errors = CONFIG_ONDEMAND_YES;
+                do_icmp6_errors = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmperrors");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors"
@@ -944,12 +944,12 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_echos == CONFIG_ONDEMAND_YES || (do_icmp6_echos == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_echos == CONFIG_BOOLEAN_YES || (do_icmp6_echos == CONFIG_BOOLEAN_AUTO && (
                                                                  icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST] ||
                                                                  icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST] ||
                                                                  icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY] ||
                                                                  icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]))) {
-                do_icmp6_echos = CONFIG_ONDEMAND_YES;
+                do_icmp6_echos = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpechos");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo", "messages/s"
@@ -971,12 +971,12 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_router == CONFIG_ONDEMAND_YES || (do_icmp6_router == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_router == CONFIG_BOOLEAN_YES || (do_icmp6_router == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT] ||
                                                                     icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT] ||
                                                                     icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT] ||
                                                                     icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]))) {
-                do_icmp6_router = CONFIG_ONDEMAND_YES;
+                do_icmp6_router = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmprouter");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages"
@@ -998,12 +998,12 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_neighbor == CONFIG_ONDEMAND_YES || (do_icmp6_neighbor == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_neighbor == CONFIG_BOOLEAN_YES || (do_icmp6_neighbor == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT] ||
                                                                     icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT] ||
                                                                     icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT] ||
                                                                     icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]))) {
-                do_icmp6_neighbor = CONFIG_ONDEMAND_YES;
+                do_icmp6_neighbor = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmpneighbor");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmpneighbor", NULL, "icmp", NULL, "IPv6 Neighbor Messages"
@@ -1025,7 +1025,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if (do_icmp6_types == CONFIG_ONDEMAND_YES || (do_icmp6_types == CONFIG_ONDEMAND_ONDEMAND && (
+            if (do_icmp6_types == CONFIG_BOOLEAN_YES || (do_icmp6_types == CONFIG_BOOLEAN_AUTO && (
                                                                     icmp6stat.icp6s_inhist[1] ||
                                                                     icmp6stat.icp6s_inhist[128] ||
                                                                     icmp6stat.icp6s_inhist[129] ||
@@ -1036,7 +1036,7 @@ int do_macos_sysctl(int update_every, usec_t dt) {
                                                                     icmp6stat.icp6s_outhist[133] ||
                                                                     icmp6stat.icp6s_outhist[135] ||
                                                                     icmp6stat.icp6s_outhist[136]))) {
-                do_icmp6_types = CONFIG_ONDEMAND_YES;
+                do_icmp6_types = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv6.icmptypes");
                 if (unlikely(!st)) {
                     st = rrdset_create_localhost("ipv6", "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types"
index c4e65c8b39eb60a9514bf1ccf9b60510585837f0..944d01d23578505b0e12240a3599ea22387142ba 100644 (file)
@@ -427,7 +427,7 @@ int main(int argc, char **argv) {
         while( (opt = getopt(argc, argv, optstring)) != -1 ) {
             switch(opt) {
                 case 'c':
-                    if(load_config(optarg, 1) != 1) {
+                    if(config_load(optarg, 1) != 1) {
                         error("Cannot load configuration file %s.", optarg);
                         exit(1);
                     }
@@ -474,7 +474,7 @@ int main(int argc, char **argv) {
                         char* debug_flags_string = "debug_flags=";
                         if(strcmp(optarg, "unittest") == 0) {
                             default_rrd_update_every = 1;
-                            if(!config_loaded) load_config(NULL, 0);
+                            if(!config_loaded) config_load(NULL, 0);
                             get_netdata_configured_directories();
                             registry_init();
                             rrd_init("unittest");
@@ -554,7 +554,7 @@ int main(int argc, char **argv) {
 #endif
 
     if(!config_loaded)
-        load_config(NULL, 0);
+        config_load(NULL, 0);
 
     {
         char *pmax = config_get("global", "glibc malloc arena max for plugins", "1");
index 9e11f85c6331a2320612f7ed87341691fb79b881..6bb03d1e173c832d19cd0687c3e8f85604ae87a4 100644 (file)
@@ -68,12 +68,12 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
         char var_name[4096 + 1];
         snprintfz(var_name, 4096, "plugin:proc:diskspace:%s", mi->mount_point);
 
-        int def_space = config_get_boolean_ondemand("plugin:proc:diskspace", "space usage for all disks", CONFIG_ONDEMAND_ONDEMAND);
-        int def_inodes = config_get_boolean_ondemand("plugin:proc:diskspace", "inodes usage for all disks", CONFIG_ONDEMAND_ONDEMAND);
+        int def_space = config_get_boolean_ondemand("plugin:proc:diskspace", "space usage for all disks", CONFIG_BOOLEAN_AUTO);
+        int def_inodes = config_get_boolean_ondemand("plugin:proc:diskspace", "inodes usage for all disks", CONFIG_BOOLEAN_AUTO);
 
         if(unlikely(simple_pattern_matches(excluded_mountpoints, mi->mount_point))) {
-            def_space = CONFIG_ONDEMAND_NO;
-            def_inodes = CONFIG_ONDEMAND_NO;
+            def_space = CONFIG_BOOLEAN_NO;
+            def_inodes = CONFIG_BOOLEAN_NO;
         }
 
         do_space = config_get_boolean_ondemand(var_name, "space usage", def_space);
@@ -103,7 +103,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
         do_inodes = m->do_inodes;
     }
 
-    if(unlikely(do_space == CONFIG_ONDEMAND_NO && do_inodes == CONFIG_ONDEMAND_NO))
+    if(unlikely(do_space == CONFIG_BOOLEAN_NO && do_inodes == CONFIG_BOOLEAN_NO))
         return;
 
     if(unlikely(mi->flags & MOUNTINFO_READONLY && !m->collected))
@@ -150,9 +150,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
 
     int rendered = 0;
 
-    if(do_space == CONFIG_ONDEMAND_YES || (do_space == CONFIG_ONDEMAND_ONDEMAND && (bavail || breserved_root || bused))) {
+    if(do_space == CONFIG_BOOLEAN_YES || (do_space == CONFIG_BOOLEAN_AUTO && (bavail || breserved_root || bused))) {
         if(unlikely(!m->st_space)) {
-            m->do_space = CONFIG_ONDEMAND_YES;
+            m->do_space = CONFIG_BOOLEAN_YES;
             m->st_space = rrdset_find_bytype_localhost("disk_space", disk);
             if(unlikely(!m->st_space)) {
                 char title[4096 + 1];
@@ -178,9 +178,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
 
     // --------------------------------------------------------------------------
 
-    if(do_inodes == CONFIG_ONDEMAND_YES || (do_inodes == CONFIG_ONDEMAND_ONDEMAND && (favail || freserved_root || fused))) {
+    if(do_inodes == CONFIG_BOOLEAN_YES || (do_inodes == CONFIG_BOOLEAN_AUTO && (favail || freserved_root || fused))) {
         if(unlikely(!m->st_inodes)) {
-            m->do_inodes = CONFIG_ONDEMAND_YES;
+            m->do_inodes = CONFIG_BOOLEAN_YES;
             m->st_inodes = rrdset_find_bytype_localhost("disk_inodes", disk);
             if(unlikely(!m->st_inodes)) {
                 char title[4096 + 1];
index 0cd85ee8c0bd184300aed6901b4ae1a731ba828d..35763d316aceb6e05ed556266011d16abb372c17 100644 (file)
@@ -190,13 +190,13 @@ static inline void tc_device_commit(struct tc_device *d) {
     static int enable_new_interfaces = -1, enable_bytes = -1, enable_packets = -1, enable_dropped = -1, enable_tokens = -1, enable_ctokens = -1, enabled_all_classes_qdiscs = -1;
 
     if(unlikely(enable_new_interfaces == -1)) {
-        enable_new_interfaces      = config_get_boolean_ondemand("plugin:tc", "enable new interfaces detected at runtime", CONFIG_ONDEMAND_YES);
-        enable_bytes               = config_get_boolean_ondemand("plugin:tc", "enable traffic charts for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        enable_packets             = config_get_boolean_ondemand("plugin:tc", "enable packets charts for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        enable_dropped             = config_get_boolean_ondemand("plugin:tc", "enable dropped charts for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        enable_tokens              = config_get_boolean_ondemand("plugin:tc", "enable tokens charts for all interfaces", CONFIG_ONDEMAND_NO);
-        enable_ctokens             = config_get_boolean_ondemand("plugin:tc", "enable ctokens charts for all interfaces", CONFIG_ONDEMAND_NO);
-        enabled_all_classes_qdiscs = config_get_boolean_ondemand("plugin:tc", "enable show all classes and qdiscs for all interfaces", CONFIG_ONDEMAND_NO);
+        enable_new_interfaces      = config_get_boolean_ondemand("plugin:tc", "enable new interfaces detected at runtime", CONFIG_BOOLEAN_YES);
+        enable_bytes               = config_get_boolean_ondemand("plugin:tc", "enable traffic charts for all interfaces", CONFIG_BOOLEAN_AUTO);
+        enable_packets             = config_get_boolean_ondemand("plugin:tc", "enable packets charts for all interfaces", CONFIG_BOOLEAN_AUTO);
+        enable_dropped             = config_get_boolean_ondemand("plugin:tc", "enable dropped charts for all interfaces", CONFIG_BOOLEAN_AUTO);
+        enable_tokens              = config_get_boolean_ondemand("plugin:tc", "enable tokens charts for all interfaces", CONFIG_BOOLEAN_NO);
+        enable_ctokens             = config_get_boolean_ondemand("plugin:tc", "enable ctokens charts for all interfaces", CONFIG_BOOLEAN_NO);
+        enabled_all_classes_qdiscs = config_get_boolean_ondemand("plugin:tc", "enable show all classes and qdiscs for all interfaces", CONFIG_BOOLEAN_NO);
     }
 
     if(unlikely(d->enabled == (char)-1)) {
@@ -370,8 +370,8 @@ static inline void tc_device_commit(struct tc_device *d) {
     // --------------------------------------------------------------------
     // bytes
 
-    if(d->enabled_bytes == CONFIG_ONDEMAND_YES || (d->enabled_bytes == CONFIG_ONDEMAND_ONDEMAND && bytes_sum)) {
-        d->enabled_bytes = CONFIG_ONDEMAND_YES;
+    if(d->enabled_bytes == CONFIG_BOOLEAN_YES || (d->enabled_bytes == CONFIG_BOOLEAN_AUTO && bytes_sum)) {
+        d->enabled_bytes = CONFIG_BOOLEAN_YES;
 
         if(unlikely(!d->st_bytes))
             d->st_bytes = rrdset_create_localhost(RRD_TYPE_TC, d->id, d->name ? d->name : d->id
@@ -404,8 +404,8 @@ static inline void tc_device_commit(struct tc_device *d) {
     // --------------------------------------------------------------------
     // packets
 
-    if(d->enabled_packets == CONFIG_ONDEMAND_YES || (d->enabled_packets == CONFIG_ONDEMAND_ONDEMAND && packets_sum)) {
-        d->enabled_packets = CONFIG_ONDEMAND_YES;
+    if(d->enabled_packets == CONFIG_BOOLEAN_YES || (d->enabled_packets == CONFIG_BOOLEAN_AUTO && packets_sum)) {
+        d->enabled_packets = CONFIG_BOOLEAN_YES;
 
         if(unlikely(!d->st_packets)) {
             char id[RRD_ID_LENGTH_MAX + 1];
@@ -447,8 +447,8 @@ static inline void tc_device_commit(struct tc_device *d) {
     // --------------------------------------------------------------------
     // dropped
 
-    if(d->enabled_dropped == CONFIG_ONDEMAND_YES || (d->enabled_dropped == CONFIG_ONDEMAND_ONDEMAND && dropped_sum)) {
-        d->enabled_dropped = CONFIG_ONDEMAND_YES;
+    if(d->enabled_dropped == CONFIG_BOOLEAN_YES || (d->enabled_dropped == CONFIG_BOOLEAN_AUTO && dropped_sum)) {
+        d->enabled_dropped = CONFIG_BOOLEAN_YES;
 
         if(unlikely(!d->st_dropped)) {
             char id[RRD_ID_LENGTH_MAX + 1];
@@ -491,8 +491,8 @@ static inline void tc_device_commit(struct tc_device *d) {
     // --------------------------------------------------------------------
     // tokens
 
-    if(d->enabled_tokens == CONFIG_ONDEMAND_YES || (d->enabled_tokens == CONFIG_ONDEMAND_ONDEMAND && tokens_sum)) {
-        d->enabled_tokens = CONFIG_ONDEMAND_YES;
+    if(d->enabled_tokens == CONFIG_BOOLEAN_YES || (d->enabled_tokens == CONFIG_BOOLEAN_AUTO && tokens_sum)) {
+        d->enabled_tokens = CONFIG_BOOLEAN_YES;
 
         if(unlikely(!d->st_tokens)) {
             char id[RRD_ID_LENGTH_MAX + 1];
@@ -534,8 +534,8 @@ static inline void tc_device_commit(struct tc_device *d) {
     // --------------------------------------------------------------------
     // ctokens
 
-    if(d->enabled_ctokens == CONFIG_ONDEMAND_YES || (d->enabled_ctokens == CONFIG_ONDEMAND_ONDEMAND && ctokens_sum)) {
-        d->enabled_ctokens = CONFIG_ONDEMAND_YES;
+    if(d->enabled_ctokens == CONFIG_BOOLEAN_YES || (d->enabled_ctokens == CONFIG_BOOLEAN_AUTO && ctokens_sum)) {
+        d->enabled_ctokens = CONFIG_BOOLEAN_YES;
 
         if(unlikely(!d->st_ctokens)) {
             char id[RRD_ID_LENGTH_MAX + 1];
index feb0b57abd8625a673728f230fd37d2edca9852d..134e7a1a8d69aba290cc092e521b3a5110709305 100644 (file)
@@ -198,17 +198,17 @@ static inline int is_major_enabled(int major) {
 
 int do_proc_diskstats(int update_every, usec_t dt) {
     static procfile *ff = NULL;
-    static int  global_enable_new_disks_detected_at_runtime = CONFIG_ONDEMAND_YES,
-                global_enable_performance_for_physical_disks = CONFIG_ONDEMAND_ONDEMAND,
-                global_enable_performance_for_virtual_disks = CONFIG_ONDEMAND_ONDEMAND,
-                global_enable_performance_for_partitions = CONFIG_ONDEMAND_NO,
-                global_do_io = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_ops = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_mops = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_iotime = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_qops = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_util = CONFIG_ONDEMAND_ONDEMAND,
-                global_do_backlog = CONFIG_ONDEMAND_ONDEMAND,
+    static int  global_enable_new_disks_detected_at_runtime = CONFIG_BOOLEAN_YES,
+                global_enable_performance_for_physical_disks = CONFIG_BOOLEAN_AUTO,
+                global_enable_performance_for_virtual_disks = CONFIG_BOOLEAN_AUTO,
+                global_enable_performance_for_partitions = CONFIG_BOOLEAN_NO,
+                global_do_io = CONFIG_BOOLEAN_AUTO,
+                global_do_ops = CONFIG_BOOLEAN_AUTO,
+                global_do_mops = CONFIG_BOOLEAN_AUTO,
+                global_do_iotime = CONFIG_BOOLEAN_AUTO,
+                global_do_qops = CONFIG_BOOLEAN_AUTO,
+                global_do_util = CONFIG_BOOLEAN_AUTO,
+                global_do_backlog = CONFIG_BOOLEAN_AUTO,
                 globals_initialized = 0;
 
     if(unlikely(!globals_initialized)) {
@@ -333,21 +333,21 @@ int do_proc_diskstats(int update_every, usec_t dt) {
             snprintfz(var_name, 4096, "plugin:proc:/proc/diskstats:%s", disk);
 
             int def_enable = config_get_boolean_ondemand(var_name, "enable", global_enable_new_disks_detected_at_runtime);
-            if(unlikely(def_enable == CONFIG_ONDEMAND_NO)) {
+            if(unlikely(def_enable == CONFIG_BOOLEAN_NO)) {
                 // the user does not want any metrics for this disk
-                d->do_io = CONFIG_ONDEMAND_NO;
-                d->do_ops = CONFIG_ONDEMAND_NO;
-                d->do_mops = CONFIG_ONDEMAND_NO;
-                d->do_iotime = CONFIG_ONDEMAND_NO;
-                d->do_qops = CONFIG_ONDEMAND_NO;
-                d->do_util = CONFIG_ONDEMAND_NO;
-                d->do_backlog = CONFIG_ONDEMAND_NO;
+                d->do_io = CONFIG_BOOLEAN_NO;
+                d->do_ops = CONFIG_BOOLEAN_NO;
+                d->do_mops = CONFIG_BOOLEAN_NO;
+                d->do_iotime = CONFIG_BOOLEAN_NO;
+                d->do_qops = CONFIG_BOOLEAN_NO;
+                d->do_util = CONFIG_BOOLEAN_NO;
+                d->do_backlog = CONFIG_BOOLEAN_NO;
             }
             else {
                 // this disk is enabled
                 // check its direct settings
 
-                int def_performance = CONFIG_ONDEMAND_ONDEMAND;
+                int def_performance = CONFIG_BOOLEAN_AUTO;
 
                 // since this is 'on demand' we can figure the performance settings
                 // based on the type of disk
@@ -378,16 +378,16 @@ int do_proc_diskstats(int update_every, usec_t dt) {
                 // check the user configuration (this will also show our 'on demand' decision)
                 def_performance = config_get_boolean_ondemand(var_name, "enable performance metrics", def_performance);
 
-                int ddo_io = CONFIG_ONDEMAND_NO,
-                    ddo_ops = CONFIG_ONDEMAND_NO,
-                    ddo_mops = CONFIG_ONDEMAND_NO,
-                    ddo_iotime = CONFIG_ONDEMAND_NO,
-                    ddo_qops = CONFIG_ONDEMAND_NO,
-                    ddo_util = CONFIG_ONDEMAND_NO,
-                    ddo_backlog = CONFIG_ONDEMAND_NO;
+                int ddo_io = CONFIG_BOOLEAN_NO,
+                    ddo_ops = CONFIG_BOOLEAN_NO,
+                    ddo_mops = CONFIG_BOOLEAN_NO,
+                    ddo_iotime = CONFIG_BOOLEAN_NO,
+                    ddo_qops = CONFIG_BOOLEAN_NO,
+                    ddo_util = CONFIG_BOOLEAN_NO,
+                    ddo_backlog = CONFIG_BOOLEAN_NO;
 
                 // we enable individual performance charts only when def_performance is not disabled
-                if(unlikely(def_performance != CONFIG_ONDEMAND_NO)) {
+                if(unlikely(def_performance != CONFIG_BOOLEAN_NO)) {
                     ddo_io = global_do_io,
                     ddo_ops = global_do_ops,
                     ddo_mops = global_do_mops,
@@ -414,8 +414,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
         // --------------------------------------------------------------------------
         // Do performance metrics
 
-        if(d->do_io == CONFIG_ONDEMAND_YES || (d->do_io == CONFIG_ONDEMAND_ONDEMAND && (readsectors || writesectors))) {
-            d->do_io = CONFIG_ONDEMAND_YES;
+        if(d->do_io == CONFIG_BOOLEAN_YES || (d->do_io == CONFIG_BOOLEAN_AUTO && (readsectors || writesectors))) {
+            d->do_io = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost(RRD_TYPE_DISK, disk);
             if(unlikely(!st)) {
@@ -434,8 +434,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_ops == CONFIG_ONDEMAND_YES || (d->do_ops == CONFIG_ONDEMAND_ONDEMAND && (reads || writes))) {
-            d->do_ops = CONFIG_ONDEMAND_YES;
+        if(d->do_ops == CONFIG_BOOLEAN_YES || (d->do_ops == CONFIG_BOOLEAN_AUTO && (reads || writes))) {
+            d->do_ops = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_ops", disk);
             if(unlikely(!st)) {
@@ -455,8 +455,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_qops == CONFIG_ONDEMAND_YES || (d->do_qops == CONFIG_ONDEMAND_ONDEMAND && queued_ios)) {
-            d->do_qops = CONFIG_ONDEMAND_YES;
+        if(d->do_qops == CONFIG_BOOLEAN_YES || (d->do_qops == CONFIG_BOOLEAN_AUTO && queued_ios)) {
+            d->do_qops = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_qops", disk);
             if(unlikely(!st)) {
@@ -474,8 +474,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_backlog == CONFIG_ONDEMAND_YES || (d->do_backlog == CONFIG_ONDEMAND_ONDEMAND && backlog_ms)) {
-            d->do_backlog = CONFIG_ONDEMAND_YES;
+        if(d->do_backlog == CONFIG_BOOLEAN_YES || (d->do_backlog == CONFIG_BOOLEAN_AUTO && backlog_ms)) {
+            d->do_backlog = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_backlog", disk);
             if(unlikely(!st)) {
@@ -493,8 +493,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_util == CONFIG_ONDEMAND_YES || (d->do_util == CONFIG_ONDEMAND_ONDEMAND && busy_ms)) {
-            d->do_util = CONFIG_ONDEMAND_YES;
+        if(d->do_util == CONFIG_BOOLEAN_YES || (d->do_util == CONFIG_BOOLEAN_AUTO && busy_ms)) {
+            d->do_util = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_util", disk);
             if(unlikely(!st)) {
@@ -512,8 +512,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_mops == CONFIG_ONDEMAND_YES || (d->do_mops == CONFIG_ONDEMAND_ONDEMAND && (mreads || mwrites))) {
-            d->do_mops = CONFIG_ONDEMAND_YES;
+        if(d->do_mops == CONFIG_BOOLEAN_YES || (d->do_mops == CONFIG_BOOLEAN_AUTO && (mreads || mwrites))) {
+            d->do_mops = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_mops", disk);
             if(unlikely(!st)) {
@@ -533,8 +533,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(d->do_iotime == CONFIG_ONDEMAND_YES || (d->do_iotime == CONFIG_ONDEMAND_ONDEMAND && (readms || writems))) {
-            d->do_iotime = CONFIG_ONDEMAND_YES;
+        if(d->do_iotime == CONFIG_BOOLEAN_YES || (d->do_iotime == CONFIG_BOOLEAN_AUTO && (readms || writems))) {
+            d->do_iotime = CONFIG_BOOLEAN_YES;
 
             st = rrdset_find_bytype_localhost("disk_iotime", disk);
             if(unlikely(!st)) {
@@ -557,8 +557,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
         // only if this is not the first time we run
 
         if(likely(dt)) {
-            if( (d->do_iotime == CONFIG_ONDEMAND_YES || (d->do_iotime == CONFIG_ONDEMAND_ONDEMAND && (readms || writems))) &&
-                (d->do_ops    == CONFIG_ONDEMAND_YES || (d->do_ops    == CONFIG_ONDEMAND_ONDEMAND && (reads || writes)))) {
+            if( (d->do_iotime == CONFIG_BOOLEAN_YES || (d->do_iotime == CONFIG_BOOLEAN_AUTO && (readms || writems))) &&
+                (d->do_ops    == CONFIG_BOOLEAN_YES || (d->do_ops    == CONFIG_BOOLEAN_AUTO && (reads || writes)))) {
                 st = rrdset_find_bytype_localhost("disk_await", disk);
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("disk_await", disk, NULL, family, "disk.await"
@@ -576,8 +576,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
                 rrdset_done(st);
             }
 
-            if( (d->do_io  == CONFIG_ONDEMAND_YES || (d->do_io  == CONFIG_ONDEMAND_ONDEMAND && (readsectors || writesectors))) &&
-                (d->do_ops == CONFIG_ONDEMAND_YES || (d->do_ops == CONFIG_ONDEMAND_ONDEMAND && (reads || writes)))) {
+            if( (d->do_io  == CONFIG_BOOLEAN_YES || (d->do_io  == CONFIG_BOOLEAN_AUTO && (readsectors || writesectors))) &&
+                (d->do_ops == CONFIG_BOOLEAN_YES || (d->do_ops == CONFIG_BOOLEAN_AUTO && (reads || writes)))) {
                 st = rrdset_find_bytype_localhost("disk_avgsz", disk);
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("disk_avgsz", disk, NULL, family, "disk.avgsz"
@@ -595,8 +595,8 @@ int do_proc_diskstats(int update_every, usec_t dt) {
                 rrdset_done(st);
             }
 
-            if( (d->do_util == CONFIG_ONDEMAND_YES || (d->do_util == CONFIG_ONDEMAND_ONDEMAND && busy_ms)) &&
-                (d->do_ops  == CONFIG_ONDEMAND_YES || (d->do_ops  == CONFIG_ONDEMAND_ONDEMAND && (reads || writes)))) {
+            if( (d->do_util == CONFIG_BOOLEAN_YES || (d->do_util == CONFIG_BOOLEAN_AUTO && busy_ms)) &&
+                (d->do_ops  == CONFIG_BOOLEAN_YES || (d->do_ops  == CONFIG_BOOLEAN_AUTO && (reads || writes)))) {
                 st = rrdset_find_bytype_localhost("disk_svctm", disk);
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("disk_svctm", disk, NULL, family, "disk.svctm", "Average Service Time"
index 4f8af22dd3a92345d09218d0dd1e5eab4e5391f1..6b0219cc910e0e520a45703d04e8542601f195d8 100644 (file)
@@ -55,8 +55,8 @@ int do_proc_meminfo(int update_every, usec_t dt) {
 
     if(unlikely(!arl_base)) {
         do_ram          = config_get_boolean("plugin:proc:/proc/meminfo", "system ram", 1);
-        do_swap         = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "system swap", CONFIG_ONDEMAND_ONDEMAND);
-        do_hwcorrupt    = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "hardware corrupted ECC", CONFIG_ONDEMAND_ONDEMAND);
+        do_swap         = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "system swap", CONFIG_BOOLEAN_AUTO);
+        do_hwcorrupt    = config_get_boolean_ondemand("plugin:proc:/proc/meminfo", "hardware corrupted ECC", CONFIG_BOOLEAN_AUTO);
         do_committed    = config_get_boolean("plugin:proc:/proc/meminfo", "committed memory", 1);
         do_writeback    = config_get_boolean("plugin:proc:/proc/meminfo", "writeback memory", 1);
         do_kernel       = config_get_boolean("plugin:proc:/proc/meminfo", "kernel memory", 1);
@@ -163,8 +163,8 @@ int do_proc_meminfo(int update_every, usec_t dt) {
 
     unsigned long long SwapUsed = SwapTotal - SwapFree;
 
-    if(SwapTotal || SwapUsed || SwapFree || do_swap == CONFIG_ONDEMAND_YES) {
-        do_swap = CONFIG_ONDEMAND_YES;
+    if(SwapTotal || SwapUsed || SwapFree || do_swap == CONFIG_BOOLEAN_YES) {
+        do_swap = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost("system.swap");
         if(!st) {
@@ -184,8 +184,8 @@ int do_proc_meminfo(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(arl_hwcorrupted->flags & ARL_ENTRY_FLAG_FOUND && (do_hwcorrupt == CONFIG_ONDEMAND_YES || (do_hwcorrupt == CONFIG_ONDEMAND_ONDEMAND && HardwareCorrupted > 0))) {
-        do_hwcorrupt = CONFIG_ONDEMAND_YES;
+    if(arl_hwcorrupted->flags & ARL_ENTRY_FLAG_FOUND && (do_hwcorrupt == CONFIG_BOOLEAN_YES || (do_hwcorrupt == CONFIG_BOOLEAN_AUTO && HardwareCorrupted > 0))) {
+        do_hwcorrupt = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost("mem.hwcorrupt");
         if(!st) {
index 43906d17bf0eaceedfd905c34d3f128419dcd7e7..9b942326240baf710e9848d705b1635c3c8bcf92 100644 (file)
@@ -117,15 +117,15 @@ int do_proc_net_dev(int update_every, usec_t dt) {
     static int do_bandwidth = -1, do_packets = -1, do_errors = -1, do_drops = -1, do_fifo = -1, do_compressed = -1, do_events = -1;
 
     if(unlikely(enable_new_interfaces == -1)) {
-        enable_new_interfaces = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "enable new interfaces detected at runtime", CONFIG_ONDEMAND_ONDEMAND);
+        enable_new_interfaces = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "enable new interfaces detected at runtime", CONFIG_BOOLEAN_AUTO);
 
-        do_bandwidth    = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "bandwidth for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_packets      = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "packets for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_errors       = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "errors for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_drops        = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "drops for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_fifo         = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "fifo for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_compressed   = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "compressed packets for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
-        do_events       = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "frames, collisions, carrier counters for all interfaces", CONFIG_ONDEMAND_ONDEMAND);
+        do_bandwidth    = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "bandwidth for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_packets      = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "packets for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_errors       = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "errors for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_drops        = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "drops for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_fifo         = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "fifo for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_compressed   = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "compressed packets for all interfaces", CONFIG_BOOLEAN_AUTO);
+        do_events       = config_get_boolean_ondemand("plugin:proc:/proc/net/dev", "frames, collisions, carrier counters for all interfaces", CONFIG_BOOLEAN_AUTO);
 
         disabled_list = simple_pattern_create(
                 config_get("plugin:proc:/proc/net/dev", "disable by default interfaces matching", "lo fireqos* *-ifb")
@@ -164,7 +164,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
             snprintfz(var_name, 512, "plugin:proc:/proc/net/dev:%s", d->name);
             d->enabled = config_get_boolean_ondemand(var_name, "enabled", d->enabled);
 
-            if(d->enabled == CONFIG_ONDEMAND_NO)
+            if(d->enabled == CONFIG_BOOLEAN_NO)
                 continue;
 
             d->do_bandwidth  = config_get_boolean_ondemand(var_name, "bandwidth", do_bandwidth);
@@ -179,38 +179,38 @@ int do_proc_net_dev(int update_every, usec_t dt) {
         if(unlikely(!d->enabled))
             continue;
 
-        if(likely(d->do_bandwidth != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_bandwidth != CONFIG_BOOLEAN_NO)) {
             d->rbytes      = str2kernel_uint_t(procfile_lineword(ff, l, 1));
             d->tbytes      = str2kernel_uint_t(procfile_lineword(ff, l, 9));
         }
 
-        if(likely(d->do_packets != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_packets != CONFIG_BOOLEAN_NO)) {
             d->rpackets    = str2kernel_uint_t(procfile_lineword(ff, l, 2));
             d->rmulticast  = str2kernel_uint_t(procfile_lineword(ff, l, 8));
             d->tpackets    = str2kernel_uint_t(procfile_lineword(ff, l, 10));
         }
 
-        if(likely(d->do_errors != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_errors != CONFIG_BOOLEAN_NO)) {
             d->rerrors     = str2kernel_uint_t(procfile_lineword(ff, l, 3));
             d->terrors     = str2kernel_uint_t(procfile_lineword(ff, l, 11));
         }
 
-        if(likely(d->do_drops != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_drops != CONFIG_BOOLEAN_NO)) {
             d->rdrops      = str2kernel_uint_t(procfile_lineword(ff, l, 4));
             d->tdrops      = str2kernel_uint_t(procfile_lineword(ff, l, 12));
         }
 
-        if(likely(d->do_fifo != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_fifo != CONFIG_BOOLEAN_NO)) {
             d->rfifo       = str2kernel_uint_t(procfile_lineword(ff, l, 5));
             d->tfifo       = str2kernel_uint_t(procfile_lineword(ff, l, 13));
         }
 
-        if(likely(d->do_compressed != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_compressed != CONFIG_BOOLEAN_NO)) {
             d->rcompressed = str2kernel_uint_t(procfile_lineword(ff, l, 7));
             d->tcompressed = str2kernel_uint_t(procfile_lineword(ff, l, 16));
         }
 
-        if(likely(d->do_events != CONFIG_ONDEMAND_NO)) {
+        if(likely(d->do_events != CONFIG_BOOLEAN_NO)) {
             d->rframe      = str2kernel_uint_t(procfile_lineword(ff, l, 6));
             d->tcollisions = str2kernel_uint_t(procfile_lineword(ff, l, 14));
             d->tcarrier    = str2kernel_uint_t(procfile_lineword(ff, l, 15));
@@ -218,10 +218,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_bandwidth == CONFIG_ONDEMAND_ONDEMAND && (d->rbytes || d->tbytes))))
-            d->do_bandwidth = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_bandwidth == CONFIG_BOOLEAN_AUTO && (d->rbytes || d->tbytes))))
+            d->do_bandwidth = CONFIG_BOOLEAN_YES;
 
-        if(d->do_bandwidth == CONFIG_ONDEMAND_YES) {
+        if(d->do_bandwidth == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_bandwidth)) {
                 d->st_bandwidth = rrdset_find_bytype_localhost("net", d->name);
 
@@ -241,10 +241,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_packets == CONFIG_ONDEMAND_ONDEMAND && (d->rpackets || d->tpackets || d->rmulticast))))
-            d->do_packets = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_packets == CONFIG_BOOLEAN_AUTO && (d->rpackets || d->tpackets || d->rmulticast))))
+            d->do_packets = CONFIG_BOOLEAN_YES;
 
-        if(d->do_packets == CONFIG_ONDEMAND_YES) {
+        if(d->do_packets == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_packets)) {
                 d->st_packets = rrdset_find_bytype_localhost("net_packets", d->name);
 
@@ -268,10 +268,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_errors == CONFIG_ONDEMAND_ONDEMAND && (d->rerrors || d->terrors))))
-            d->do_errors = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_errors == CONFIG_BOOLEAN_AUTO && (d->rerrors || d->terrors))))
+            d->do_errors = CONFIG_BOOLEAN_YES;
 
-        if(d->do_errors == CONFIG_ONDEMAND_YES) {
+        if(d->do_errors == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_errors)) {
                 d->st_errors = rrdset_find_bytype_localhost("net_errors", d->name);
 
@@ -294,10 +294,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_drops == CONFIG_ONDEMAND_ONDEMAND && (d->rdrops || d->tdrops))))
-            d->do_drops = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_drops == CONFIG_BOOLEAN_AUTO && (d->rdrops || d->tdrops))))
+            d->do_drops = CONFIG_BOOLEAN_YES;
 
-        if(d->do_drops == CONFIG_ONDEMAND_YES) {
+        if(d->do_drops == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_drops)) {
                 d->st_drops = rrdset_find_bytype_localhost("net_drops", d->name);
 
@@ -320,10 +320,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_fifo == CONFIG_ONDEMAND_ONDEMAND && (d->rfifo || d->tfifo))))
-            d->do_fifo = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_fifo == CONFIG_BOOLEAN_AUTO && (d->rfifo || d->tfifo))))
+            d->do_fifo = CONFIG_BOOLEAN_YES;
 
-        if(d->do_fifo == CONFIG_ONDEMAND_YES) {
+        if(d->do_fifo == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_fifo)) {
                 d->st_fifo = rrdset_find_bytype_localhost("net_fifo", d->name);
 
@@ -346,10 +346,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_compressed == CONFIG_ONDEMAND_ONDEMAND && (d->rcompressed || d->tcompressed))))
-            d->do_compressed = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_compressed == CONFIG_BOOLEAN_AUTO && (d->rcompressed || d->tcompressed))))
+            d->do_compressed = CONFIG_BOOLEAN_YES;
 
-        if(d->do_compressed == CONFIG_ONDEMAND_YES) {
+        if(d->do_compressed == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_compressed)) {
                 d->st_compressed = rrdset_find_bytype_localhost("net_compressed", d->name);
                 if(!d->st_compressed)
@@ -371,10 +371,10 @@ int do_proc_net_dev(int update_every, usec_t dt) {
 
         // --------------------------------------------------------------------
 
-        if(unlikely((d->do_events == CONFIG_ONDEMAND_ONDEMAND && (d->rframe || d->tcollisions || d->tcarrier))))
-            d->do_events = CONFIG_ONDEMAND_YES;
+        if(unlikely((d->do_events == CONFIG_BOOLEAN_AUTO && (d->rframe || d->tcollisions || d->tcarrier))))
+            d->do_events = CONFIG_BOOLEAN_YES;
 
-        if(d->do_events == CONFIG_ONDEMAND_YES) {
+        if(d->do_events == CONFIG_BOOLEAN_YES) {
             if(unlikely(!d->st_events)) {
                 d->st_events = rrdset_find_bytype_localhost("net_events", d->name);
                 if(!d->st_events)
index b0772c0366359fbaae766f52c1c645e49dde4f76..2677a6c17b3433c7a153297743c3defe4399ea9e 100644 (file)
@@ -98,19 +98,19 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
         hash_ipext = simple_hash("IpExt");
         hash_tcpext = simple_hash("TcpExt");
 
-        do_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_inerrors  = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "input errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_mcast     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "multicast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_bcast     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "broadcast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_mcast_p   = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "multicast packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_bcast_p   = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "broadcast packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_ecn       = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "ECN packets", CONFIG_ONDEMAND_ONDEMAND);
-
-        do_tcpext_reorder    = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP reorders", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_syscookies = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP SYN cookies", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_ofo        = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP out-of-order queue", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_connaborts = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP connection aborts", CONFIG_ONDEMAND_ONDEMAND);
-        do_tcpext_memory     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP memory pressures", CONFIG_ONDEMAND_ONDEMAND);
+        do_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_inerrors  = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "input errors", CONFIG_BOOLEAN_AUTO);
+        do_mcast     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_bcast     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_mcast_p   = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "multicast packets", CONFIG_BOOLEAN_AUTO);
+        do_bcast_p   = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "broadcast packets", CONFIG_BOOLEAN_AUTO);
+        do_ecn       = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "ECN packets", CONFIG_BOOLEAN_AUTO);
+
+        do_tcpext_reorder    = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP reorders", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_syscookies = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP SYN cookies", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_ofo        = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP out-of-order queue", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_connaborts = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP connection aborts", CONFIG_BOOLEAN_AUTO);
+        do_tcpext_memory     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP memory pressures", CONFIG_BOOLEAN_AUTO);
 
         arl_ipext  = arl_create("netstat/ipext", NULL, 60);
         arl_tcpext = arl_create("netstat/tcpext", NULL, 60);
@@ -118,38 +118,38 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
         // --------------------------------------------------------------------
         // IPv4
 
-        if(do_bandwidth != CONFIG_ONDEMAND_NO) {
+        if(do_bandwidth != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InOctets",  &ipext_InOctets);
             arl_expect(arl_ipext, "OutOctets", &ipext_OutOctets);
         }
 
-        if(do_inerrors != CONFIG_ONDEMAND_NO) {
+        if(do_inerrors != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InNoRoutes",      &ipext_InNoRoutes);
             arl_expect(arl_ipext, "InTruncatedPkts", &ipext_InTruncatedPkts);
             arl_expect(arl_ipext, "InCsumErrors",    &ipext_InCsumErrors);
         }
 
-        if(do_mcast != CONFIG_ONDEMAND_NO) {
+        if(do_mcast != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InMcastOctets", &ipext_InMcastOctets);
             arl_expect(arl_ipext, "OutMcastOctets", &ipext_OutMcastOctets);
         }
 
-        if(do_mcast_p != CONFIG_ONDEMAND_NO) {
+        if(do_mcast_p != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InMcastPkts",  &ipext_InMcastPkts);
             arl_expect(arl_ipext, "OutMcastPkts", &ipext_OutMcastPkts);
         }
 
-        if(do_bcast != CONFIG_ONDEMAND_NO) {
+        if(do_bcast != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InBcastPkts",  &ipext_InBcastPkts);
             arl_expect(arl_ipext, "OutBcastPkts", &ipext_OutBcastPkts);
         }
 
-        if(do_bcast_p != CONFIG_ONDEMAND_NO) {
+        if(do_bcast_p != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InBcastOctets",  &ipext_InBcastOctets);
             arl_expect(arl_ipext, "OutBcastOctets", &ipext_OutBcastOctets);
         }
 
-        if(do_ecn != CONFIG_ONDEMAND_NO) {
+        if(do_ecn != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_ipext, "InNoECTPkts", &ipext_InNoECTPkts);
             arl_expect(arl_ipext, "InECT1Pkts",  &ipext_InECT1Pkts);
             arl_expect(arl_ipext, "InECT0Pkts",  &ipext_InECT0Pkts);
@@ -159,27 +159,27 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
         // --------------------------------------------------------------------
         // IPv4 TCP
 
-        if(do_tcpext_reorder != CONFIG_ONDEMAND_NO) {
+        if(do_tcpext_reorder != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_tcpext, "TCPFACKReorder", &tcpext_TCPFACKReorder);
             arl_expect(arl_tcpext, "TCPSACKReorder", &tcpext_TCPSACKReorder);
             arl_expect(arl_tcpext, "TCPRenoReorder", &tcpext_TCPRenoReorder);
             arl_expect(arl_tcpext, "TCPTSReorder",   &tcpext_TCPTSReorder);
         }
 
-        if(do_tcpext_syscookies != CONFIG_ONDEMAND_NO) {
+        if(do_tcpext_syscookies != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_tcpext, "SyncookiesSent",   &tcpext_SyncookiesSent);
             arl_expect(arl_tcpext, "SyncookiesRecv",   &tcpext_SyncookiesRecv);
             arl_expect(arl_tcpext, "SyncookiesFailed", &tcpext_SyncookiesFailed);
         }
 
-        if(do_tcpext_ofo != CONFIG_ONDEMAND_NO) {
+        if(do_tcpext_ofo != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_tcpext, "TCPOFOQueue", &tcpext_TCPOFOQueue);
             arl_expect(arl_tcpext, "TCPOFODrop",  &tcpext_TCPOFODrop);
             arl_expect(arl_tcpext, "TCPOFOMerge", &tcpext_TCPOFOMerge);
             arl_expect(arl_tcpext, "OfoPruned",   &tcpext_OfoPruned);
         }
 
-        if(do_tcpext_connaborts != CONFIG_ONDEMAND_NO) {
+        if(do_tcpext_connaborts != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_tcpext, "TCPAbortOnData",    &tcpext_TCPAbortOnData);
             arl_expect(arl_tcpext, "TCPAbortOnClose",   &tcpext_TCPAbortOnClose);
             arl_expect(arl_tcpext, "TCPAbortOnMemory",  &tcpext_TCPAbortOnMemory);
@@ -188,7 +188,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
             arl_expect(arl_tcpext, "TCPAbortFailed",    &tcpext_TCPAbortFailed);
         }
 
-        if(do_tcpext_memory != CONFIG_ONDEMAND_NO) {
+        if(do_tcpext_memory != CONFIG_BOOLEAN_NO) {
             arl_expect(arl_tcpext, "TCPMemoryPressures", &tcpext_TCPMemoryPressures);
         }
     }
@@ -228,8 +228,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_bandwidth == CONFIG_ONDEMAND_YES || (do_bandwidth == CONFIG_ONDEMAND_ONDEMAND && (ipext_InOctets || ipext_OutOctets))) {
-                do_bandwidth = CONFIG_ONDEMAND_YES;
+            if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO && (ipext_InOctets || ipext_OutOctets))) {
+                do_bandwidth = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("system.ipv4");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("system", "ipv4", NULL, "network", NULL, "IPv4 Bandwidth", "kilobits/s"
@@ -247,8 +247,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_inerrors == CONFIG_ONDEMAND_YES || (do_inerrors == CONFIG_ONDEMAND_ONDEMAND && (ipext_InNoRoutes || ipext_InTruncatedPkts))) {
-                do_inerrors = CONFIG_ONDEMAND_YES;
+            if(do_inerrors == CONFIG_BOOLEAN_YES || (do_inerrors == CONFIG_BOOLEAN_AUTO && (ipext_InNoRoutes || ipext_InTruncatedPkts))) {
+                do_inerrors = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.inerrors");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "inerrors", NULL, "errors", NULL, "IPv4 Input Errors"
@@ -269,8 +269,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_mcast == CONFIG_ONDEMAND_YES || (do_mcast == CONFIG_ONDEMAND_ONDEMAND && (ipext_InMcastOctets || ipext_OutMcastOctets))) {
-                do_mcast = CONFIG_ONDEMAND_YES;
+            if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO && (ipext_InMcastOctets || ipext_OutMcastOctets))) {
+                do_mcast = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.mcast");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "mcast", NULL, "multicast", NULL, "IPv4 Multicast Bandwidth"
@@ -289,8 +289,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_bcast == CONFIG_ONDEMAND_YES || (do_bcast == CONFIG_ONDEMAND_ONDEMAND && (ipext_InBcastOctets || ipext_OutBcastOctets))) {
-                do_bcast = CONFIG_ONDEMAND_YES;
+            if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO && (ipext_InBcastOctets || ipext_OutBcastOctets))) {
+                do_bcast = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.bcast");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "bcast", NULL, "broadcast", NULL, "IPv4 Broadcast Bandwidth"
@@ -309,8 +309,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_mcast_p == CONFIG_ONDEMAND_YES || (do_mcast_p == CONFIG_ONDEMAND_ONDEMAND && (ipext_InMcastPkts || ipext_OutMcastPkts))) {
-                do_mcast_p = CONFIG_ONDEMAND_YES;
+            if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO && (ipext_InMcastPkts || ipext_OutMcastPkts))) {
+                do_mcast_p = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.mcastpkts");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "mcastpkts", NULL, "multicast", NULL, "IPv4 Multicast Packets"
@@ -329,8 +329,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_bcast_p == CONFIG_ONDEMAND_YES || (do_bcast_p == CONFIG_ONDEMAND_ONDEMAND && (ipext_InBcastPkts || ipext_OutBcastPkts))) {
-                do_bcast_p = CONFIG_ONDEMAND_YES;
+            if(do_bcast_p == CONFIG_BOOLEAN_YES || (do_bcast_p == CONFIG_BOOLEAN_AUTO && (ipext_InBcastPkts || ipext_OutBcastPkts))) {
+                do_bcast_p = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.bcastpkts");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "bcastpkts", NULL, "broadcast", NULL, "IPv4 Broadcast Packets"
@@ -349,8 +349,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_ecn == CONFIG_ONDEMAND_YES || (do_ecn == CONFIG_ONDEMAND_ONDEMAND && (ipext_InCEPkts || ipext_InECT0Pkts || ipext_InECT1Pkts || ipext_InNoECTPkts))) {
-                do_ecn = CONFIG_ONDEMAND_YES;
+            if(do_ecn == CONFIG_BOOLEAN_YES || (do_ecn == CONFIG_BOOLEAN_AUTO && (ipext_InCEPkts || ipext_InECT0Pkts || ipext_InECT1Pkts || ipext_InNoECTPkts))) {
+                do_ecn = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.ecnpkts");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "ecnpkts", NULL, "ecn", NULL, "IPv4 ECN Statistics"
@@ -386,8 +386,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_tcpext_memory == CONFIG_ONDEMAND_YES || (do_tcpext_memory == CONFIG_ONDEMAND_ONDEMAND && (tcpext_TCPMemoryPressures))) {
-                do_tcpext_memory = CONFIG_ONDEMAND_YES;
+            if(do_tcpext_memory == CONFIG_BOOLEAN_YES || (do_tcpext_memory == CONFIG_BOOLEAN_AUTO && (tcpext_TCPMemoryPressures))) {
+                do_tcpext_memory = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpmemorypressures");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpmemorypressures", NULL, "tcp", NULL, "TCP Memory Pressures"
@@ -403,8 +403,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_tcpext_connaborts == CONFIG_ONDEMAND_YES || (do_tcpext_connaborts == CONFIG_ONDEMAND_ONDEMAND && (tcpext_TCPAbortOnData || tcpext_TCPAbortOnClose || tcpext_TCPAbortOnMemory || tcpext_TCPAbortOnTimeout || tcpext_TCPAbortOnLinger || tcpext_TCPAbortFailed))) {
-                do_tcpext_connaborts = CONFIG_ONDEMAND_YES;
+            if(do_tcpext_connaborts == CONFIG_BOOLEAN_YES || (do_tcpext_connaborts == CONFIG_BOOLEAN_AUTO && (tcpext_TCPAbortOnData || tcpext_TCPAbortOnClose || tcpext_TCPAbortOnMemory || tcpext_TCPAbortOnTimeout || tcpext_TCPAbortOnLinger || tcpext_TCPAbortFailed))) {
+                do_tcpext_connaborts = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpconnaborts");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpconnaborts", NULL, "tcp", NULL, "TCP Connection Aborts"
@@ -429,8 +429,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
             }
             // --------------------------------------------------------------------
 
-            if(do_tcpext_reorder == CONFIG_ONDEMAND_YES || (do_tcpext_reorder == CONFIG_ONDEMAND_ONDEMAND && (tcpext_TCPRenoReorder || tcpext_TCPFACKReorder || tcpext_TCPSACKReorder || tcpext_TCPTSReorder))) {
-                do_tcpext_reorder = CONFIG_ONDEMAND_YES;
+            if(do_tcpext_reorder == CONFIG_BOOLEAN_YES || (do_tcpext_reorder == CONFIG_BOOLEAN_AUTO && (tcpext_TCPRenoReorder || tcpext_TCPFACKReorder || tcpext_TCPSACKReorder || tcpext_TCPTSReorder))) {
+                do_tcpext_reorder = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpreorders");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpreorders", NULL, "tcp", NULL
@@ -453,8 +453,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_tcpext_ofo == CONFIG_ONDEMAND_YES || (do_tcpext_ofo == CONFIG_ONDEMAND_ONDEMAND && (tcpext_TCPOFOQueue || tcpext_TCPOFODrop || tcpext_TCPOFOMerge))) {
-                do_tcpext_ofo = CONFIG_ONDEMAND_YES;
+            if(do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO && (tcpext_TCPOFOQueue || tcpext_TCPOFODrop || tcpext_TCPOFOMerge))) {
+                do_tcpext_ofo = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpofo");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpofo", NULL, "tcp", NULL, "TCP Out-Of-Order Queue"
@@ -476,8 +476,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
             // --------------------------------------------------------------------
 
-            if(do_tcpext_syscookies == CONFIG_ONDEMAND_YES || (do_tcpext_syscookies == CONFIG_ONDEMAND_ONDEMAND && (tcpext_SyncookiesSent || tcpext_SyncookiesRecv || tcpext_SyncookiesFailed))) {
-                do_tcpext_syscookies = CONFIG_ONDEMAND_YES;
+            if(do_tcpext_syscookies == CONFIG_BOOLEAN_YES || (do_tcpext_syscookies == CONFIG_BOOLEAN_AUTO && (tcpext_SyncookiesSent || tcpext_SyncookiesRecv || tcpext_SyncookiesFailed))) {
+                do_tcpext_syscookies = CONFIG_BOOLEAN_YES;
                 st = rrdset_find_localhost("ipv4.tcpsyncookies");
                 if(unlikely(!st)) {
                     st = rrdset_create_localhost("ipv4", "tcpsyncookies", NULL, "tcp", NULL, "TCP SYN Cookies"
index 46c21f242dbd9346fbc6bd1cc68201760700f327..8c4581c1b57aa345287b720d2feb34d9a8ce4c48 100644 (file)
@@ -126,28 +126,28 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
     static unsigned long long UdpLite6InCsumErrors = 0ULL;
 
     if(unlikely(!arl_base)) {
-        do_ip_packets       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip_fragsout      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip_fragsin       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_ONDEMAND_ONDEMAND);
-        do_ip_errors        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_udp_packets      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_udp_errors       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_udplite_packets  = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_udplite_errors   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_bandwidth        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_mcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_bcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_ONDEMAND_ONDEMAND);
-        do_mcast_p          = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp             = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_redir       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_errors      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_echos       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_groupmemb   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_router      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_neighbor    = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_mldv2       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_ONDEMAND_ONDEMAND);
-        do_icmp_types       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_ONDEMAND_ONDEMAND);
-        do_ect              = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_ONDEMAND_ONDEMAND);
+        do_ip_packets       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
+        do_ip_fragsout      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
+        do_ip_fragsin       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
+        do_ip_errors        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
+        do_udp_packets      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_BOOLEAN_AUTO);
+        do_udp_errors       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_BOOLEAN_AUTO);
+        do_udplite_packets  = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_BOOLEAN_AUTO);
+        do_udplite_errors   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_BOOLEAN_AUTO);
+        do_bandwidth        = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_mcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_bcast            = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
+        do_mcast_p          = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_BOOLEAN_AUTO);
+        do_icmp             = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_BOOLEAN_AUTO);
+        do_icmp_redir       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_BOOLEAN_AUTO);
+        do_icmp_errors      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_BOOLEAN_AUTO);
+        do_icmp_echos       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_BOOLEAN_AUTO);
+        do_icmp_groupmemb   = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_BOOLEAN_AUTO);
+        do_icmp_router      = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_BOOLEAN_AUTO);
+        do_icmp_neighbor    = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
+        do_icmp_mldv2       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_BOOLEAN_AUTO);
+        do_icmp_types       = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_BOOLEAN_AUTO);
+        do_ect              = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_BOOLEAN_AUTO);
 
         arl_base = arl_create("snmp6", NULL, 60);
         arl_expect(arl_base, "Ip6InReceives", &Ip6InReceives);
@@ -276,8 +276,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_bandwidth == CONFIG_ONDEMAND_YES || (do_bandwidth == CONFIG_ONDEMAND_ONDEMAND && (Ip6InOctets || Ip6OutOctets))) {
-        do_bandwidth = CONFIG_ONDEMAND_YES;
+    if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO && (Ip6InOctets || Ip6OutOctets))) {
+        do_bandwidth = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost("system.ipv6");
         if(unlikely(!st)) {
             st = rrdset_create_localhost("system", "ipv6", NULL, "network", NULL, "IPv6 Bandwidth", "kilobits/s", 500
@@ -295,8 +295,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ip_packets == CONFIG_ONDEMAND_YES || (do_ip_packets == CONFIG_ONDEMAND_ONDEMAND && (Ip6InReceives || Ip6OutRequests || Ip6InDelivers || Ip6OutForwDatagrams))) {
-        do_ip_packets = CONFIG_ONDEMAND_YES;
+    if(do_ip_packets == CONFIG_BOOLEAN_YES || (do_ip_packets == CONFIG_BOOLEAN_AUTO && (Ip6InReceives || Ip6OutRequests || Ip6InDelivers || Ip6OutForwDatagrams))) {
+        do_ip_packets = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".packets");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "packets", NULL, "packets", NULL, "IPv6 Packets"
@@ -318,8 +318,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ip_fragsout == CONFIG_ONDEMAND_YES || (do_ip_fragsout == CONFIG_ONDEMAND_ONDEMAND && (Ip6FragOKs || Ip6FragFails || Ip6FragCreates))) {
-        do_ip_fragsout = CONFIG_ONDEMAND_YES;
+    if(do_ip_fragsout == CONFIG_BOOLEAN_YES || (do_ip_fragsout == CONFIG_BOOLEAN_AUTO && (Ip6FragOKs || Ip6FragFails || Ip6FragCreates))) {
+        do_ip_fragsout = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".fragsout");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "fragsout", NULL, "fragments", NULL, "IPv6 Fragments Sent"
@@ -340,14 +340,14 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ip_fragsin == CONFIG_ONDEMAND_YES || (do_ip_fragsin == CONFIG_ONDEMAND_ONDEMAND
+    if(do_ip_fragsin == CONFIG_BOOLEAN_YES || (do_ip_fragsin == CONFIG_BOOLEAN_AUTO
         && (
             Ip6ReasmOKs
             || Ip6ReasmFails
             || Ip6ReasmTimeout
             || Ip6ReasmReqds
             ))) {
-        do_ip_fragsin = CONFIG_ONDEMAND_YES;
+        do_ip_fragsin = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".fragsin");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "fragsin", NULL, "fragments", NULL
@@ -371,7 +371,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ip_errors == CONFIG_ONDEMAND_YES || (do_ip_errors == CONFIG_ONDEMAND_ONDEMAND
+    if(do_ip_errors == CONFIG_BOOLEAN_YES || (do_ip_errors == CONFIG_BOOLEAN_AUTO
         && (
             Ip6InDiscards
             || Ip6OutDiscards
@@ -382,7 +382,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Ip6InTruncatedPkts
             || Ip6InNoRoutes
         ))) {
-        do_ip_errors = CONFIG_ONDEMAND_YES;
+        do_ip_errors = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".errors");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "errors", NULL, "errors", NULL, "IPv6 Errors", "packets/s"
@@ -419,8 +419,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_udp_packets == CONFIG_ONDEMAND_YES || (do_udp_packets == CONFIG_ONDEMAND_ONDEMAND && (Udp6InDatagrams || Udp6OutDatagrams))) {
-        do_udp_packets = CONFIG_ONDEMAND_YES;
+    if(do_udp_packets == CONFIG_BOOLEAN_YES || (do_udp_packets == CONFIG_BOOLEAN_AUTO && (Udp6InDatagrams || Udp6OutDatagrams))) {
+        do_udp_packets = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udppackets");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "udppackets", NULL, "udp", NULL, "IPv6 UDP Packets"
@@ -438,7 +438,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_udp_errors == CONFIG_ONDEMAND_YES || (do_udp_errors == CONFIG_ONDEMAND_ONDEMAND
+    if(do_udp_errors == CONFIG_BOOLEAN_YES || (do_udp_errors == CONFIG_BOOLEAN_AUTO
         && (
             Udp6InErrors
             || Udp6NoPorts
@@ -447,7 +447,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Udp6InCsumErrors
             || Udp6IgnoredMulti
         ))) {
-        do_udp_errors = CONFIG_ONDEMAND_YES;
+        do_udp_errors = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udperrors");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "udperrors", NULL, "udp", NULL, "IPv6 UDP Errors"
@@ -474,8 +474,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_udplite_packets == CONFIG_ONDEMAND_YES || (do_udplite_packets == CONFIG_ONDEMAND_ONDEMAND && (UdpLite6InDatagrams || UdpLite6OutDatagrams))) {
-        do_udplite_packets = CONFIG_ONDEMAND_YES;
+    if(do_udplite_packets == CONFIG_BOOLEAN_YES || (do_udplite_packets == CONFIG_BOOLEAN_AUTO && (UdpLite6InDatagrams || UdpLite6OutDatagrams))) {
+        do_udplite_packets = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udplitepackets");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "udplitepackets", NULL, "udplite", NULL
@@ -493,7 +493,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_udplite_errors == CONFIG_ONDEMAND_YES || (do_udplite_errors == CONFIG_ONDEMAND_ONDEMAND
+    if(do_udplite_errors == CONFIG_BOOLEAN_YES || (do_udplite_errors == CONFIG_BOOLEAN_AUTO
         && (
             UdpLite6InErrors
             || UdpLite6NoPorts
@@ -502,7 +502,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Udp6InCsumErrors
             || UdpLite6InCsumErrors
         ))) {
-        do_udplite_errors = CONFIG_ONDEMAND_YES;
+        do_udplite_errors = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".udpliteerrors");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "udpliteerrors", NULL, "udplite", NULL
@@ -527,8 +527,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_mcast == CONFIG_ONDEMAND_YES || (do_mcast == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutMcastOctets || Ip6InMcastOctets))) {
-        do_mcast = CONFIG_ONDEMAND_YES;
+    if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO && (Ip6OutMcastOctets || Ip6InMcastOctets))) {
+        do_mcast = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".mcast");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "mcast", NULL, "multicast", NULL
@@ -548,8 +548,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_bcast == CONFIG_ONDEMAND_YES || (do_bcast == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutBcastOctets || Ip6InBcastOctets))) {
-        do_bcast = CONFIG_ONDEMAND_YES;
+    if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO && (Ip6OutBcastOctets || Ip6InBcastOctets))) {
+        do_bcast = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".bcast");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "bcast", NULL, "broadcast", NULL
@@ -569,8 +569,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_mcast_p == CONFIG_ONDEMAND_YES || (do_mcast_p == CONFIG_ONDEMAND_ONDEMAND && (Ip6OutMcastPkts || Ip6InMcastPkts))) {
-        do_mcast_p = CONFIG_ONDEMAND_YES;
+    if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO && (Ip6OutMcastPkts || Ip6InMcastPkts))) {
+        do_mcast_p = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".mcastpkts");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "mcastpkts", NULL, "multicast", NULL
@@ -589,8 +589,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp == CONFIG_ONDEMAND_YES || (do_icmp == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InMsgs || Icmp6OutMsgs))) {
-        do_icmp = CONFIG_ONDEMAND_YES;
+    if(do_icmp == CONFIG_BOOLEAN_YES || (do_icmp == CONFIG_BOOLEAN_AUTO && (Icmp6InMsgs || Icmp6OutMsgs))) {
+        do_icmp = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmp");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages"
@@ -608,8 +608,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_redir == CONFIG_ONDEMAND_YES || (do_icmp_redir == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InRedirects || Icmp6OutRedirects))) {
-        do_icmp_redir = CONFIG_ONDEMAND_YES;
+    if(do_icmp_redir == CONFIG_BOOLEAN_YES || (do_icmp_redir == CONFIG_BOOLEAN_AUTO && (Icmp6InRedirects || Icmp6OutRedirects))) {
+        do_icmp_redir = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpredir");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects"
@@ -627,7 +627,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_errors == CONFIG_ONDEMAND_YES || (do_icmp_errors == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_errors == CONFIG_BOOLEAN_YES || (do_icmp_errors == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InErrors
             || Icmp6OutErrors
@@ -641,7 +641,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Icmp6OutTimeExcds
             || Icmp6OutParmProblems
         ))) {
-        do_icmp_errors = CONFIG_ONDEMAND_YES;
+        do_icmp_errors = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmperrors");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors"
@@ -678,14 +678,14 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_echos == CONFIG_ONDEMAND_YES || (do_icmp_echos == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_echos == CONFIG_BOOLEAN_YES || (do_icmp_echos == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InEchos
             || Icmp6OutEchos
             || Icmp6InEchoReplies
             || Icmp6OutEchoReplies
         ))) {
-        do_icmp_echos = CONFIG_ONDEMAND_YES;
+        do_icmp_echos = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpechos");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo"
@@ -707,7 +707,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_groupmemb == CONFIG_ONDEMAND_YES || (do_icmp_groupmemb == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_groupmemb == CONFIG_BOOLEAN_YES || (do_icmp_groupmemb == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InGroupMembQueries
             || Icmp6OutGroupMembQueries
@@ -716,7 +716,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Icmp6InGroupMembReductions
             || Icmp6OutGroupMembReductions
         ))) {
-        do_icmp_groupmemb = CONFIG_ONDEMAND_YES;
+        do_icmp_groupmemb = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".groupmemb");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "groupmemb", NULL, "icmp", NULL
@@ -743,14 +743,14 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_router == CONFIG_ONDEMAND_YES || (do_icmp_router == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_router == CONFIG_BOOLEAN_YES || (do_icmp_router == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InRouterSolicits
             || Icmp6OutRouterSolicits
             || Icmp6InRouterAdvertisements
             || Icmp6OutRouterAdvertisements
         ))) {
-        do_icmp_router = CONFIG_ONDEMAND_YES;
+        do_icmp_router = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmprouter");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages"
@@ -772,14 +772,14 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_neighbor == CONFIG_ONDEMAND_YES || (do_icmp_neighbor == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_neighbor == CONFIG_BOOLEAN_YES || (do_icmp_neighbor == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InNeighborSolicits
             || Icmp6OutNeighborSolicits
             || Icmp6InNeighborAdvertisements
             || Icmp6OutNeighborAdvertisements
         ))) {
-        do_icmp_neighbor = CONFIG_ONDEMAND_YES;
+        do_icmp_neighbor = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpneighbor");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmpneighbor", NULL, "icmp", NULL
@@ -802,8 +802,8 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_mldv2 == CONFIG_ONDEMAND_YES || (do_icmp_mldv2 == CONFIG_ONDEMAND_ONDEMAND && (Icmp6InMLDv2Reports || Icmp6OutMLDv2Reports))) {
-        do_icmp_mldv2 = CONFIG_ONDEMAND_YES;
+    if(do_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_icmp_mldv2 == CONFIG_BOOLEAN_AUTO && (Icmp6InMLDv2Reports || Icmp6OutMLDv2Reports))) {
+        do_icmp_mldv2 = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmpmldv2");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmpmldv2", NULL, "icmp", NULL, "IPv6 ICMP MLDv2 Reports"
@@ -821,7 +821,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_icmp_types == CONFIG_ONDEMAND_YES || (do_icmp_types == CONFIG_ONDEMAND_ONDEMAND
+    if(do_icmp_types == CONFIG_BOOLEAN_YES || (do_icmp_types == CONFIG_BOOLEAN_AUTO
         && (
             Icmp6InType1
             || Icmp6InType128
@@ -834,7 +834,7 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
             || Icmp6OutType135
             || Icmp6OutType143
         ))) {
-        do_icmp_types = CONFIG_ONDEMAND_YES;
+        do_icmp_types = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".icmptypes");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types"
@@ -868,14 +868,14 @@ int do_proc_net_snmp6(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ect == CONFIG_ONDEMAND_YES || (do_ect == CONFIG_ONDEMAND_ONDEMAND
+    if(do_ect == CONFIG_BOOLEAN_YES || (do_ect == CONFIG_BOOLEAN_AUTO
         && (
             Ip6InNoECTPkts
             || Ip6InECT1Pkts
             || Ip6InECT0Pkts
             || Ip6InCEPkts
         ))) {
-        do_ect = CONFIG_ONDEMAND_YES;
+        do_ect = CONFIG_BOOLEAN_YES;
         st = rrdset_find_localhost(RRD_TYPE_NET_SNMP6 ".ect");
         if(unlikely(!st)) {
             st = rrdset_create_localhost(RRD_TYPE_NET_SNMP6, "ect", NULL, "packets", NULL, "IPv6 ECT Packets"
index 39576bc686bd949a8b59dd51170a9a09921bfbc2..5a1fc30eb7f2bd1872817e7dbdd63ac35f571e8f 100644 (file)
@@ -10,10 +10,10 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
     static procfile *ff = NULL;
 
     if(unlikely(do_entries == -1)) {
-        do_entries  = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY entries", CONFIG_ONDEMAND_ONDEMAND);
-        do_cookies  = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY cookies", CONFIG_ONDEMAND_ONDEMAND);
-        do_syns     = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY SYN received", CONFIG_ONDEMAND_ONDEMAND);
-        do_reopened = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY connections reopened", CONFIG_ONDEMAND_ONDEMAND);
+        do_entries  = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY entries", CONFIG_BOOLEAN_AUTO);
+        do_cookies  = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY cookies", CONFIG_BOOLEAN_AUTO);
+        do_syns     = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY SYN received", CONFIG_BOOLEAN_AUTO);
+        do_reopened = config_get_boolean_ondemand("plugin:proc:/proc/net/stat/synproxy", "SYNPROXY connections reopened", CONFIG_BOOLEAN_AUTO);
     }
 
     if(unlikely(!ff)) {
@@ -57,8 +57,8 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if((do_entries == CONFIG_ONDEMAND_ONDEMAND && events) || do_entries == CONFIG_ONDEMAND_YES) {
-        do_entries = CONFIG_ONDEMAND_YES;
+    if((do_entries == CONFIG_BOOLEAN_AUTO && events) || do_entries == CONFIG_BOOLEAN_YES) {
+        do_entries = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_entries");
         if(unlikely(!st)) {
@@ -76,8 +76,8 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if((do_syns == CONFIG_ONDEMAND_ONDEMAND && events) || do_syns == CONFIG_ONDEMAND_YES) {
-        do_syns = CONFIG_ONDEMAND_YES;
+    if((do_syns == CONFIG_BOOLEAN_AUTO && events) || do_syns == CONFIG_BOOLEAN_YES) {
+        do_syns = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_syn_received");
         if(unlikely(!st)) {
@@ -95,8 +95,8 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if((do_reopened == CONFIG_ONDEMAND_ONDEMAND && events) || do_reopened == CONFIG_ONDEMAND_YES) {
-        do_reopened = CONFIG_ONDEMAND_YES;
+    if((do_reopened == CONFIG_BOOLEAN_AUTO && events) || do_reopened == CONFIG_BOOLEAN_YES) {
+        do_reopened = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_conn_reopened");
         if(unlikely(!st)) {
@@ -114,8 +114,8 @@ int do_proc_net_stat_synproxy(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if((do_cookies == CONFIG_ONDEMAND_ONDEMAND && events) || do_cookies == CONFIG_ONDEMAND_YES) {
-        do_cookies = CONFIG_ONDEMAND_YES;
+    if((do_cookies == CONFIG_BOOLEAN_AUTO && events) || do_cookies == CONFIG_BOOLEAN_YES) {
+        do_cookies = CONFIG_BOOLEAN_YES;
 
         st = rrdset_find_localhost(RRD_TYPE_NET_STAT_NETFILTER "." RRD_TYPE_NET_STAT_SYNPROXY "_cookies");
         if(unlikely(!st)) {
index 8a04cd34836e7a25cdba050a77d6c820efbe1ac1..847487363e6b7218cb2cbc1b6ef4e9d463bcb216 100644 (file)
@@ -25,10 +25,10 @@ int do_proc_vmstat(int update_every, usec_t dt) {
     static unsigned long long pswpout = 0ULL;
 
     if(unlikely(!arl_base)) {
-        do_swapio = config_get_boolean_ondemand("plugin:proc:/proc/vmstat", "swap i/o", CONFIG_ONDEMAND_ONDEMAND);
+        do_swapio = config_get_boolean_ondemand("plugin:proc:/proc/vmstat", "swap i/o", CONFIG_BOOLEAN_AUTO);
         do_io = config_get_boolean("plugin:proc:/proc/vmstat", "disk i/o", 1);
         do_pgfaults = config_get_boolean("plugin:proc:/proc/vmstat", "memory page faults", 1);
-        do_numa = config_get_boolean_ondemand("plugin:proc:/proc/vmstat", "system-wide numa metric summary", CONFIG_ONDEMAND_ONDEMAND);
+        do_numa = config_get_boolean_ondemand("plugin:proc:/proc/vmstat", "system-wide numa metric summary", CONFIG_BOOLEAN_AUTO);
 
 
         arl_base = arl_create("vmstat", NULL, 60);
@@ -39,7 +39,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
         arl_expect(arl_base, "pswpin", &pswpin);
         arl_expect(arl_base, "pswpout", &pswpout);
 
-        if(do_numa == CONFIG_ONDEMAND_YES || (do_numa == CONFIG_ONDEMAND_ONDEMAND && get_numa_node_count() >= 2)) {
+        if(do_numa == CONFIG_BOOLEAN_YES || (do_numa == CONFIG_BOOLEAN_AUTO && get_numa_node_count() >= 2)) {
             arl_expect(arl_base, "numa_foreign", &numa_foreign);
             arl_expect(arl_base, "numa_hint_faults_local", &numa_hint_faults_local);
             arl_expect(arl_base, "numa_hint_faults", &numa_hint_faults);
@@ -56,7 +56,7 @@ int do_proc_vmstat(int update_every, usec_t dt) {
             // when all the expected metrics are collected.
             // Also ARL will not parse their values.
             has_numa = 0;
-            do_numa = CONFIG_ONDEMAND_NO;
+            do_numa = CONFIG_BOOLEAN_NO;
         }
     }
 
@@ -87,8 +87,8 @@ int do_proc_vmstat(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(pswpin || pswpout || do_swapio == CONFIG_ONDEMAND_YES) {
-        do_swapio = CONFIG_ONDEMAND_YES;
+    if(pswpin || pswpout || do_swapio == CONFIG_BOOLEAN_YES) {
+        do_swapio = CONFIG_BOOLEAN_YES;
 
         static RRDSET *st_swapio = NULL;
         if(unlikely(!st_swapio)) {
@@ -152,8 +152,8 @@ int do_proc_vmstat(int update_every, usec_t dt) {
         has_numa = (numa_local || numa_foreign || numa_interleave || numa_other || numa_pte_updates ||
                      numa_huge_pte_updates || numa_hint_faults || numa_hint_faults_local || numa_pages_migrated) ? 1 : 0;
 
-    if(do_numa == CONFIG_ONDEMAND_YES || (do_numa == CONFIG_ONDEMAND_ONDEMAND && has_numa)) {
-        do_numa = CONFIG_ONDEMAND_YES;
+    if(do_numa == CONFIG_BOOLEAN_YES || (do_numa == CONFIG_BOOLEAN_AUTO && has_numa)) {
+        do_numa = CONFIG_BOOLEAN_YES;
 
         static RRDSET *st_numa = NULL;
         if(unlikely(!st_numa)) {
index e1f49635e72df89c80eeb0f55ac106d0a01488ff..c41ad7faa1d9401926343fa9132ede7fa0c4f831 100644 (file)
@@ -76,11 +76,11 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
     struct mc *m;
 
     if(unlikely(do_ce == -1)) {
-        do_ce = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/edac/mc", "enable ECC memory correctable errors", CONFIG_ONDEMAND_ONDEMAND);
-        do_ue = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/edac/mc", "enable ECC memory uncorrectable errors", CONFIG_ONDEMAND_ONDEMAND);
+        do_ce = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/edac/mc", "enable ECC memory correctable errors", CONFIG_BOOLEAN_AUTO);
+        do_ue = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/edac/mc", "enable ECC memory uncorrectable errors", CONFIG_BOOLEAN_AUTO);
     }
 
-    if(do_ce != CONFIG_ONDEMAND_NO) {
+    if(do_ce != CONFIG_BOOLEAN_NO) {
         for(m = mc_root; m; m = m->next) {
             if(m->ce_count_filename) {
                 m->ce_updated = 0;
@@ -102,7 +102,7 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
         }
     }
 
-    if(do_ue != CONFIG_ONDEMAND_NO) {
+    if(do_ue != CONFIG_BOOLEAN_NO) {
         for(m = mc_root; m; m = m->next) {
             if(m->ue_count_filename) {
                 m->ue_updated = 0;
@@ -126,8 +126,8 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ce == CONFIG_ONDEMAND_YES || (do_ce == CONFIG_ONDEMAND_ONDEMAND && ce_sum > 0)) {
-        do_ce = CONFIG_ONDEMAND_YES;
+    if(do_ce == CONFIG_BOOLEAN_YES || (do_ce == CONFIG_BOOLEAN_AUTO && ce_sum > 0)) {
+        do_ce = CONFIG_BOOLEAN_YES;
 
         static RRDSET *ce_st = NULL;
 
@@ -153,8 +153,8 @@ int do_proc_sys_devices_system_edac_mc(int update_every, usec_t dt) {
 
     // --------------------------------------------------------------------
 
-    if(do_ue == CONFIG_ONDEMAND_YES || (do_ue == CONFIG_ONDEMAND_ONDEMAND && ue_sum > 0)) {
-        do_ue = CONFIG_ONDEMAND_YES;
+    if(do_ue == CONFIG_BOOLEAN_YES || (do_ue == CONFIG_BOOLEAN_AUTO && ue_sum > 0)) {
+        do_ue = CONFIG_BOOLEAN_YES;
 
         static RRDSET *ue_st = NULL;
 
index 341fc4b89ace57f3db31fd7c7f3056aacb68efb0..449bbf0ded7e39ae8bf30baee0717a4ade000fa1 100644 (file)
@@ -72,10 +72,10 @@ int do_proc_sys_devices_system_node(int update_every, usec_t dt) {
     struct node *m;
 
     if(unlikely(do_numastat == -1)) {
-        do_numastat = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/node", "enable per-node numa metrics", CONFIG_ONDEMAND_ONDEMAND);
+        do_numastat = config_get_boolean_ondemand("plugin:proc:/sys/devices/system/node", "enable per-node numa metrics", CONFIG_BOOLEAN_AUTO);
     }
 
-    if(do_numastat == CONFIG_ONDEMAND_YES || (do_numastat == CONFIG_ONDEMAND_ONDEMAND && numa_node_count >= 2)) {
+    if(do_numastat == CONFIG_BOOLEAN_YES || (do_numastat == CONFIG_BOOLEAN_AUTO && numa_node_count >= 2)) {
         for(m = numa_root; m; m = m->next) {
             if(m->numastat_filename) {
                 if(unlikely(!m->numastat_ff)) {
index 50a8e622bbe194aa8be39165c587443fef4652bd..7981804a6253198a3471d9fe2d79b390162f9f43 100644 (file)
@@ -8,22 +8,22 @@
 
 static long system_page_size = 4096; // system will be queried via sysconf() in configuration()
 
-static int cgroup_enable_cpuacct_stat = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_cpuacct_usage = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_memory = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_detailed_memory = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_memory_failcnt = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_swap = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_io = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_ops = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_throttle_io = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_throttle_ops = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_merged_ops = CONFIG_ONDEMAND_ONDEMAND;
-static int cgroup_enable_blkio_queued_ops = CONFIG_ONDEMAND_ONDEMAND;
-
-static int cgroup_enable_systemd_services = CONFIG_ONDEMAND_YES;
-static int cgroup_enable_systemd_services_detailed_memory = CONFIG_ONDEMAND_NO;
-static int cgroup_used_memory_without_cache = CONFIG_ONDEMAND_YES;
+static int cgroup_enable_cpuacct_stat = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_cpuacct_usage = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_memory = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_detailed_memory = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_memory_failcnt = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_swap = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_io = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_ops = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_throttle_io = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_throttle_ops = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_merged_ops = CONFIG_BOOLEAN_AUTO;
+static int cgroup_enable_blkio_queued_ops = CONFIG_BOOLEAN_AUTO;
+
+static int cgroup_enable_systemd_services = CONFIG_BOOLEAN_YES;
+static int cgroup_enable_systemd_services_detailed_memory = CONFIG_BOOLEAN_NO;
+static int cgroup_used_memory_without_cache = CONFIG_BOOLEAN_YES;
 
 static int cgroup_search_in_devices = 1;
 
@@ -211,7 +211,7 @@ void read_cgroup_plugin_configuration() {
 
 struct blkio {
     int updated;
-    int enabled; // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
+    int enabled; // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
     int delay_counter;
 
     char *filename;
@@ -236,10 +236,10 @@ struct memory {
     int updated_msw_usage_in_bytes;
     int updated_failcnt;
 
-    int enabled_detailed;           // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
-    int enabled_usage_in_bytes;     // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
-    int enabled_msw_usage_in_bytes; // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
-    int enabled_failcnt;            // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
+    int enabled_detailed;           // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
+    int enabled_usage_in_bytes;     // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
+    int enabled_msw_usage_in_bytes; // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
+    int enabled_failcnt;            // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
 
     int delay_counter_detailed;
     int delay_counter_failcnt;
@@ -298,7 +298,7 @@ struct memory {
 // https://www.kernel.org/doc/Documentation/cgroup-v1/cpuacct.txt
 struct cpuacct_stat {
     int updated;
-    int enabled; // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
+    int enabled; // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
 
     char *filename;
 
@@ -309,7 +309,7 @@ struct cpuacct_stat {
 // https://www.kernel.org/doc/Documentation/cgroup-v1/cpuacct.txt
 struct cpuacct_usage {
     int updated;
-    int enabled; // CONFIG_ONDEMAND_YES or CONFIG_ONDEMAND_ONDEMAND
+    int enabled; // CONFIG_BOOLEAN_YES or CONFIG_BOOLEAN_AUTO
 
     char *filename;
 
@@ -437,8 +437,8 @@ static inline void cgroup_read_cpuacct_stat(struct cpuacct_stat *cp) {
 
         cp->updated = 1;
 
-        if(unlikely(cp->enabled == CONFIG_ONDEMAND_ONDEMAND && (cp->user || cp->system)))
-            cp->enabled = CONFIG_ONDEMAND_YES;
+        if(unlikely(cp->enabled == CONFIG_BOOLEAN_AUTO && (cp->user || cp->system)))
+            cp->enabled = CONFIG_BOOLEAN_YES;
     }
 }
 
@@ -492,15 +492,15 @@ static inline void cgroup_read_cpuacct_usage(struct cpuacct_usage *ca) {
 
         ca->updated = 1;
 
-        if(unlikely(ca->enabled == CONFIG_ONDEMAND_ONDEMAND && total))
-            ca->enabled = CONFIG_ONDEMAND_YES;
+        if(unlikely(ca->enabled == CONFIG_BOOLEAN_AUTO && total))
+            ca->enabled = CONFIG_BOOLEAN_YES;
     }
 }
 
 static inline void cgroup_read_blkio(struct blkio *io) {
     static procfile *ff = NULL;
 
-    if(unlikely(io->enabled == CONFIG_ONDEMAND_ONDEMAND && io->delay_counter > 0)) {
+    if(unlikely(io->enabled == CONFIG_BOOLEAN_AUTO && io->delay_counter > 0)) {
         io->delay_counter--;
         return;
     }
@@ -558,9 +558,9 @@ static inline void cgroup_read_blkio(struct blkio *io) {
 
         io->updated = 1;
 
-        if(unlikely(io->enabled == CONFIG_ONDEMAND_ONDEMAND)) {
+        if(unlikely(io->enabled == CONFIG_BOOLEAN_AUTO)) {
             if(unlikely(io->Read || io->Write))
-                io->enabled = CONFIG_ONDEMAND_YES;
+                io->enabled = CONFIG_BOOLEAN_YES;
             else
                 io->delay_counter = cgroup_recheck_zero_blkio_every_iterations;
         }
@@ -572,7 +572,7 @@ static inline void cgroup_read_memory(struct memory *mem) {
 
     // read detailed ram usage
     if(likely(mem->filename_detailed)) {
-        if(unlikely(mem->enabled_detailed == CONFIG_ONDEMAND_ONDEMAND && mem->delay_counter_detailed > 0)) {
+        if(unlikely(mem->enabled_detailed == CONFIG_BOOLEAN_AUTO && mem->delay_counter_detailed > 0)) {
             mem->delay_counter_detailed--;
             goto memory_next;
         }
@@ -631,9 +631,9 @@ static inline void cgroup_read_memory(struct memory *mem) {
 
         mem->updated_detailed = 1;
 
-        if(unlikely(mem->enabled_detailed == CONFIG_ONDEMAND_ONDEMAND)) {
+        if(unlikely(mem->enabled_detailed == CONFIG_BOOLEAN_AUTO)) {
             if(mem->cache || mem->dirty || mem->rss || mem->rss_huge || mem->mapped_file || mem->writeback || mem->swap || mem->pgpgin || mem->pgpgout || mem->pgfault || mem->pgmajfault)
-                mem->enabled_detailed = CONFIG_ONDEMAND_YES;
+                mem->enabled_detailed = CONFIG_BOOLEAN_YES;
             else
                 mem->delay_counter_detailed = cgroup_recheck_zero_mem_detailed_every_iterations;
         }
@@ -644,30 +644,30 @@ memory_next:
     // read usage_in_bytes
     if(likely(mem->filename_usage_in_bytes)) {
         mem->updated_usage_in_bytes = !read_single_number_file(mem->filename_usage_in_bytes, &mem->usage_in_bytes);
-        if(unlikely(mem->updated_usage_in_bytes && mem->enabled_usage_in_bytes == CONFIG_ONDEMAND_ONDEMAND && mem->usage_in_bytes))
-            mem->enabled_usage_in_bytes = CONFIG_ONDEMAND_YES;
+        if(unlikely(mem->updated_usage_in_bytes && mem->enabled_usage_in_bytes == CONFIG_BOOLEAN_AUTO && mem->usage_in_bytes))
+            mem->enabled_usage_in_bytes = CONFIG_BOOLEAN_YES;
     }
 
     // read msw_usage_in_bytes
     if(likely(mem->filename_msw_usage_in_bytes)) {
         mem->updated_msw_usage_in_bytes = !read_single_number_file(mem->filename_msw_usage_in_bytes, &mem->msw_usage_in_bytes);
-        if(unlikely(mem->updated_msw_usage_in_bytes && mem->enabled_msw_usage_in_bytes == CONFIG_ONDEMAND_ONDEMAND && mem->msw_usage_in_bytes))
-            mem->enabled_msw_usage_in_bytes = CONFIG_ONDEMAND_YES;
+        if(unlikely(mem->updated_msw_usage_in_bytes && mem->enabled_msw_usage_in_bytes == CONFIG_BOOLEAN_AUTO && mem->msw_usage_in_bytes))
+            mem->enabled_msw_usage_in_bytes = CONFIG_BOOLEAN_YES;
     }
 
     // read failcnt
     if(likely(mem->filename_failcnt)) {
-        if(unlikely(mem->enabled_failcnt == CONFIG_ONDEMAND_ONDEMAND && mem->delay_counter_failcnt > 0)) {
+        if(unlikely(mem->enabled_failcnt == CONFIG_BOOLEAN_AUTO && mem->delay_counter_failcnt > 0)) {
             mem->updated_failcnt = 0;
             mem->delay_counter_failcnt--;
         }
         else {
             mem->updated_failcnt = !read_single_number_file(mem->filename_failcnt, &mem->failcnt);
-            if(unlikely(mem->updated_failcnt && mem->enabled_failcnt == CONFIG_ONDEMAND_ONDEMAND)) {
+            if(unlikely(mem->updated_failcnt && mem->enabled_failcnt == CONFIG_BOOLEAN_AUTO)) {
                 if(unlikely(!mem->failcnt))
                     mem->delay_counter_failcnt = cgroup_recheck_zero_mem_failcnt_every_iterations;
                 else
-                    mem->enabled_failcnt = CONFIG_ONDEMAND_YES;
+                    mem->enabled_failcnt = CONFIG_BOOLEAN_YES;
             }
         }
     }
@@ -1074,7 +1074,7 @@ static inline void find_all_cgroups() {
     if(cgroup_enable_cpuacct_stat || cgroup_enable_cpuacct_usage) {
         if(find_dir_in_subdirs(cgroup_cpuacct_base, NULL, found_subdir_in_dir) == -1) {
             cgroup_enable_cpuacct_stat =
-            cgroup_enable_cpuacct_usage = CONFIG_ONDEMAND_NO;
+            cgroup_enable_cpuacct_usage = CONFIG_BOOLEAN_NO;
             error("disabled CGROUP cpu statistics.");
         }
     }
@@ -1086,7 +1086,7 @@ static inline void find_all_cgroups() {
             cgroup_enable_blkio_throttle_io =
             cgroup_enable_blkio_throttle_ops =
             cgroup_enable_blkio_merged_ops =
-            cgroup_enable_blkio_queued_ops = CONFIG_ONDEMAND_NO;
+            cgroup_enable_blkio_queued_ops = CONFIG_BOOLEAN_NO;
             error("disabled CGROUP blkio statistics.");
         }
     }
@@ -1096,7 +1096,7 @@ static inline void find_all_cgroups() {
             cgroup_enable_memory =
             cgroup_enable_detailed_memory =
             cgroup_enable_swap =
-            cgroup_enable_memory_failcnt = CONFIG_ONDEMAND_NO;
+            cgroup_enable_memory_failcnt = CONFIG_BOOLEAN_NO;
             error("disabled CGROUP memory statistics.");
         }
     }
@@ -1150,7 +1150,7 @@ static inline void find_all_cgroups() {
             snprintfz(filename, FILENAME_MAX, "%s%s/memory.stat", cgroup_memory_base, cg->id);
             if(likely(stat(filename, &buf) != -1)) {
                 cg->memory.filename_detailed = strdupz(filename);
-                cg->memory.enabled_detailed = (cgroup_enable_detailed_memory == CONFIG_ONDEMAND_YES)?CONFIG_ONDEMAND_YES:CONFIG_ONDEMAND_ONDEMAND;
+                cg->memory.enabled_detailed = (cgroup_enable_detailed_memory == CONFIG_BOOLEAN_YES)?CONFIG_BOOLEAN_YES:CONFIG_BOOLEAN_AUTO;
                 debug(D_CGROUP, "memory.stat filename for cgroup '%s': '%s'", cg->id, cg->memory.filename_detailed);
             }
             else
@@ -1836,25 +1836,25 @@ void update_cgroup_charts(int update_every) {
             continue;
 
         if(likely(cgroup_enable_systemd_services && cg->options & CGROUP_OPTIONS_SYSTEM_SLICE_SERVICE)) {
-            if(cg->cpuacct_stat.updated && cg->cpuacct_stat.enabled == CONFIG_ONDEMAND_YES) services_do_cpu++;
+            if(cg->cpuacct_stat.updated && cg->cpuacct_stat.enabled == CONFIG_BOOLEAN_YES) services_do_cpu++;
 
             if(cgroup_enable_systemd_services_detailed_memory && cg->memory.updated_detailed && cg->memory.enabled_detailed) services_do_mem_detailed++;
-            if(cg->memory.updated_usage_in_bytes && cg->memory.enabled_usage_in_bytes == CONFIG_ONDEMAND_YES) services_do_mem_usage++;
-            if(cg->memory.updated_failcnt && cg->memory.enabled_failcnt == CONFIG_ONDEMAND_YES) services_do_mem_failcnt++;
-            if(cg->memory.updated_msw_usage_in_bytes && cg->memory.enabled_msw_usage_in_bytes == CONFIG_ONDEMAND_YES) services_do_swap_usage++;
-
-            if(cg->io_service_bytes.updated && cg->io_service_bytes.enabled == CONFIG_ONDEMAND_YES) services_do_io++;
-            if(cg->io_serviced.updated && cg->io_serviced.enabled == CONFIG_ONDEMAND_YES) services_do_io_ops++;
-            if(cg->throttle_io_service_bytes.updated && cg->throttle_io_service_bytes.enabled == CONFIG_ONDEMAND_YES) services_do_throttle_io++;
-            if(cg->throttle_io_serviced.updated && cg->throttle_io_serviced.enabled == CONFIG_ONDEMAND_YES) services_do_throttle_ops++;
-            if(cg->io_queued.updated && cg->io_queued.enabled == CONFIG_ONDEMAND_YES) services_do_queued_ops++;
-            if(cg->io_merged.updated && cg->io_merged.enabled == CONFIG_ONDEMAND_YES) services_do_merged_ops++;
+            if(cg->memory.updated_usage_in_bytes && cg->memory.enabled_usage_in_bytes == CONFIG_BOOLEAN_YES) services_do_mem_usage++;
+            if(cg->memory.updated_failcnt && cg->memory.enabled_failcnt == CONFIG_BOOLEAN_YES) services_do_mem_failcnt++;
+            if(cg->memory.updated_msw_usage_in_bytes && cg->memory.enabled_msw_usage_in_bytes == CONFIG_BOOLEAN_YES) services_do_swap_usage++;
+
+            if(cg->io_service_bytes.updated && cg->io_service_bytes.enabled == CONFIG_BOOLEAN_YES) services_do_io++;
+            if(cg->io_serviced.updated && cg->io_serviced.enabled == CONFIG_BOOLEAN_YES) services_do_io_ops++;
+            if(cg->throttle_io_service_bytes.updated && cg->throttle_io_service_bytes.enabled == CONFIG_BOOLEAN_YES) services_do_throttle_io++;
+            if(cg->throttle_io_serviced.updated && cg->throttle_io_serviced.enabled == CONFIG_BOOLEAN_YES) services_do_throttle_ops++;
+            if(cg->io_queued.updated && cg->io_queued.enabled == CONFIG_BOOLEAN_YES) services_do_queued_ops++;
+            if(cg->io_merged.updated && cg->io_merged.enabled == CONFIG_BOOLEAN_YES) services_do_merged_ops++;
             continue;
         }
 
         type[0] = '\0';
 
-        if(likely(cg->cpuacct_stat.updated && cg->cpuacct_stat.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->cpuacct_stat.updated && cg->cpuacct_stat.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_cpu)) {
                 cg->st_cpu = rrdset_find_bytype_localhost(cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
                                                           , "cpu");
@@ -1874,7 +1874,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_cpu);
         }
 
-        if(likely(cg->cpuacct_usage.updated && cg->cpuacct_usage.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->cpuacct_usage.updated && cg->cpuacct_usage.enabled == CONFIG_BOOLEAN_YES)) {
             char id[RRD_ID_LENGTH_MAX + 1];
             unsigned int i;
 
@@ -1902,7 +1902,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_cpu_per_core);
         }
 
-        if(likely(cg->memory.updated_detailed && cg->memory.enabled_detailed == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->memory.updated_detailed && cg->memory.enabled_detailed == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_mem)) {
                 cg->st_mem = rrdset_find_bytype_localhost(cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
                                                           , "mem");
@@ -1991,7 +1991,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_pgfaults);
         }
 
-        if(likely(cg->memory.updated_usage_in_bytes && cg->memory.enabled_usage_in_bytes == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->memory.updated_usage_in_bytes && cg->memory.enabled_usage_in_bytes == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_mem_usage)) {
                 cg->st_mem_usage = rrdset_find_bytype_localhost(cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX)
                                                                 , "mem_usage");
@@ -2012,7 +2012,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_mem_usage);
         }
 
-        if(likely(cg->memory.updated_failcnt && cg->memory.enabled_failcnt == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->memory.updated_failcnt && cg->memory.enabled_failcnt == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_mem_failcnt)) {
                 cg->st_mem_failcnt = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "mem_failcnt");
@@ -2031,7 +2031,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_mem_failcnt);
         }
 
-        if(likely(cg->io_service_bytes.updated && cg->io_service_bytes.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->io_service_bytes.updated && cg->io_service_bytes.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_io)) {
                 cg->st_io = rrdset_find_bytype_localhost(cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "io");
                 if(likely(!cg->st_io)) {
@@ -2050,7 +2050,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_io);
         }
 
-        if(likely(cg->io_serviced.updated && cg->io_serviced.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->io_serviced.updated && cg->io_serviced.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_serviced_ops)) {
                 cg->st_serviced_ops = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "serviced_ops");
@@ -2071,7 +2071,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_serviced_ops);
         }
 
-        if(likely(cg->throttle_io_service_bytes.updated && cg->throttle_io_service_bytes.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->throttle_io_service_bytes.updated && cg->throttle_io_service_bytes.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_throttle_io)) {
                 cg->st_throttle_io = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "throttle_io");
@@ -2092,7 +2092,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_throttle_io);
         }
 
-        if(likely(cg->throttle_io_serviced.updated && cg->throttle_io_serviced.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->throttle_io_serviced.updated && cg->throttle_io_serviced.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_throttle_serviced_ops)) {
                 cg->st_throttle_serviced_ops = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "throttle_serviced_ops");
@@ -2115,7 +2115,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_throttle_serviced_ops);
         }
 
-        if(likely(cg->io_queued.updated && cg->io_queued.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->io_queued.updated && cg->io_queued.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_queued_ops)) {
                 cg->st_queued_ops = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "queued_ops");
@@ -2136,7 +2136,7 @@ void update_cgroup_charts(int update_every) {
             rrdset_done(cg->st_queued_ops);
         }
 
-        if(likely(cg->io_merged.updated && cg->io_merged.enabled == CONFIG_ONDEMAND_YES)) {
+        if(likely(cg->io_merged.updated && cg->io_merged.enabled == CONFIG_BOOLEAN_YES)) {
             if(unlikely(!cg->st_merged_ops)) {
                 cg->st_merged_ops = rrdset_find_bytype_localhost(
                         cgroup_chart_type(type, cg->chart_id, RRD_ID_LENGTH_MAX), "merged_ops");
index db82c43490ee9834688c8a8590fca38b485bda2a..48b8c468924f1595f7cbb076af9bf5d84f3e58ea 100644 (file)
@@ -2278,7 +2278,7 @@ static inline int web_client_process_url(RRDHOST *host, struct web_client *w, ch
             debug(D_WEB_CLIENT_ACCESS, "%llu: Sending netdata.conf ...", w->id);
             w->response.data->contenttype = CT_TEXT_PLAIN;
             buffer_flush(w->response.data);
-            generate_config(w->response.data, 0);
+            config_generate(w->response.data, 0);
             return 200;
         }
         else if(unlikely(hash == hash_data && strcmp(tok, WEB_PATH_DATA) == 0)) { // "data"