diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-07-12 15:45:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-12 15:45:35 +0300 |
commit | e8d6cde97c0bad7c598a3cc04c45603f0c942992 (patch) | |
tree | 6937fa6536d19327bb6add153eea6e1cb0755740 /daemon | |
parent | fecc659376d67f66f483799929eeb962d7b5abd2 (diff) |
Add global configuration option for zero metrics (#6419)
* Add global configuration option for zero metrics
* Add the option to the cgroup plugin
* Add the option to the proc plugin (diskstats, meminfo, net_dev,
netstat, sctp_snmp, snmp, snmp6, sockstat, sockstat6, synproxy,
vmstat, system_edac_mc, system_node, btrfs, ksm, zfs)
* Add the option to the macos plugin
* Add the option to the freebsd plugin (devstat, getifaddrs,
getmntinfo, sysctl)
* Change the option behaviour with the 'auto' value
* Add the option to the tc plugin
* Update the documentation
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/common.h | 1 | ||||
-rw-r--r-- | daemon/config/README.md | 3 | ||||
-rw-r--r-- | daemon/main.c | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/daemon/common.h b/daemon/common.h index a15ddb8775..dfbd6cfef1 100644 --- a/daemon/common.h +++ b/daemon/common.h @@ -78,6 +78,7 @@ extern char *netdata_configured_varlib_dir; extern char *netdata_configured_home_dir; extern char *netdata_configured_host_prefix; extern char *netdata_configured_timezone; +extern int netdata_zero_metrics_enabled; extern int netdata_anonymous_statistics_enabled; int netdata_ready; diff --git a/daemon/config/README.md b/daemon/config/README.md index 4778cad24a..c36a5b6db2 100644 --- a/daemon/config/README.md +++ b/daemon/config/README.md @@ -74,6 +74,7 @@ gap when lost iterations above | `1` | cleanup orphan hosts after seconds | `3600` | How long to wait until automatically removing from the DB a remote netdata host (slave) that is no longer sending data. delete obsolete charts files | `yes` | See [monitoring ephemeral containers](../../collectors/cgroups.plugin/#monitoring-ephemeral-containers), also affects the deletion of files for obsolete dimensions delete orphan hosts files | `yes` | Set to `no` to disable non-responsive host removal. +enable zero metrics | `no` | Set to `yes` to show charts when all their metrics are zero. ### [web] section options @@ -128,7 +129,7 @@ The configuration options for plugins appear in sections following the pattern ` Most internal plugins will provide additional options. Check [Internal Plugins](../../collectors/) for more information. -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. +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. #### External plugins diff --git a/daemon/main.c b/daemon/main.c index 0ced908108..bd0970fddc 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -2,6 +2,7 @@ #include "common.h" +int netdata_zero_metrics_enabled; int netdata_anonymous_statistics_enabled; struct config netdata_config = { @@ -1214,6 +1215,8 @@ int main(int argc, char **argv) { web_server_config_options(); + netdata_zero_metrics_enabled = config_get_boolean_ondemand(CONFIG_SECTION_GLOBAL, "enable zero metrics", CONFIG_BOOLEAN_NO); + for (i = 0; static_threads[i].name != NULL ; i++) { struct netdata_static_thread *st = &static_threads[i]; @@ -1227,7 +1230,7 @@ int main(int argc, char **argv) { info("netdata initialization completed. Enjoy real-time performance monitoring!"); netdata_ready = 1; - + send_statistics("START", "-", "-"); // ------------------------------------------------------------------------ |