@cryptotaxi247 / netdata-1 / commits / e9079e5b1

Allow user to override the default behavior for read-only mounts (#5327)

* Allow user to override the default behaviour for read-only mounts * Improve documentation

Vladimir Kobal committed Feb 5, 2019 at 21:03 UTC e9079e5b1826e63049ad5a696b38393063bb511f
2 files changed +28 -1
collectors/diskspace.plugin/README.md
+27
@@ -2,6 +2,33 @@
2
3 This plugin monitors the disk space usage of mounted disks, under Linux.
4
5 +Two charts are available for every mount:
6 + - Disk Space Usage
7 + - Disk Files (inodes) Usage
8 +
9 +## configuration
10 +
11 +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`.
12 +
13 +```
14 +[plugin:proc:diskspace]
15 + # remove charts of unmounted disks = yes
16 + # update every = 1
17 + # check for new mount points every = 15
18 + # exclude space metrics on paths = /proc/* /sys/* /var/run/user/* /run/user/* /snap/* /var/lib/docker/*
19 + # exclude space metrics on filesystems = *gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl
20 + # space usage for all disks = auto
21 + # inodes usage for all disks = auto
22 +```
23 +
24 +Charts can be enabled/disabled for every mount separately:
25 +
26 +```
27 +[plugin:proc:diskspace:/]
28 + # space usage = auto
29 + # inodes usage = auto
30 +```
31 +
32 > for disks performance monitoring, see the `proc` plugin, [here](../proc.plugin/#monitoring-disks)
33
34
collectors/diskspace.plugin/plugin_diskspace.c
+1 -1
@@ -190,7 +190,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
190 if(unlikely(m->do_space == CONFIG_BOOLEAN_NO && m->do_inodes == CONFIG_BOOLEAN_NO))
191 return;
192
193 - if(unlikely(mi->flags & MOUNTINFO_READONLY && !m->collected))
193 + if(unlikely(mi->flags & MOUNTINFO_READONLY && !m->collected && m->do_space != CONFIG_BOOLEAN_YES && m->do_inodes != CONFIG_BOOLEAN_YES))
194 return;
195
196 struct statvfs buff_statvfs;