diff options
Diffstat (limited to '')
-rw-r--r-- | libnetdata/config/Makefile.am | 8 | ||||
-rw-r--r-- | libnetdata/config/README.md | 58 | ||||
-rw-r--r-- | src/libnetdata/config/appconfig.c (renamed from libnetdata/config/appconfig.c) | 4 | ||||
-rw-r--r-- | src/libnetdata/config/appconfig.h (renamed from libnetdata/config/appconfig.h) | 0 |
4 files changed, 2 insertions, 68 deletions
diff --git a/libnetdata/config/Makefile.am b/libnetdata/config/Makefile.am deleted file mode 100644 index 161784b8f..000000000 --- a/libnetdata/config/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -AUTOMAKE_OPTIONS = subdir-objects -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in - -dist_noinst_DATA = \ - README.md \ - $(NULL) diff --git a/libnetdata/config/README.md b/libnetdata/config/README.md deleted file mode 100644 index c3a9d147c..000000000 --- a/libnetdata/config/README.md +++ /dev/null @@ -1,58 +0,0 @@ -<!-- -title: "Netdata ini config files" -custom_edit_url: https://github.com/netdata/netdata/edit/master/libnetdata/config/README.md -sidebar_label: "Netdata ini config files" -learn_status: "Published" -learn_topic_type: "Tasks" -learn_rel_path: "Developers/libnetdata" ---> - -# Netdata ini config files - -Configuration files `netdata.conf` and `stream.conf` are Netdata ini files. - -## Motivation - -The whole idea came up when we were evaluating the documentation involved -in maintaining a complex configuration system. Our intention was to give -configuration options for everything imaginable. But then, documenting all -these options would require a tremendous amount of time, users would have -to search through endless pages for the option they need, etc. - -We concluded then that **configuring software like that is a waste of time -and effort**. Of course there must be plenty of configuration options, but -the implementation itself should require a lot less effort for both the -developers and the users. - -So, we did this: - -1. No configuration is required to run Netdata -2. There are plenty of options to tweak -3. There is minimal documentation (or no at all) - -## Why this works? - -The configuration file is a `name = value` dictionary with `[sections]`. -Write whatever you like there as long as it follows this simple format. - -Netdata loads this dictionary and then when the code needs a value from -it, it just looks up the `name` in the dictionary at the proper `section`. -In all places, in the code, there are both the `names` and their -`default values`, so if something is not found in the configuration -file, the default is used. The lookup is made using B-Trees and hashes -(no string comparisons), so they are super fast. Also the `names` of the -settings can be `my super duper setting that once set to yes, will turn the world upside down = no` - -- so goodbye to most of the documentation involved. - -Next, Netdata can generate a valid configuration for the user to edit. -No need to remember anything or copy and paste settings. Just get the -configuration from the server (`/netdata.conf` on your Netdata server), -edit it and save it. - -Last, what about options you believe you have set, but you misspelled? -When you get the configuration file from the server, there will be a -comment above all `name = value` pairs the server does not use. -So you know that whatever you wrote there, is not used. - - diff --git a/libnetdata/config/appconfig.c b/src/libnetdata/config/appconfig.c index fe4c1222d..81946b594 100644 --- a/libnetdata/config/appconfig.c +++ b/src/libnetdata/config/appconfig.c @@ -904,7 +904,7 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) * @return It returns 1 on success and 0 otherwise */ int config_parse_duration(const char* string, int* result) { - while(*string && isspace(*string)) string++; + while(*string && isspace((uint8_t)*string)) string++; if(unlikely(!*string)) goto fallback; @@ -915,7 +915,7 @@ int config_parse_duration(const char* string, int* result) { } // make sure it is a number - if(!(isdigit(*string) || *string == '+' || *string == '-')) goto fallback; + if(!(isdigit((uint8_t)*string) || *string == '+' || *string == '-')) goto fallback; char *e = NULL; NETDATA_DOUBLE n = str2ndd(string, &e); diff --git a/libnetdata/config/appconfig.h b/src/libnetdata/config/appconfig.h index 214a15edd..214a15edd 100644 --- a/libnetdata/config/appconfig.h +++ b/src/libnetdata/config/appconfig.h |