summaryrefslogtreecommitdiffstats
path: root/src/daemon/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/config')
-rw-r--r--src/daemon/config/README.md66
-rw-r--r--src/daemon/config/dyncfg-echo.c6
-rw-r--r--src/daemon/config/dyncfg-intercept.c2
-rw-r--r--src/daemon/config/dyncfg-tree.c12
-rw-r--r--src/daemon/config/dyncfg-unittest.c6
-rw-r--r--src/daemon/config/dyncfg.c3
-rw-r--r--src/daemon/config/dyncfg.h2
7 files changed, 43 insertions, 54 deletions
diff --git a/src/daemon/config/README.md b/src/daemon/config/README.md
index 3c0912fba..7217ec4ea 100644
--- a/src/daemon/config/README.md
+++ b/src/daemon/config/README.md
@@ -1,13 +1,3 @@
-<!--
-title: "Daemon configuration"
-description: "The Netdata Agent's daemon is installed preconfigured to collect thousands of metrics every second, but is highly configurable for real-world workloads."
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/daemon/config/README.md"
-sidebar_label: "Daemon"
-learn_status: "Published"
-learn_rel_path: "Configuration"
-learn_doc_purpose: "Explain the daemon options, the log files, the process scheduling, virtual memory, explain how the netdata.conf is used and backlink to the netdata.conf file reference"
--->
-
# Daemon configuration
<details>
@@ -53,7 +43,7 @@ comment on settings it does not currently use.
## Applying changes
-After `netdata.conf` has been modified, Netdata needs to be [restarted](/packaging/installer/README.md#maintaining-a-netdata-agent-installation) for
+After `netdata.conf` has been modified, Netdata needs to be [restarted](/docs/netdata-agent/start-stop-restart.md) for
changes to apply:
```bash
@@ -86,24 +76,22 @@ Please note that your data history will be lost if you have modified `history` p
### [db] section options
-| setting | default | info |
-|:---------------------------------------------:|:----------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `dbengine page cache size MB` and `dbengine disk space MB`. <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`alloc`: Similar to `ram`, but can significantly reduce memory usage, when combined with a low retention and does not support KSM. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. Not to be used together with streaming. |
-| retention | `3600` | Used with `mode = ram/alloc`, not the default `mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. Check [Memory Requirements](/src/database/README.md) for more information. |
-| storage tiers | `3` | The number of storage tiers you want to have in your dbengine. Check the tiering mechanism in the [dbengine's reference](/src/database/engine/README.md#tiering). You can have up to 5 tiers of data (including the _Tier 0_). This number ranges between 1 and 5. |
-| dbengine page cache size MB | `32` | Determines the amount of RAM in MiB that is dedicated to caching for _Tier 0_ Netdata metric values. |
-| dbengine tier **`N`** page cache size MB | `32` | Determines the amount of RAM in MiB that is dedicated for caching Netdata metric values of the **`N`** tier. <br /> `N belongs to [1..4]` |
-| dbengine disk space MB | `256` | Determines the amount of disk space in MiB that is dedicated to storing _Tier 0_ Netdata metric values and all related metadata describing them. This option is available **only for legacy configuration** (`Agent v1.23.2 and prior`). |
-| dbengine multihost disk space MB | `256` | Same functionality as `dbengine disk space MB`, but includes support for storing metrics streamed to a parent node by its children. Can be used in single-node environments as well. This setting is only for _Tier 0_ metrics. |
-| dbengine tier **`N`** multihost disk space MB | `256` | Same functionality as `dbengine multihost disk space MB`, but stores metrics of the **`N`** tier (both parent node and its children). Can be used in single-node environments as well. <br /> `N belongs to [1..4]` |
-| update every | `1` | The frequency in seconds, for data collection. For more information see the [performance guide](/docs/netdata-agent/configuration/optimize-the-netdata-agents-performance.md). These metrics stored as _Tier 0_ data. Explore the tiering mechanism in the [dbengine's reference](/src/database/engine/README.md#tiering). |
-| dbengine tier **`N`** update every iterations | `60` | The down sampling value of each tier from the previous one. For each Tier, the greater by one Tier has N (equal to 60 by default) less data points of any metric it collects. This setting can take values from `2` up to `255`. <br /> `N belongs to [1..4]` |
-| dbengine tier **`N`** back fill | `New` | Specifies the strategy of recreating missing data on each Tier from the exact lower Tier. <br /> `New`: Sees the latest point on each Tier and save new points to it only if the exact lower Tier has available points for it's observation window (`dbengine tier N update every iterations` window). <br /> `none`: No back filling is applied. <br /> `N belongs to [1..4]` |
-| memory deduplication (ksm) | `yes` | When set to `yes`, Netdata will offer its in-memory round robin database and the dbengine page cache to kernel same page merging (KSM) for deduplication. For more information check [Memory Deduplication - Kernel Same Page Merging - KSM](/src/database/README.md#ksm) |
-| cleanup obsolete charts after secs | `3600` | See [monitoring ephemeral containers](/src/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also sets the timeout for cleaning up obsolete dimensions |
-| gap when lost iterations above | `1` | |
-| cleanup orphan hosts after secs | `3600` | How long to wait until automatically removing from the DB a remote Netdata host (child) that is no longer sending data. |
-| enable zero metrics | `no` | Set to `yes` to show charts when all their metrics are zero. |
+| setting | default | info |
+|:---------------------------------------------:|:-------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| mode | `dbengine` | `dbengine`: The default for long-term metrics storage with efficient RAM and disk usage. Can be extended with `dbengine page cache size` and `dbengine tier X retention size`. <br />`ram`: The round-robin database will be temporary and it will be lost when Netdata exits. <br />`alloc`: Similar to `ram`, but can significantly reduce memory usage, when combined with a low retention and does not support KSM. <br />`none`: Disables the database at this host, and disables health monitoring entirely, as that requires a database of metrics. Not to be used together with streaming. |
+| retention | `3600` | Used with `mode = ram/alloc`, not the default `mode = dbengine`. This number reflects the number of entries the `netdata` daemon will by default keep in memory for each chart dimension. Check [Memory Requirements](/src/database/README.md) for more information. |
+| storage tiers | `3` | The number of storage tiers you want to have in your dbengine. Check the tiering mechanism in the [dbengine's reference](/src/database/engine/README.md#tiering). You can have up to 5 tiers of data (including the _Tier 0_). This number ranges between 1 and 5. |
+| dbengine page cache size | `32MiB` | Determines the amount of RAM in MiB that is dedicated to caching for _Tier 0_ Netdata metric values. |
+| dbengine tier **`N`** retention size | `1GiB` | The disk space dedicated to metrics storage, per tier. Can be used in single-node environments as well. <br /> `N belongs to [1..4]` |
+| dbengine tier **`N`** retention time | `14d`, `3mo`, `1y`, `1y`, `1y` | The database retention, expressed in time. Can be used in single-node environments as well. <br /> `N belongs to [1..4]` |
+| update every | `1` | The frequency in seconds, for data collection. For more information see the [performance guide](/docs/netdata-agent/configuration/optimize-the-netdata-agents-performance.md). These metrics stored as _Tier 0_ data. Explore the tiering mechanism in the [dbengine's reference](/src/database/engine/README.md#tiering). |
+| dbengine tier **`N`** update every iterations | `60` | The down sampling value of each tier from the previous one. For each Tier, the greater by one Tier has N (equal to 60 by default) less data points of any metric it collects. This setting can take values from `2` up to `255`. <br /> `N belongs to [1..4]` |
+| dbengine tier back fill | `new` | Specifies the strategy of recreating missing data on higher database Tiers.<br /> `new`: Sees the latest point on each Tier and save new points to it only if the exact lower Tier has available points for it's observation window (`dbengine tier N update every iterations` window). <br /> `none`: No back filling is applied. <br /> `N belongs to [1..4]` |
+| memory deduplication (ksm) | `yes` | When set to `yes`, Netdata will offer its in-memory round robin database and the dbengine page cache to kernel same page merging (KSM) for deduplication. For more information check [Memory Deduplication - Kernel Same Page Merging - KSM](/src/database/README.md#ksm) |
+| cleanup obsolete charts after | `1h` | See [monitoring ephemeral containers](/src/collectors/cgroups.plugin/README.md#monitoring-ephemeral-containers), also sets the timeout for cleaning up obsolete dimensions |
+| gap when lost iterations above | `1` | |
+| cleanup orphan hosts after | `1h` | How long to wait until automatically removing from the DB a remote Netdata host (child) that is no longer sending data. |
+| enable zero metrics | `no` | Set to `yes` to show charts when all their metrics are zero. |
> ### Info
>
@@ -140,7 +128,7 @@ There are additional configuration options for the logs. For more info, see [Net
| health | `journal` | The filename to save the log of Netdata health collectors. You can also set it to `syslog` to send the access log to syslog, or `off` to disable this log. Defaults to `Journal` if using systemd. |
| daemon | `journal` | The filename to save the log of Netdata daemon. You can also set it to `syslog` to send the access log to syslog, or `off` to disable this log. Defaults to `Journal` if using systemd. |
| facility | `daemon` | A facility keyword is used to specify the type of system that is logging the message. |
-| logs flood protection period | `60` | Length of period (in sec) during which the number of errors should not exceed the `errors to trigger flood protection`. |
+| logs flood protection period | `1m` | Length of period during which the number of errors should not exceed the `errors to trigger flood protection`. |
| logs to trigger flood protection | `1000` | Number of errors written to the log in `errors flood protection period` sec before flood protection is activated. |
| level | `info` | Controls which log messages are logged, with error being the most important. Supported values: `info` and `error`. |
@@ -172,15 +160,15 @@ monitoring](/src/health/README.md).
[Alert notifications](/src/health/notifications/README.md) are configured in `health_alarm_notify.conf`.
-| setting | default | info |
-|:----------------------------------------------:|:------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| enabled | `yes` | Set to `no` to disable all alerts and notifications |
-| in memory max health log entries | 1000 | Size of the alert history held in RAM |
-| script to execute on alarm | `/usr/libexec/netdata/plugins.d/alarm-notify.sh` | The script that sends alert 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`). |
-| run at least every seconds | `10` | Controls how often all alert conditions should be evaluated. |
-| postpone alarms during hibernation for seconds | `60` | Prevents false alerts. May need to be increased if you get alerts during hibernation. |
-| health log history | `432000` | Specifies the history of alert events (in seconds) kept in the agent's sqlite database. |
-| enabled alarms | * | Defines which alerts to load from both user and stock directories. This is a [simple pattern](/src/libnetdata/simple_pattern/README.md) list of alert or template names. Can be used to disable specific alerts. For example, `enabled alarms = !oom_kill *` will load all alerts except `oom_kill`. |
+| setting | default | info |
+|:--------------------------------------:|:------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| enabled | `yes` | Set to `no` to disable all alerts and notifications |
+| in memory max health log entries | 1000 | Size of the alert history held in RAM |
+| script to execute on alarm | `/usr/libexec/netdata/plugins.d/alarm-notify.sh` | The script that sends alert 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`). |
+| run at least every | `10s` | Controls how often all alert conditions should be evaluated. |
+| postpone alarms during hibernation for | `1m` | Prevents false alerts. May need to be increased if you get alerts during hibernation. |
+| health log retention | `5d` | Specifies the history of alert events (in seconds) kept in the agent's sqlite database. |
+| enabled alarms | * | Defines which alerts to load from both user and stock directories. This is a [simple pattern](/src/libnetdata/simple_pattern/README.md) list of alert or template names. Can be used to disable specific alerts. For example, `enabled alarms = !oom_kill *` will load all alerts except `oom_kill`. |
### [web] section options
diff --git a/src/daemon/config/dyncfg-echo.c b/src/daemon/config/dyncfg-echo.c
index 95d40a025..f6eb48c35 100644
--- a/src/daemon/config/dyncfg-echo.c
+++ b/src/daemon/config/dyncfg-echo.c
@@ -96,7 +96,7 @@ void dyncfg_echo(const DICTIONARY_ITEM *item, DYNCFG *df, const char *id __maybe
dyncfg_echo_cb, e,
NULL, NULL,
NULL, NULL,
- NULL, string2str(df->dyncfg.source));
+ NULL, string2str(df->dyncfg.source), false);
}
// ----------------------------------------------------------------------------
@@ -129,7 +129,7 @@ void dyncfg_echo_update(const DICTIONARY_ITEM *item, DYNCFG *df, const char *id)
dyncfg_echo_cb, e,
NULL, NULL,
NULL, NULL,
- df->dyncfg.payload, string2str(df->dyncfg.source));
+ df->dyncfg.payload, string2str(df->dyncfg.source), false);
}
// ----------------------------------------------------------------------------
@@ -164,7 +164,7 @@ static void dyncfg_echo_payload_add(const DICTIONARY_ITEM *item_template __maybe
dyncfg_echo_cb, e,
NULL, NULL,
NULL, NULL,
- df_job->dyncfg.payload, string2str(df_job->dyncfg.source));
+ df_job->dyncfg.payload, string2str(df_job->dyncfg.source), false);
}
void dyncfg_echo_add(const DICTIONARY_ITEM *item_template, const DICTIONARY_ITEM *item_job, DYNCFG *df_template, DYNCFG *df_job, const char *template_id, const char *job_name) {
diff --git a/src/daemon/config/dyncfg-intercept.c b/src/daemon/config/dyncfg-intercept.c
index 65f8383ed..b302d72aa 100644
--- a/src/daemon/config/dyncfg-intercept.c
+++ b/src/daemon/config/dyncfg-intercept.c
@@ -216,7 +216,7 @@ int dyncfg_function_intercept_cb(struct rrd_function_execute *rfe, void *data __
memcpy(buf, rfe->function, sizeof(buf));
char *words[20];
- size_t num_words = quoted_strings_splitter_pluginsd(buf, words, 20);
+ size_t num_words = quoted_strings_splitter_whitespace(buf, words, 20);
size_t i = 0;
char *config = get_word(words, num_words, i++);
diff --git a/src/daemon/config/dyncfg-tree.c b/src/daemon/config/dyncfg-tree.c
index 77d031fa0..4bad2f30f 100644
--- a/src/daemon/config/dyncfg-tree.c
+++ b/src/daemon/config/dyncfg-tree.c
@@ -71,12 +71,10 @@ static void dyncfg_tree_for_host(RRDHOST *host, BUFFER *wb, const char *path, co
if(id && *id)
template = string_strdupz(id);
- ND_UUID host_uuid = uuid2UUID(host->host_uuid);
-
size_t path_len = strlen(path);
DYNCFG *df;
dfe_start_read(dyncfg_globals.nodes, df) {
- if(!UUIDeq(df->host_uuid, host_uuid))
+ if(!UUIDeq(df->host_uuid, host->host_id))
continue;
if(strncmp(string2str(df->path), path, path_len) != 0)
@@ -162,7 +160,7 @@ static int dyncfg_config_execute_cb(struct rrd_function_execute *rfe, void *data
memcpy(buf, rfe->function, sizeof(buf));
char *words[MAX_FUNCTION_PARAMETERS]; // an array of pointers for the words in this line
- size_t num_words = quoted_strings_splitter_pluginsd(buf, words, MAX_FUNCTION_PARAMETERS);
+ size_t num_words = quoted_strings_splitter_whitespace(buf, words, MAX_FUNCTION_PARAMETERS);
const char *config = get_word(words, num_words, 0);
const char *action = get_word(words, num_words, 1);
@@ -266,7 +264,7 @@ static int dyncfg_config_execute_cb(struct rrd_function_execute *rfe, void *data
rrd_call_function_error(
rfe->result.wb,
- "unknown config id given", code);
+ "Unknown config id given.", code);
}
cleanup:
@@ -286,7 +284,7 @@ void dyncfg_host_init(RRDHOST *host) {
// This function needs to be async, although it is internal.
// The reason is that it can call by itself another function that may or may not be internal (sync).
- rrd_function_add(host, NULL, PLUGINSD_FUNCTION_CONFIG, 120,
- 1000, "Dynamic configuration", "config", HTTP_ACCESS_ANONYMOUS_DATA,
+ rrd_function_add(host, NULL, PLUGINSD_FUNCTION_CONFIG, 120, 1000, DYNCFG_FUNCTIONS_VERSION,
+ "Dynamic configuration", "config", HTTP_ACCESS_ANONYMOUS_DATA,
false, dyncfg_config_execute_cb, host);
}
diff --git a/src/daemon/config/dyncfg-unittest.c b/src/daemon/config/dyncfg-unittest.c
index 775dc7cbd..763451501 100644
--- a/src/daemon/config/dyncfg-unittest.c
+++ b/src/daemon/config/dyncfg-unittest.c
@@ -195,7 +195,7 @@ static int dyncfg_unittest_execute_cb(struct rrd_function_execute *rfe, void *da
memcpy(buf, rfe->function, sizeof(buf));
char *words[MAX_FUNCTION_PARAMETERS]; // an array of pointers for the words in this line
- size_t num_words = quoted_strings_splitter_pluginsd(buf, words, MAX_FUNCTION_PARAMETERS);
+ size_t num_words = quoted_strings_splitter_whitespace(buf, words, MAX_FUNCTION_PARAMETERS);
const char *config = get_word(words, num_words, 0);
const char *id = get_word(words, num_words, 1);
@@ -426,7 +426,7 @@ static int dyncfg_unittest_run(const char *cmd, BUFFER *wb, const char *payload,
memcpy(buf, cmd, sizeof(buf));
char *words[MAX_FUNCTION_PARAMETERS]; // an array of pointers for the words in this line
- size_t num_words = quoted_strings_splitter_pluginsd(buf, words, MAX_FUNCTION_PARAMETERS);
+ size_t num_words = quoted_strings_splitter_whitespace(buf, words, MAX_FUNCTION_PARAMETERS);
// const char *config = get_word(words, num_words, 0);
const char *id = get_word(words, num_words, 1);
@@ -473,7 +473,7 @@ static int dyncfg_unittest_run(const char *cmd, BUFFER *wb, const char *payload,
NULL, NULL,
NULL, NULL,
NULL, NULL,
- pld, source);
+ pld, source, false);
if(!DYNCFG_RESP_SUCCESS(rc)) {
nd_log(NDLS_DAEMON, NDLP_ERR, "DYNCFG UNITTEST: failed to run: %s; returned code %d", cmd, rc);
dyncfg_unittest_register_error(NULL, NULL);
diff --git a/src/daemon/config/dyncfg.c b/src/daemon/config/dyncfg.c
index 2f484d1ed..e6c1768cc 100644
--- a/src/daemon/config/dyncfg.c
+++ b/src/daemon/config/dyncfg.c
@@ -192,7 +192,7 @@ const DICTIONARY_ITEM *dyncfg_add_internal(RRDHOST *host, const char *id, const
rrd_function_execute_cb_t execute_cb, void *execute_cb_data,
bool overwrite_cb) {
DYNCFG tmp = {
- .host_uuid = uuid2UUID(host->host_uuid),
+ .host_uuid = host->host_id,
.path = string_strdupz(path),
.cmds = cmds,
.type = type,
@@ -358,6 +358,7 @@ bool dyncfg_add_low_level(RRDHOST *host, const char *id, const char *path,
string2str(df->function),
120,
1000,
+ DYNCFG_FUNCTIONS_VERSION,
"Dynamic configuration",
"config",
(view_access & edit_access),
diff --git a/src/daemon/config/dyncfg.h b/src/daemon/config/dyncfg.h
index 539eddbfb..84fab07d2 100644
--- a/src/daemon/config/dyncfg.h
+++ b/src/daemon/config/dyncfg.h
@@ -7,6 +7,8 @@
#include "database/rrd.h"
#include "database/rrdfunctions.h"
+#define DYNCFG_FUNCTIONS_VERSION 0
+
void dyncfg_add_streaming(BUFFER *wb);
bool dyncfg_available_for_rrdhost(RRDHOST *host);
void dyncfg_host_init(RRDHOST *host);