summaryrefslogtreecommitdiffstats
path: root/collectors/diskspace.plugin
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2019-07-12 15:45:35 +0300
committerGitHub <noreply@github.com>2019-07-12 15:45:35 +0300
commite8d6cde97c0bad7c598a3cc04c45603f0c942992 (patch)
tree6937fa6536d19327bb6add153eea6e1cb0755740 /collectors/diskspace.plugin
parentfecc659376d67f66f483799929eeb962d7b5abd2 (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 'collectors/diskspace.plugin')
-rw-r--r--collectors/diskspace.plugin/README.md2
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/collectors/diskspace.plugin/README.md b/collectors/diskspace.plugin/README.md
index 8f859e350f..019d47d56b 100644
--- a/collectors/diskspace.plugin/README.md
+++ b/collectors/diskspace.plugin/README.md
@@ -10,7 +10,7 @@ Two charts are available for every mount:
Simple patterns can be used to exclude mounts from showed statistics based on path or filesystem. By default read-only mounts are not displayed. To display them `yes` should be set for a chart instead of `auto`.
-By default, Netdata will enable monitoring metrics 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). Set `yes` for a chart instead of `auto` to enable it permanently.
+By default, Netdata will enable monitoring metrics 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). Set `yes` for a chart instead of `auto` to enable it 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.
```
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c
index 77b87b0934..eab607d84f 100644
--- a/collectors/diskspace.plugin/plugin_diskspace.c
+++ b/collectors/diskspace.plugin/plugin_diskspace.c
@@ -249,7 +249,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
int rendered = 0;
- if(m->do_space == CONFIG_BOOLEAN_YES || (m->do_space == CONFIG_BOOLEAN_AUTO && (bavail || breserved_root || bused))) {
+ if(m->do_space == CONFIG_BOOLEAN_YES || (m->do_space == CONFIG_BOOLEAN_AUTO &&
+ (bavail || breserved_root || bused ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
if(unlikely(!m->st_space)) {
m->do_space = CONFIG_BOOLEAN_YES;
m->st_space = rrdset_find_bytype_localhost("disk_space", disk);
@@ -289,7 +291,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
// --------------------------------------------------------------------------
- if(m->do_inodes == CONFIG_BOOLEAN_YES || (m->do_inodes == CONFIG_BOOLEAN_AUTO && (favail || freserved_root || fused))) {
+ if(m->do_inodes == CONFIG_BOOLEAN_YES || (m->do_inodes == CONFIG_BOOLEAN_AUTO &&
+ (favail || freserved_root || fused ||
+ netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
if(unlikely(!m->st_inodes)) {
m->do_inodes = CONFIG_BOOLEAN_YES;
m->st_inodes = rrdset_find_bytype_localhost("disk_inodes", disk);