feat: move dirs, logs, and env vars config options to separate sections (#12935)
Ilya Mashchenko committed
May 17, 2022 at 17:31 UTC
0fa55c7dcee497d6cfb725604d03ffc300a97ebd
14 files changed
+283
-245
build_external/scenarios/aclk-testing/agent_netdata.conf
-20
@@ -18,28 +18,12 @@
18
# hostname = b073e16793c4
19
# history = 3996
20
# update every = 1
21
- # config directory = /etc/netdata
22
- # stock config directory = /usr/lib/netdata/conf.d
23
- # log directory = /var/log/netdata
24
- # web files directory = /usr/share/netdata/web
25
- # cache directory = /var/cache/netdata
26
- # lib directory = /var/lib/netdata
27
- # home directory = /var/cache/netdata
28
- # plugins directory = "/usr/libexec/netdata/plugins.d" "/etc/netdata/custom-plugins.d"
21
# memory mode = dbengine
22
# page cache size = 32
23
# dbengine disk space = 256
24
# host access prefix =
25
# memory deduplication (ksm) = yes
34
- # TZ environment variable = :/etc/localtime
26
# timezone = Etc/UTC
36
- # debug flags = 0x0000000000000000
37
- # debug log = /var/log/netdata/debug.log
38
- # error log = /var/log/netdata/error.log
39
- # access log = /var/log/netdata/access.log
40
- # facility log = daemon
41
- # errors flood protection period = 1200
42
- # errors to trigger flood protection = 200
27
# run as user = netdata
28
# OOM score = 1000
29
# process scheduling policy = idle
@@ -84,8 +68,6 @@
68
# web server max sockets = 262144
69
70
[plugins]
87
- # PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
88
- # PYTHONPATH environment variable =
71
# checks = no
72
# proc = yes
73
# diskspace = yes
@@ -110,8 +92,6 @@
92
# default repeat critical = never
93
# in memory max health log entries = 1000
94
# script to execute on alarm = /usr/libexec/netdata/plugins.d/alarm-notify.sh
113
- # stock health configuration directory = /usr/lib/netdata/conf.d/health.d
114
- # health configuration directory = /etc/netdata/health.d
95
# rotate log every lines = 2000
96
# run at least every seconds = 10
97
# postpone alarms during hibernation for seconds = 60
collectors/REFERENCE.md
-2
@@ -84,8 +84,6 @@ This section features a list of Netdata's plugins, with a boolean setting to ena
84
85
```conf
86
[plugins]
87
- # PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/var/lib/snapd/snap/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
88
- # PYTHONPATH environment variable =
87
# proc = yes
88
# diskspace = yes
89
# timex = yes
collectors/plugins.d/plugins_d.c
+1
-1
@@ -127,7 +127,7 @@ inline int pluginsd_initialize_plugin_directories()
127
// Get the configuration entry
128
if (likely(!plugins_dir_list)) {
129
snprintfz(plugins_dirs, FILENAME_MAX * 2, "\"%s\" \"%s/custom-plugins.d\"", PLUGINS_DIR, CONFIG_DIR);
130
- plugins_dir_list = strdupz(config_get(CONFIG_SECTION_GLOBAL, "plugins directory", plugins_dirs));
130
+ plugins_dir_list = strdupz(config_get(CONFIG_SECTION_DIRECTORIES, "plugins", plugins_dirs));
131
}
132
133
// Parse it and store it to plugin directories
collectors/statsd.plugin/statsd.c
+1
-1
@@ -2209,7 +2209,7 @@ void *statsd_main(void *ptr) {
2209
// ----------------------------------------------------------------------------------------------------------------
2210
// statsd configuration
2211
2212
- statsd.enabled = config_get_boolean(CONFIG_SECTION_STATSD, "enabled", statsd.enabled);
2212
+ statsd.enabled = config_get_boolean(CONFIG_SECTION_PLUGINS, "statsd", statsd.enabled);
2213
2214
statsd.update_every = default_rrd_update_every;
2215
statsd.update_every = (int)config_get_number(CONFIG_SECTION_STATSD, "update every (flushInterval)", statsd.update_every);
daemon/analytics.c
+3
-3
@@ -701,7 +701,7 @@ void get_system_timezone(void)
701
// http://stackoverflow.com/questions/4554271/how-to-avoid-excessive-stat-etc-localtime-calls-in-strftime-on-linux
702
const char *tz = getenv("TZ");
703
if (!tz || !*tz)
704
- setenv("TZ", config_get(CONFIG_SECTION_GLOBAL, "TZ environment variable", ":/etc/localtime"), 0);
704
+ setenv("TZ", config_get(CONFIG_SECTION_ENV_VARS, "TZ", ":/etc/localtime"), 0);
705
706
char buffer[FILENAME_MAX + 1] = "";
707
const char *timezone = NULL;
@@ -908,13 +908,13 @@ void set_global_environment()
908
if (!p)
909
p = "/bin:/usr/bin";
910
snprintfz(path, 1024, "%s:%s", p, "/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
911
- setenv("PATH", config_get(CONFIG_SECTION_PLUGINS, "PATH environment variable", path), 1);
911
+ setenv("PATH", config_get(CONFIG_SECTION_ENV_VARS, "PATH", path), 1);
912
913
// python options
914
p = getenv("PYTHONPATH");
915
if (!p)
916
p = "";
917
- setenv("PYTHONPATH", config_get(CONFIG_SECTION_PLUGINS, "PYTHONPATH environment variable", p), 1);
917
+ setenv("PYTHONPATH", config_get(CONFIG_SECTION_ENV_VARS, "PYTHONPATH", p), 1);
918
919
// disable buffering for python plugins
920
setenv("PYTHONUNBUFFERED", "1", 1);
daemon/config/README.md
+145
-158
@@ -6,24 +6,45 @@ custom_edit_url: https://github.com/netdata/netdata/edit/master/daemon/config/RE
6
7
# Daemon configuration
8
9
-<details markdown="1"><summary>The daemon configuration file is read from `/etc/netdata/netdata.conf`.</summary>
10
-Depending on your installation method, Netdata will have been installed either directly under `/`, or under `/opt/netdata`. The paths mentioned here and in the documentation in general assume that your installation is under `/`. If it is not, you will find the exact same paths under `/opt/netdata` as well. (i.e. `/etc/netdata` will be `/opt/netdata/etc/netdata`).</details>
9
+<details>
10
+<summary>The daemon configuration file is read from /etc/netdata/netdata.conf.</summary>
11
12
-This config file **is not needed by default**. Netdata works fine out of the box without it. But it does allow you to adapt the general behavior of Netdata, in great detail. You can find all these settings, with their default values, by accessing the URL `https://netdata.server.hostname:19999/netdata.conf`. For example check the configuration file of [netdata.firehol.org](http://netdata.firehol.org/netdata.conf). HTTP access to this file is limited by default to private IPs, via the [web server access lists](/web/server/README.md#access-lists).
12
+Depending on your installation method, Netdata will have been installed either directly under `/`, or
13
+under `/opt/netdata`. The paths mentioned here and in the documentation in general assume that your installation is
14
+under `/`. If it is not, you will find the exact same paths under `/opt/netdata` as well. (i.e. `/etc/netdata` will
15
+be `/opt/netdata/etc/netdata`).
16
+
17
+</details>
18
+
19
+This config file **is not needed by default**. Netdata works fine out of the box without it. But it does allow you to
20
+adapt the general behavior of Netdata, in great detail. You can find all these settings, with their default values, by
21
+accessing the URL `https://netdata.server.hostname:19999/netdata.conf`. For example check the configuration file
22
+of [netdata.firehol.org](http://netdata.firehol.org/netdata.conf). HTTP access to this file is limited by default to
23
+[private IPs](https://en.wikipedia.org/wiki/Private_network), via
24
+the [web server access lists](/web/server/README.md#access-lists).
25
26
`netdata.conf` has sections stated with `[section]`. You will see the following sections:
27
16
-1. `[global]` to [configure](#global-section-options) the [Netdata daemon](/daemon/README.md).
17
-2. `[web]` to [configure the web server](/web/server/README.md).
18
-3. `[plugins]` to [configure](#plugins-section-options) which [collectors](/collectors/README.md) to use and PATH
28
+1. `[global]` to [configure](#global-section-options) the [Netdata daemon](/daemon/README.md).
29
+2. `[directories]` to [configure](#directories-section-options) the directories used by Netdata.
30
+3. `[logs]` to [configure](#logs-section-options) the Netdata logging.
31
+4. `[environment variables]` to [configure](#environment-variables-section-options) the environment variables used
32
+ Netdata.
33
+5. `[sqlite]` to [configure](#sqlite-section-options) the [Netdata daemon](/daemon/README.md) SQLite settings.
34
+6. `[ml]` to configure settings for [machine learning](/ml/README.md).
35
+7. `[health]` to [configure](#health-section-options) general settings for [health monitoring](/health/README.md).
36
+8. `[web]` to [configure the web server](/web/server/README.md).
37
+9. `[registry]` for the [Netdata registry](/registry/README.md).
38
+10. `[global statistics]` for the [Netdata registry](/registry/README.md).
39
+11. `[statsd]` for the general settings of the [stats.d.plugin](/collectors/statsd.plugin/README.md).
40
+12. `[plugins]` to [configure](#plugins-section-options) which [collectors](/collectors/README.md) to use and PATH
41
settings.
20
-4. `[health]` to [configure](#health-section-options) general settings for [health monitoring](/health/README.md)
21
-5. `[registry]` for the [Netdata registry](/registry/README.md).
22
-6. `[statsd]` for the general settings of the [stats.d.plugin](/collectors/statsd.plugin/README.md).
23
-7. `[plugin:NAME]` sections for each collector plugin, under the comment [Per plugin configuration](#per-plugin-configuration).
24
-8. `[CHART_NAME]` sections for each chart defined, under the comment [Per chart configuration](#per-chart-configuration).
42
+13. `[plugin:NAME]` sections for each collector plugin, under the
43
+ comment [Per plugin configuration](#per-plugin-configuration).
44
26
-The configuration file is a `name = value` dictionary. Netdata will not complain if you set options unknown to it. When you check the running configuration by accessing the URL `/netdata.conf` on your Netdata server, Netdata will add a comment on settings it does not currently use.
45
+The configuration file is a `name = value` dictionary. Netdata will not complain if you set options unknown to it. When
46
+you check the running configuration by accessing the URL `/netdata.conf` on your Netdata server, Netdata will add a
47
+comment on settings it does not currently use.
48
49
## Applying changes
50
@@ -46,87 +67,120 @@ Please note that your data history will be lost if you have modified `history` p
67
68
### [global] section options
69
49
-| setting|default|info|
50
-|:-----:|:-----:|:---|
51
-| process scheduling policy|`keep`|See [Netdata process scheduling policy](/daemon/README.md#netdata-process-scheduling-policy)|
52
-| OOM score|`0`||
53
-| glibc malloc arena max for plugins|`1`|See [Virtual memory](/daemon/README.md#virtual-memory).|
54
-| glibc malloc arena max for Netdata|`1`|See [Virtual memory](/daemon/README.md#virtual-memory).|
55
-| hostname|auto-detected|The hostname of the computer running Netdata.|
56
-| history|`3996`| Used with `memory mode = save/map/ram/alloc`, not the default `memory mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. This setting can also be configured per chart. Check [Memory Requirements](/database/README.md) for more information. |
57
-| update every|`1`|The frequency in seconds, for data collection. For more information see the [performance guide](/docs/guides/configure/performance.md).|
58
-| config directory|`/etc/netdata`|The directory configuration files are kept.|
59
-| stock config directory|`/usr/lib/netdata/conf.d`||
60
-| log directory|`/var/log/netdata`|The directory in which the [log files](/daemon/README.md#log-files) are kept.|
61
-| web files directory|`/usr/share/netdata/web`|The directory the web static files are kept.|
62
-| cache directory|`/var/cache/netdata`|The directory the memory database will be stored if and when Netdata exits. Netdata will re-read the database when it will start again, to continue from the same point.|
63
-| lib directory|`/var/lib/netdata`|Contains the alarm log and the Netdata instance guid.|
64
-| home directory|`/var/cache/netdata`|Contains the db files for the collected metrics|
65
-| plugins directory|`"/usr/libexec/netdata/plugins.d" "/etc/netdata/custom-plugins.d"`|The directory plugin programs are kept. This setting supports multiple directories, space separated. If any directory path contains spaces, enclose it in single or double quotes.|
66
-| memory mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `page cache size` and `dbengine disk space`. <br />`save`: Netdata will save its round robin database on exit and load it on startup. <br />`map`: Cache files will be updated in real-time. Not ideal for systems with high load or slow disks (check `man mmap`). <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. |
67
-| page cache size | 32 | Determines the amount of RAM in MiB that is dedicated to caching Netdata metric values. |
68
-| dbengine disk space | 256 | Determines the amount of disk space in MiB that is dedicated to storing Netdata metric values and all related metadata describing them. |
69
-| dbengine multihost disk space | 256 | Same functionality as `dbengine disk space`, but includes support for storing metrics streamed to a parent node by its children. Can be used in single-node environments as well. |
70
-| host access prefix| |This is used in docker environments where /proc, /sys, etc have to be accessed via another path. You may also have to set SYS_PTRACE capability on the docker for this work. Check [issue 43](https://github.com/netdata/netdata/issues/43).|
71
-| memory deduplication (ksm)|`yes`|When set to `yes`, Netdata will offer its in-memory round robin database to kernel same page merging (KSM) for deduplication. For more information check [Memory Deduplication - Kernel Same Page Merging - KSM](/database/README.md#ksm)|
72
-| TZ environment variable|`:/etc/localtime`|Where to find the timezone|
73
-| timezone|auto-detected|The timezone retrieved from the environment variable|
74
-| debug flags|`0x0000000000000000`|Bitmap of debug options to enable. For more information check [Tracing Options](/daemon/README.md#debugging).|
75
-| debug log|`/var/log/netdata/debug.log`|The filename to save debug information. This file will not be created if debugging is not enabled. You can also set it to `syslog` to send the debug messages to syslog, or `none` to disable this log. For more information check [Tracing Options](/daemon/README.md#debugging).|
76
-| error log|`/var/log/netdata/error.log`|The filename to save error messages for Netdata daemon and all plugins (`stderr` is sent here for all Netdata programs, including the plugins). You can also set it to `syslog` to send the errors to syslog, or `none` to disable this log.|
77
-| access log|`/var/log/netdata/access.log`|The filename to save the log of web clients accessing Netdata charts. You can also set it to `syslog` to send the access log to syslog, or `none` to disable this log.|
78
-| errors flood protection period|`1200`|Length of period (in sec) during which the number of errors should not exceed the `errors to trigger flood protection`.|
79
-| errors to trigger flood protection|`200`|Number of errors written to the log in `errors flood protection period` sec before flood protection is activated.|
80
-| run as user|`netdata`|The user Netdata will run as.|
81
-| pthread stack size|auto-detected||
82
-| cleanup obsolete charts after seconds|`3600`|See [monitoring ephemeral containers](/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also sets the timeout for cleaning up obsolete dimensions|
83
-| gap when lost iterations above|`1`||
84
-| cleanup orphan hosts after seconds|`3600`|How long to wait until automatically removing from the DB a remote Netdata host (child) that is no longer sending data.|
85
-| delete obsolete charts files|`yes`|See [monitoring ephemeral containers](/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also affects the deletion of files for obsolete dimensions|
86
-| delete orphan hosts files|`yes`|Set to `no` to disable non-responsive host removal.|
87
-| enable zero metrics|`no`|Set to `yes` to show charts when all their metrics are zero.|
70
+| setting | default | info |
71
+|:-------------------------------------:|:------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
72
+| process scheduling policy | `keep` | See [Netdata process scheduling policy](/daemon/README.md#netdata-process-scheduling-policy) |
73
+| OOM score | `0` | |
74
+| glibc malloc arena max for plugins | `1` | See [Virtual memory](/daemon/README.md#virtual-memory). |
75
+| glibc malloc arena max for Netdata | `1` | See [Virtual memory](/daemon/README.md#virtual-memory). |
76
+| hostname | auto-detected | The hostname of the computer running Netdata. |
77
+| history | `3996` | Used with `memory mode = save/map/ram/alloc`, not the default `memory mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. This setting can also be configured per chart. Check [Memory Requirements](/database/README.md) for more information. |
78
+| update every | `1` | The frequency in seconds, for data collection. For more information see the [performance guide](/docs/guides/configure/performance.md). |
79
+| memory mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `page cache size` and `dbengine disk space`. <br />`save`: Netdata will save its round robin database on exit and load it on startup. <br />`map`: Cache files will be updated in real-time. Not ideal for systems with high load or slow disks (check `man mmap`). <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. |
80
+| page cache size | 32 | Determines the amount of RAM in MiB that is dedicated to caching Netdata metric values. |
81
+| dbengine disk space | 256 | Determines the amount of disk space in MiB that is dedicated to storing Netdata metric values and all related metadata describing them. |
82
+| dbengine multihost disk space | 256 | Same functionality as `dbengine disk space`, but includes support for storing metrics streamed to a parent node by its children. Can be used in single-node environments as well. |
83
+| host access prefix | | This is used in docker environments where /proc, /sys, etc have to be accessed via another path. You may also have to set SYS_PTRACE capability on the docker for this work. Check [issue 43](https://github.com/netdata/netdata/issues/43). |
84
+| memory deduplication (ksm) | `yes` | When set to `yes`, Netdata will offer its in-memory round robin database to kernel same page merging (KSM) for deduplication. For more information check [Memory Deduplication - Kernel Same Page Merging - KSM](/database/README.md#ksm) |
85
+| timezone | auto-detected | The timezone retrieved from the environment variable |
86
+| run as user | `netdata` | The user Netdata will run as. |
87
+| pthread stack size | auto-detected | |
88
+| cleanup obsolete charts after seconds | `3600` | See [monitoring ephemeral containers](/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also sets the timeout for cleaning up obsolete dimensions |
89
+| gap when lost iterations above | `1` | |
90
+| cleanup orphan hosts after seconds | `3600` | How long to wait until automatically removing from the DB a remote Netdata host (child) that is no longer sending data. |
91
+| delete obsolete charts files | `yes` | See [monitoring ephemeral containers](/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also affects the deletion of files for obsolete dimensions |
92
+| delete orphan hosts files | `yes` | Set to `no` to disable non-responsive host removal. |
93
+| enable zero metrics | `no` | Set to `yes` to show charts when all their metrics are zero. |
94
+
95
+### [directories] section options
96
+
97
+| setting | default | info |
98
+|:-------------------:|:------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
99
+| config | `/etc/netdata` | The directory configuration files are kept. |
100
+| stock config | `/usr/lib/netdata/conf.d` | |
101
+| log | `/var/log/netdata` | The directory in which the [log files](/daemon/README.md#log-files) are kept. |
102
+| web | `/usr/share/netdata/web` | The directory the web static files are kept. |
103
+| cache | `/var/cache/netdata` | The directory the memory database will be stored if and when Netdata exits. Netdata will re-read the database when it will start again, to continue from the same point. |
104
+| lib | `/var/lib/netdata` | Contains the alarm log and the Netdata instance GUID. |
105
+| home | `/var/cache/netdata` | Contains the db files for the collected metrics. |
106
+| lock | `/var/lib/netdata/lock` | Contains the data collectors lock files. |
107
+| plugins | `"/usr/libexec/netdata/plugins.d" "/etc/netdata/custom-plugins.d"` | The directory plugin programs are kept. This setting supports multiple directories, space separated. If any directory path contains spaces, enclose it in single or double quotes. |
108
+| health config | `/etc/netdata/health.d` | The directory containing the user alarm configuration files, to override the stock configurations |
109
+| stock health config | `/usr/lib/netdata/conf.d/health.d` | Contains the stock alarm configuration files for each collector |
110
+| registry | `/opt/netdata/var/lib/netdata/registry` | Contains the [registry](/registry/README.md) database and GUID that uniquely identifies each Netdata Agent |
111
+
112
+### [logs] section options
113
+
114
+| setting | default | info |
115
+|:----------------------------------:|:-----------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
116
+| debug flags | `0x0000000000000000` | Bitmap of debug options to enable. For more information check [Tracing Options](/daemon/README.md#debugging). |
117
+| debug | `/var/log/netdata/debug.log` | The filename to save debug information. This file will not be created if debugging is not enabled. You can also set it to `syslog` to send the debug messages to syslog, or `none` to disable this log. For more information check [Tracing Options](/daemon/README.md#debugging). |
118
+| error | `/var/log/netdata/error.log` | The filename to save error messages for Netdata daemon and all plugins (`stderr` is sent here for all Netdata programs, including the plugins). You can also set it to `syslog` to send the errors to syslog, or `none` to disable this log. |
119
+| access | `/var/log/netdata/access.log` | The filename to save the log of web clients accessing Netdata charts. You can also set it to `syslog` to send the access log to syslog, or `none` to disable this log. |
120
+| facility | `daemon` | A facility keyword is used to specify the type of system that is logging the message. |
121
+| errors flood protection period | `1200` | Length of period (in sec) during which the number of errors should not exceed the `errors to trigger flood protection`. |
122
+| errors to trigger flood protection | `200` | Number of errors written to the log in `errors flood protection period` sec before flood protection is activated. |
123
+
124
+### [environment variables] section options
125
+
126
+| setting | default | info |
127
+|:----------:|:-----------------:|:-----------------------------------------------------------|
128
+| TZ | `:/etc/localtime` | Where to find the timezone |
129
+| PATH | `auto-detected` | Specifies the directories to be searched to find a command |
130
+| PYTHONPATH | | Used to set a custom python path |
131
+
132
+### [sqlite] section options
133
+
134
+| setting | default | info |
135
+|:------------------:|:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
136
+| auto vacuum | `INCREMENTAL` | The [auto-vacuum status](https://www.sqlite.org/pragma.html#pragma_auto_vacuum) in the database |
137
+| synchronous | `NORMAL` | The setting of the ["synchronous"](https://www.sqlite.org/pragma.html#pragma_synchronous) flag |
138
+| journal mode | `WAL` | The [journal mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) for databases |
139
+| temp store | `MEMORY` | Used to determine where [temporary tables and indices are stored](https://www.sqlite.org/pragma.html#pragma_temp_store) |
140
+| journal size limit | `16777216` | Used to set a new [limit in bytes for the database](https://www.sqlite.org/pragma.html#pragma_journal_size_limit) |
141
+| cache size | `-2000` | Used to [suggest the maximum number of database disk pages](https://www.sqlite.org/pragma.html#pragma_cache_size) that SQLite will hold in memory at once per open database file |
142
89
-### [web] section options
143
+### [health] section options
144
91
-Refer to the [web server documentation](/web/server/README.md)
145
+This section controls the general behavior of the health monitoring capabilities of Netdata.
146
93
-### [plugins] section options
147
+Specific alarms are configured in per-collector config files under the `health.d` directory. For more info, see [health
148
+monitoring](/health/README.md).
149
95
-In this section you will see be a boolean (`yes`/`no`) option for each plugin (e.g. tc, cgroups, apps, proc etc.). Note that the configuration options in this section for the orchestrator plugins `python.d` and `charts.d` control **all the modules** written for that orchestrator. For instance, setting `python.d = no` means that all Python modules under `collectors/python.d.plugin` will be disabled.
150
+[Alarm notifications](/health/notifications/README.md) are configured in `health_alarm_notify.conf`.
151
97
-Additionally, there will be the following options:
152
+| setting | default | info |
153
+|:----------------------------------------------:|:------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
154
+| enabled | `yes` | Set to `no` to disable all alarms and notifications |
155
+| in memory max health log entries | 1000 | Size of the alarm history held in RAM |
156
+| script to execute on alarm | `/usr/libexec/netdata/plugins.d/alarm-notify.sh` | The script that sends alarm notifications. Note that in versions before 1.16, the plugins.d directory may be installed in a different location in certain OSs (e.g. under `/usr/lib/netdata`). |
157
+| run at least every seconds | `10` | Controls how often all alarm conditions should be evaluated. |
158
+| postpone alarms during hibernation for seconds | `60` | Prevents false alarms. May need to be increased if you get alarms during hibernation. |
159
+| rotate log every lines | 2000 | Controls the number of alarm log entries stored in `<lib directory>/health-log.db`, where `<lib directory>` is the one configured in the [\[global\] section](#global-section-options) |
160
99
-| setting|default|info|
100
-|:-----:|:-----:|:---|
101
-| PATH environment variable|`auto-detected`||
102
-| PYTHONPATH environment variable||Used to set a custom python path|
103
-| enable running new plugins|`yes`|When set to `yes`, Netdata will enable detected plugins, even if they are not configured explicitly. Setting this to `no` will only enable plugins explicitly configured in this file with a `yes`|
104
-| check for new plugins every|60|The time in seconds to check for new plugins in the plugins directory. This allows having other applications dynamically creating plugins for Netdata.|
105
-| checks|`no`|This is a debugging plugin for the internal latency|
161
+### [web] section options
162
107
-### [health] section options
163
+Refer to the [web server documentation](/web/server/README.md)
164
109
-This section controls the general behavior of the health monitoring capabilities of Netdata.
165
+### [plugins] section options
166
111
-Specific alarms are configured in per-collector config files under the `health.d` directory. For more info, see [health
112
-monitoring](/health/README.md).
167
+In this section you will see be a boolean (`yes`/`no`) option for each plugin (e.g. tc, cgroups, apps, proc etc.). Note
168
+that the configuration options in this section for the orchestrator plugins `python.d` and `charts.d` control **all the
169
+modules** written for that orchestrator. For instance, setting `python.d = no` means that all Python modules
170
+under `collectors/python.d.plugin` will be disabled.
171
114
-[Alarm notifications](/health/notifications/README.md) are configured in `health_alarm_notify.conf`.
172
+Additionally, there will be the following options:
173
116
-| setting|default|info|
117
-|:-----:|:-----:|:---|
118
-| enabled|`yes`|Set to `no` to disable all alarms and notifications|
119
-| in memory max health log entries|1000|Size of the alarm history held in RAM|
120
-| script to execute on alarm|`/usr/libexec/netdata/plugins.d/alarm-notify.sh`|The script that sends alarm notifications. Note that in versions before 1.16, the plugins.d directory may be installed in a different location in certain OSs (e.g. under `/usr/lib/netdata`).|
121
-| stock health configuration directory|`/usr/lib/netdata/conf.d/health.d`|Contains the stock alarm configuration files for each collector|
122
-| health configuration directory|`/etc/netdata/health.d`|The directory containing the user alarm configuration files, to override the stock configurations|
123
-| run at least every seconds|`10`|Controls how often all alarm conditions should be evaluated.|
124
-| postpone alarms during hibernation for seconds|`60`|Prevents false alarms. May need to be increased if you get alarms during hibernation.|
125
-| rotate log every lines|2000|Controls the number of alarm log entries stored in `<lib directory>/health-log.db`, where `<lib directory>` is the one configured in the [\[global\] section](#global-section-options)|
174
+| setting | default | info |
175
+|:-------------------------------:|:---------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
176
+| enable running new plugins | `yes` | When set to `yes`, Netdata will enable detected plugins, even if they are not configured explicitly. Setting this to `no` will only enable plugins explicitly configured in this file with a `yes` |
177
+| check for new plugins every | 60 | The time in seconds to check for new plugins in the plugins directory. This allows having other applications dynamically creating plugins for Netdata. |
178
+| checks | `no` | This is a debugging plugin for the internal latency |
179
180
### [registry] section options
181
129
-To understand what this section is and how it should be configured, please refer to the [registry documentation](/registry/README.md).
182
+To understand what this section is and how it should be configured, please refer to
183
+the [registry documentation](/registry/README.md).
184
185
## Per-plugin configuration
186
@@ -137,89 +191,22 @@ The configuration options for plugins appear in sections following the pattern `
191
Most internal plugins will provide additional options. Check [Internal Plugins](/collectors/README.md) for more
192
information.
193
140
-Please note, that by default Netdata will enable monitoring metrics for disks, memory, and network only when they are not zero. If they are constantly zero they are ignored. Metrics that will start having values, after Netdata is started, will be detected and charts will be automatically added to the dashboard (a refresh of the dashboard is needed for them to appear though). Use `yes` instead of `auto` in plugin configuration sections to enable these charts permanently. You can also set the `enable zero metrics` option to `yes` in the `[global]` section which enables charts with zero metrics for all internal Netdata plugins.
194
+Please note, that by default Netdata will enable monitoring metrics for disks, memory, and network only when they are
195
+not zero. If they are constantly zero they are ignored. Metrics that will start having values, after Netdata is started,
196
+will be detected and charts will be automatically added to the dashboard (a refresh of the dashboard is needed for them
197
+to appear though). Use `yes` instead of `auto` in plugin configuration sections to enable these charts permanently. You
198
+can also set the `enable zero metrics` option to `yes` in the `[global]` section which enables charts with zero metrics
199
+for all internal Netdata plugins.
200
201
### External plugins
202
203
External plugins will have only 2 options at `netdata.conf`:
204
146
-| setting | default | info |
147
-| :-----:|:-----:|:---|
148
-| update every | the value of `[global].update every` setting|The frequency in seconds the plugin should collect values. For more information check the [performance guide](/docs/guides/configure/performance.md).|
149
-| command options | _empty_ | Additional command line options to pass to the plugin.|
150
-
151
-External plugins that need additional configuration may support a dedicated file in `/etc/netdata`. Check their documentation.
152
-
153
-## Per-chart configuration
154
-
155
-In this area of `netdata.conf` you can find configuration options for individual charts. They appear in sections
156
-following the pattern `[NAME]`.
157
-
158
-Using the settings and values under these sections, you can control all aspects of a specific chart. You can change its
159
-title, make it appear higher in Netdata's [menu](/web/gui/README.md#metrics-menus), tweak its dimensions, and much more.
160
-
161
-To find the name of a given chart, and thus the name of its section in `netdata.conf`, look at the top-left corner of a
162
-chart:
163
-
164
-
166
-
167
-Every per-chart configuration section has several common settings, which are listed in the table just below. Beneath
168
-that is information about lines that begin with `dim`, which affect a chart's dimensions.
169
-
170
-| Setting | Function |
171
-| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
-| `history` | Override the `history` setting in the [[global] options](#global-section-options) for this particular chart. Should be less than or equal to the global `history` setting. |
173
-| `enabled` | A boolean (`yes` or `no`) that explicitly enables or disables the chart in question. |
174
-| `cache directory` | The directory where cache files for this plugin, if needed, are stored. |
175
-| `chart type` | Defines what type of chart to display. It can be `line`, `area`, or `stacked`. If empty or missing, `line` will be used. |
176
-| `type` | Uniquely identify which [metrics menu](/web/gui/README.md#metrics-menus) on the Netdata dashboard this chart should appear under. Some examples include `system` (**System**), `disk` (**Disks**), `net` (**Network Interfaces**), and `netdata` (**Netdata Monitoring**). |
177
-| `family` | Change the chart's [family](/web/README.md#families) from its default. For example, you could force a disk space chart to collect metrics for family `sdb` instead of family `sda`. |
178
-| `units` | Text for the label of the vertical axis of the chart. This means all dimensions should have the same unit of measurement. |
179
-| `context` | Change the default [context](/web/README.md#contexts) of the chart. Changing this setting will affect what metrics and metrics the chart displays, and which alarms are attached to it. |
180
-| `priority` | Define where the chart should appear on the Netdata dashboard. Lower values equal higher priority, so a priority of `1` will place the chart highest, while a priority of `9999999` would place the chart at the bottom of the Netdata dashboard. |
181
-| `name` | The name of the chart that appears in the top-left corner, after the chart's title. You can also use this name when writing [health entities](/health/REFERENCE.md#health-entity-reference). |
182
-| `title` | The text that appears above the chart in the Netdata dashboard. |
183
-
184
-### Dimension settings
185
-
186
-You may notice some settings that begin with `dim` beneath the ones defined in the table above. These settings determine
187
-which dimensions appear on the given chart and how Netdata calculates them.
188
-
189
-Each dimension setting has the following structure: `dim [DIMENSION ID] [OPTION] = [VALUE]`. The available options are `name`, `algorithm`, `multiplier`, and `divisor`.
190
-
191
-| Setting | Function |
192
-| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
193
-| `name` | The name of the dimension as it will appear in the legend of the chart. If left empty, or is missing, Netdata will use the `[DIMENSION ID]` instead. |
194
-| `algorithm` | Can be `absolute`, `incremental`, `percentage-of-absolute-row`, or `percentage-of-incremental-row`. If this setting is empty, invalid, or missing, Netdata will use `absolute`. See the list beneath this table for descriptions of what each algorithm does. |
195
-| `multiplier` | An integer value by which to multiply the collected value. If empty or missing, Netdata will use `1`. This setting is often used with the value `1024` to convert metabytes to kilobytes, kilobytes to bytes, and so on. |
196
-| `divisor` | An integer value by which to divide the collected value. If empty or missing, Netdata will use `1`. This setting is often used with the value `1024` to convert bytes to kilobytes, kilobytes to megabytes, and so on. |
197
-
198
-Here are the options for the `algorithm` setting:
199
-
200
-- `absolute`: The value is drawn as-is (interpolated to second boundary).
201
-- `incremental`: To be used when the value always increases over time, such as the I/O on a disk. Netdata takes the
202
- difference between the current metric and the past metric to calculate a per-second figure.
203
-- `percentage-of-absolute-row`: The % of this value compared to the total of all dimensions.
204
-- `percentage-of-incremental-row`: The % of this value compared to the incremental total of all dimensions.
205
-
206
-For example, the `system.io` chart has the following default settings:
207
-
208
-```conf
209
- # dim in name = in
210
- # dim in algorithm = incremental
211
- # dim in multiplier = 1
212
- # dim in divisor = 1
213
- # dim out name = out
214
- # dim out algorithm = incremental
215
- # dim out multiplier = -1
216
- # dim out divisor = 1
217
-```
218
-
219
-These `dim` settings produce two dimensions, `in` and `out`, both of which use the `incremental` algorithm. By
220
-multiplying the value of `out` by -1, Netdata creates the negative values seen in the following area chart:
221
-
222
-
205
+| setting | default | info |
206
+|:---------------:|:--------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------|
207
+| update every | the value of `[global].update every` setting | The frequency in seconds the plugin should collect values. For more information check the [performance guide](/docs/guides/configure/performance.md). |
208
+| command options | - | Additional command line options to pass to the plugin. | |
209
210
+External plugins that need additional configuration may support a dedicated file in `/etc/netdata`. Check their
211
+documentation.
212
daemon/main.c
+87
-18
@@ -385,24 +385,24 @@ static void security_init(){
385
static void log_init(void) {
386
char filename[FILENAME_MAX + 1];
387
snprintfz(filename, FILENAME_MAX, "%s/debug.log", netdata_configured_log_dir);
388
- stdout_filename = config_get(CONFIG_SECTION_GLOBAL, "debug log", filename);
388
+ stdout_filename = config_get(CONFIG_SECTION_LOGS, "debug", filename);
389
390
snprintfz(filename, FILENAME_MAX, "%s/error.log", netdata_configured_log_dir);
391
- stderr_filename = config_get(CONFIG_SECTION_GLOBAL, "error log", filename);
391
+ stderr_filename = config_get(CONFIG_SECTION_LOGS, "error", filename);
392
393
snprintfz(filename, FILENAME_MAX, "%s/access.log", netdata_configured_log_dir);
394
- stdaccess_filename = config_get(CONFIG_SECTION_GLOBAL, "access log", filename);
394
+ stdaccess_filename = config_get(CONFIG_SECTION_LOGS, "access", filename);
395
396
char deffacility[8];
397
snprintfz(deffacility,7,"%s","daemon");
398
- facility_log = config_get(CONFIG_SECTION_GLOBAL, "facility log", deffacility);
398
+ facility_log = config_get(CONFIG_SECTION_LOGS, "facility", deffacility);
399
400
- error_log_throttle_period = config_get_number(CONFIG_SECTION_GLOBAL, "errors flood protection period", error_log_throttle_period);
401
- error_log_errors_per_period = (unsigned long)config_get_number(CONFIG_SECTION_GLOBAL, "errors to trigger flood protection", (long long int)error_log_errors_per_period);
400
+ error_log_throttle_period = config_get_number(CONFIG_SECTION_LOGS, "errors flood protection period", error_log_throttle_period);
401
+ error_log_errors_per_period = (unsigned long)config_get_number(CONFIG_SECTION_LOGS, "errors to trigger flood protection", (long long int)error_log_errors_per_period);
402
error_log_errors_per_period_backup = error_log_errors_per_period;
403
404
- setenv("NETDATA_ERRORS_THROTTLE_PERIOD", config_get(CONFIG_SECTION_GLOBAL, "errors flood protection period" , ""), 1);
405
- setenv("NETDATA_ERRORS_PER_PERIOD", config_get(CONFIG_SECTION_GLOBAL, "errors to trigger flood protection", ""), 1);
404
+ setenv("NETDATA_ERRORS_THROTTLE_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors flood protection period" , ""), 1);
405
+ setenv("NETDATA_ERRORS_PER_PERIOD", config_get(CONFIG_SECTION_LOGS, "errors to trigger flood protection", ""), 1);
406
}
407
408
char *initialize_lock_directory_path(char *prefix)
@@ -410,7 +410,7 @@ char *initialize_lock_directory_path(char *prefix)
410
char filename[FILENAME_MAX + 1];
411
snprintfz(filename, FILENAME_MAX, "%s/lock", prefix);
412
413
- return config_get(CONFIG_SECTION_GLOBAL, "lock directory", filename);
413
+ return config_get(CONFIG_SECTION_DIRECTORIES, "lock", filename);
414
}
415
416
static void backwards_compatible_config() {
@@ -447,6 +447,75 @@ static void backwards_compatible_config() {
447
448
config_move(CONFIG_SECTION_GLOBAL, "web compression level",
449
CONFIG_SECTION_WEB, "gzip compression level");
450
+
451
+ config_move(CONFIG_SECTION_GLOBAL, "config directory",
452
+ CONFIG_SECTION_DIRECTORIES, "config");
453
+
454
+ config_move(CONFIG_SECTION_GLOBAL, "stock config directory",
455
+ CONFIG_SECTION_DIRECTORIES, "stock config");
456
+
457
+ config_move(CONFIG_SECTION_GLOBAL, "log directory",
458
+ CONFIG_SECTION_DIRECTORIES, "log");
459
+
460
+ config_move(CONFIG_SECTION_GLOBAL, "web files directory",
461
+ CONFIG_SECTION_DIRECTORIES, "web");
462
+
463
+ config_move(CONFIG_SECTION_GLOBAL, "cache directory",
464
+ CONFIG_SECTION_DIRECTORIES, "cache");
465
+
466
+ config_move(CONFIG_SECTION_GLOBAL, "lib directory",
467
+ CONFIG_SECTION_DIRECTORIES, "lib");
468
+
469
+ config_move(CONFIG_SECTION_GLOBAL, "home directory",
470
+ CONFIG_SECTION_DIRECTORIES, "home");
471
+
472
+ config_move(CONFIG_SECTION_GLOBAL, "lock directory",
473
+ CONFIG_SECTION_DIRECTORIES, "lock");
474
+
475
+ config_move(CONFIG_SECTION_GLOBAL, "plugins directory",
476
+ CONFIG_SECTION_DIRECTORIES, "plugins");
477
+
478
+ config_move(CONFIG_SECTION_HEALTH, "health configuration directory",
479
+ CONFIG_SECTION_DIRECTORIES, "health config");
480
+
481
+ config_move(CONFIG_SECTION_HEALTH, "stock health configuration directory",
482
+ CONFIG_SECTION_DIRECTORIES, "stock health config");
483
+
484
+ config_move(CONFIG_SECTION_REGISTRY, "registry db directory",
485
+ CONFIG_SECTION_DIRECTORIES, "registry");
486
+
487
+ config_move(CONFIG_SECTION_GLOBAL, "debug log",
488
+ CONFIG_SECTION_LOGS, "debug");
489
+
490
+ config_move(CONFIG_SECTION_GLOBAL, "error log",
491
+ CONFIG_SECTION_LOGS, "error");
492
+
493
+ config_move(CONFIG_SECTION_GLOBAL, "access log",
494
+ CONFIG_SECTION_LOGS, "access");
495
+
496
+ config_move(CONFIG_SECTION_GLOBAL, "facility log",
497
+ CONFIG_SECTION_LOGS, "facility");
498
+
499
+ config_move(CONFIG_SECTION_GLOBAL, "errors flood protection period",
500
+ CONFIG_SECTION_LOGS, "errors flood protection period");
501
+
502
+ config_move(CONFIG_SECTION_GLOBAL, "errors to trigger flood protection",
503
+ CONFIG_SECTION_LOGS, "errors to trigger flood protection");
504
+
505
+ config_move(CONFIG_SECTION_GLOBAL, "debug flags",
506
+ CONFIG_SECTION_LOGS, "debug flags");
507
+
508
+ config_move(CONFIG_SECTION_GLOBAL, "TZ environment variable",
509
+ CONFIG_SECTION_ENV_VARS, "TZ");
510
+
511
+ config_move(CONFIG_SECTION_PLUGINS, "PATH environment variable",
512
+ CONFIG_SECTION_ENV_VARS, "PATH");
513
+
514
+ config_move(CONFIG_SECTION_PLUGINS, "PYTHONPATH environment variable",
515
+ CONFIG_SECTION_ENV_VARS, "PYTHONPATH");
516
+
517
+ config_move(CONFIG_SECTION_STATSD, "enabled",
518
+ CONFIG_SECTION_PLUGINS, "statsd");
519
}
520
521
static void get_netdata_configured_variables() {
@@ -491,14 +560,14 @@ static void get_netdata_configured_variables() {
560
// ------------------------------------------------------------------------
561
// get system paths
562
494
- netdata_configured_user_config_dir = config_get(CONFIG_SECTION_GLOBAL, "config directory", netdata_configured_user_config_dir);
495
- netdata_configured_stock_config_dir = config_get(CONFIG_SECTION_GLOBAL, "stock config directory", netdata_configured_stock_config_dir);
496
- netdata_configured_log_dir = config_get(CONFIG_SECTION_GLOBAL, "log directory", netdata_configured_log_dir);
497
- netdata_configured_web_dir = config_get(CONFIG_SECTION_GLOBAL, "web files directory", netdata_configured_web_dir);
498
- netdata_configured_cache_dir = config_get(CONFIG_SECTION_GLOBAL, "cache directory", netdata_configured_cache_dir);
499
- netdata_configured_varlib_dir = config_get(CONFIG_SECTION_GLOBAL, "lib directory", netdata_configured_varlib_dir);
563
+ netdata_configured_user_config_dir = config_get(CONFIG_SECTION_DIRECTORIES, "config", netdata_configured_user_config_dir);
564
+ netdata_configured_stock_config_dir = config_get(CONFIG_SECTION_DIRECTORIES, "stock config", netdata_configured_stock_config_dir);
565
+ netdata_configured_log_dir = config_get(CONFIG_SECTION_DIRECTORIES, "log", netdata_configured_log_dir);
566
+ netdata_configured_web_dir = config_get(CONFIG_SECTION_DIRECTORIES, "web", netdata_configured_web_dir);
567
+ netdata_configured_cache_dir = config_get(CONFIG_SECTION_DIRECTORIES, "cache", netdata_configured_cache_dir);
568
+ netdata_configured_varlib_dir = config_get(CONFIG_SECTION_DIRECTORIES, "lib", netdata_configured_varlib_dir);
569
char *env_home=getenv("HOME");
501
- netdata_configured_home_dir = config_get(CONFIG_SECTION_GLOBAL, "home directory", env_home?env_home:netdata_configured_home_dir);
570
+ netdata_configured_home_dir = config_get(CONFIG_SECTION_DIRECTORIES, "home", env_home?env_home:netdata_configured_home_dir);
571
572
netdata_configured_lock_dir = initialize_lock_directory_path(netdata_configured_varlib_dir);
573
@@ -912,7 +981,7 @@ int main(int argc, char **argv) {
981
}
982
else if(strncmp(optarg, debug_flags_string, strlen(debug_flags_string)) == 0) {
983
optarg += strlen(debug_flags_string);
915
- config_set(CONFIG_SECTION_GLOBAL, "debug flags", optarg);
984
+ config_set(CONFIG_SECTION_LOGS, "debug flags", optarg);
985
debug_flags = strtoull(optarg, NULL, 0);
986
}
987
else if(strcmp(optarg, "set") == 0) {
@@ -1123,7 +1192,7 @@ int main(int argc, char **argv) {
1192
// --------------------------------------------------------------------
1193
// get the debugging flags from the configuration file
1194
1126
- char *flags = config_get(CONFIG_SECTION_GLOBAL, "debug flags", "0x0000000000000000");
1195
+ char *flags = config_get(CONFIG_SECTION_LOGS, "debug flags", "0x0000000000000000");
1196
setenv("NETDATA_DEBUG_FLAGS", flags, 1);
1197
1198
debug_flags = strtoull(flags, NULL, 0);
docs/contributing/style-guide.md
+2
-2
@@ -443,7 +443,7 @@ code, for example:
443
inline char *health_stock_config_dir(void) {
444
char buffer[FILENAME_MAX + 1];
445
snprintfz(buffer, FILENAME_MAX, "%s/health.d", netdata_configured_stock_config_dir);
446
- return config_get(CONFIG_SECTION_HEALTH, "stock health configuration directory", buffer);
446
+ return config_get(CONFIG_SECTION_DIRECTORIES, "stock health config", buffer);
447
}
448
```
449
````
@@ -454,7 +454,7 @@ And the prettified result:
454
inline char *health_stock_config_dir(void) {
455
char buffer[FILENAME_MAX + 1];
456
snprintfz(buffer, FILENAME_MAX, "%s/health.d", netdata_configured_stock_config_dir);
457
- return config_get(CONFIG_SECTION_HEALTH, "stock health configuration directory", buffer);
457
+ return config_get(CONFIG_SECTION_DIRECTORIES, "stock health config", buffer);
458
}
459
```
460
docs/guides/configure/performance.md
+4
-5
@@ -108,9 +108,9 @@ Open `netdata.conf` and scroll down to the `[plugins]` section. To disable any p
108
```conf
109
[plugins]
110
proc = yes
111
- python.d = no
112
- charts.d = no
113
- go.d = yes
111
+ python.d = no
112
+ charts.d = no
113
+ go.d = yes
114
```
115
116
Disable specific collectors by opening their respective plugin configuration files, uncommenting the line for the
@@ -183,7 +183,6 @@ Finally, edit `netdata.conf` with the following settings:
183
```conf
184
[global]
185
bind socket to IP = 127.0.0.1
186
- access log = none
186
disconnect idle web clients after seconds = 3600
187
enable web responses gzip compression = no
188
```
@@ -215,7 +214,7 @@ If you installation is working correctly, and you're not actively auditing Netda
214
`netdata.conf`.
215
216
```conf
218
-[global]
217
+[logs]
218
debug log = none
219
error log = none
220
access log = none
health/QUICKSTART.md
+2
-2
@@ -41,9 +41,9 @@ address or hostname for your Agent dashboard, looking for the `stock health conf
41
here will show the correct path for your installation.
42
43
```conf
44
-[health]
44
+[directories]
45
...
46
- # stock health configuration directory = /usr/lib/netdata/conf.d/health.d
46
+ # stock health config = /usr/lib/netdata/conf.d/health.d
47
```
48
49
Navigate to the health configuration directory to see all the available files and open them for reading.
health/health.c
+2
-2
@@ -58,7 +58,7 @@ static inline void unlink_alarm_notify_in_progress(ALARM_ENTRY *ae)
58
inline char *health_user_config_dir(void) {
59
char buffer[FILENAME_MAX + 1];
60
snprintfz(buffer, FILENAME_MAX, "%s/health.d", netdata_configured_user_config_dir);
61
- return config_get(CONFIG_SECTION_HEALTH, "health configuration directory", buffer);
61
+ return config_get(CONFIG_SECTION_DIRECTORIES, "health config", buffer);
62
}
63
64
/**
@@ -71,7 +71,7 @@ inline char *health_user_config_dir(void) {
71
inline char *health_stock_config_dir(void) {
72
char buffer[FILENAME_MAX + 1];
73
snprintfz(buffer, FILENAME_MAX, "%s/health.d", netdata_configured_stock_config_dir);
74
- return config_get(CONFIG_SECTION_HEALTH, "stock health configuration directory", buffer);
74
+ return config_get(CONFIG_SECTION_DIRECTORIES, "stock health config", buffer);
75
}
76
77
/**
libnetdata/config/appconfig.c
+17
-15
@@ -819,24 +819,26 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed)
819
"#\n"
820
"\n# global netdata configuration\n");
821
822
- for(i = 0; i <= 13 ;i++) {
822
+ for(i = 0; i <= 15 ;i++) {
823
appconfig_wrlock(root);
824
for(co = root->first_section; co ; co = co->next) {
825
if(!strcmp(co->name, CONFIG_SECTION_GLOBAL)) pri = 0;
826
- else if(!strcmp(co->name, CONFIG_SECTION_HOST_LABEL)) pri = 1;
827
- else if(!strcmp(co->name, CONFIG_SECTION_SQLITE)) pri = 2;
828
- else if(!strcmp(co->name, CONFIG_SECTION_CLOUD)) pri = 3;
829
- else if(!strcmp(co->name, CONFIG_SECTION_ML)) pri = 4;
830
- else if(!strcmp(co->name, CONFIG_SECTION_HEALTH)) pri = 5;
831
- else if(!strcmp(co->name, CONFIG_SECTION_STREAM)) pri = 6;
832
- else if(!strcmp(co->name, CONFIG_SECTION_WEB)) pri = 7;
833
- // by default, new sections will get pri = 8 (set at the end, below)
834
- else if(!strcmp(co->name, CONFIG_SECTION_REGISTRY)) pri = 9;
835
- else if(!strcmp(co->name, CONFIG_SECTION_GLOBAL_STATISTICS)) pri = 10;
836
- else if(!strcmp(co->name, CONFIG_SECTION_STATSD)) pri = 11;
837
- else if(!strcmp(co->name, CONFIG_SECTION_PLUGINS)) pri = 12;
838
- else if(!strncmp(co->name, "plugin:", 7)) pri = 13; // << change the loop too if you change this
839
- else pri = 8; // this is used for any new (currently unknown) sections
826
+ else if(!strcmp(co->name, CONFIG_SECTION_DIRECTORIES)) pri = 1;
827
+ else if(!strcmp(co->name, CONFIG_SECTION_LOGS)) pri = 2;
828
+ else if(!strcmp(co->name, CONFIG_SECTION_ENV_VARS)) pri = 3;
829
+ else if(!strcmp(co->name, CONFIG_SECTION_HOST_LABEL)) pri = 4;
830
+ else if(!strcmp(co->name, CONFIG_SECTION_SQLITE)) pri = 5;
831
+ else if(!strcmp(co->name, CONFIG_SECTION_CLOUD)) pri = 6;
832
+ else if(!strcmp(co->name, CONFIG_SECTION_ML)) pri = 7;
833
+ else if(!strcmp(co->name, CONFIG_SECTION_HEALTH)) pri = 8;
834
+ else if(!strcmp(co->name, CONFIG_SECTION_WEB)) pri = 9;
835
+ // by default, new sections will get pri = 10 (set at the end, below)
836
+ else if(!strcmp(co->name, CONFIG_SECTION_REGISTRY)) pri = 11;
837
+ else if(!strcmp(co->name, CONFIG_SECTION_GLOBAL_STATISTICS)) pri = 12;
838
+ else if(!strcmp(co->name, CONFIG_SECTION_PLUGINS)) pri = 13;
839
+ else if(!strcmp(co->name, CONFIG_SECTION_STATSD)) pri = 14;
840
+ else if(!strncmp(co->name, "plugin:", 7)) pri = 15; // << change the loop too if you change this
841
+ else pri = 10; // this is used for any new (currently unknown) sections
842
843
if(i == pri) {
844
int loaded = 0;
libnetdata/config/appconfig.h
+18
-15
@@ -82,21 +82,24 @@
82
83
#define CONFIG_FILENAME "netdata.conf"
84
85
-#define CONFIG_SECTION_GLOBAL "global"
86
-#define CONFIG_SECTION_SQLITE "sqlite"
87
-#define CONFIG_SECTION_WEB "web"
88
-#define CONFIG_SECTION_STATSD "statsd"
89
-#define CONFIG_SECTION_PLUGINS "plugins"
90
-#define CONFIG_SECTION_CLOUD "cloud"
91
-#define CONFIG_SECTION_REGISTRY "registry"
92
-#define CONFIG_SECTION_HEALTH "health"
93
-#define CONFIG_SECTION_STREAM "stream"
94
-#define CONFIG_SECTION_ML "ml"
95
-#define CONFIG_SECTION_EXPORTING "exporting:global"
96
-#define CONFIG_SECTION_PROMETHEUS "prometheus:exporter"
97
-#define CONFIG_SECTION_HOST_LABEL "host labels"
98
-#define EXPORTING_CONF "exporting.conf"
99
-#define CONFIG_SECTION_GLOBAL_STATISTICS "global statistics"
85
+#define CONFIG_SECTION_GLOBAL "global"
86
+#define CONFIG_SECTION_DIRECTORIES "directories"
87
+#define CONFIG_SECTION_LOGS "logs"
88
+#define CONFIG_SECTION_ENV_VARS "environment variables"
89
+#define CONFIG_SECTION_SQLITE "sqlite"
90
+#define CONFIG_SECTION_WEB "web"
91
+#define CONFIG_SECTION_STATSD "statsd"
92
+#define CONFIG_SECTION_PLUGINS "plugins"
93
+#define CONFIG_SECTION_CLOUD "cloud"
94
+#define CONFIG_SECTION_REGISTRY "registry"
95
+#define CONFIG_SECTION_HEALTH "health"
96
+#define CONFIG_SECTION_STREAM "stream"
97
+#define CONFIG_SECTION_ML "ml"
98
+#define CONFIG_SECTION_EXPORTING "exporting:global"
99
+#define CONFIG_SECTION_PROMETHEUS "prometheus:exporter"
100
+#define CONFIG_SECTION_HOST_LABEL "host labels"
101
+#define EXPORTING_CONF "exporting.conf"
102
+#define CONFIG_SECTION_GLOBAL_STATISTICS "global statistics"
103
104
// these are used to limit the configuration names and values lengths
105
// they are not enforced by config.c functions (they will strdup() all strings, no matter of their length)
registry/registry_init.c
+1
-1
@@ -18,7 +18,7 @@ int registry_init(void) {
18
19
// pathnames
20
snprintfz(filename, FILENAME_MAX, "%s/registry", netdata_configured_varlib_dir);
21
- registry.pathname = config_get(CONFIG_SECTION_REGISTRY, "registry db directory", filename);
21
+ registry.pathname = config_get(CONFIG_SECTION_DIRECTORIES, "registry", filename);
22
if(mkdir(registry.pathname, 0770) == -1 && errno != EEXIST)
23
fatal("Cannot create directory '%s'.", registry.pathname);
24