diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-02-05 21:03:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 21:03:11 +0200 |
commit | e9079e5b1826e63049ad5a696b38393063bb511f (patch) | |
tree | d90c117d1fa92483c1ec0dc7d02956d2367ec3d8 /collectors/diskspace.plugin | |
parent | 4c441397dd2b0114a2382c7fb9470ac49a3629c8 (diff) |
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
Diffstat (limited to 'collectors/diskspace.plugin')
-rw-r--r-- | collectors/diskspace.plugin/README.md | 27 | ||||
-rw-r--r-- | collectors/diskspace.plugin/plugin_diskspace.c | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/collectors/diskspace.plugin/README.md b/collectors/diskspace.plugin/README.md index 83fd057725..d743312c88 100644 --- a/collectors/diskspace.plugin/README.md +++ b/collectors/diskspace.plugin/README.md @@ -2,6 +2,33 @@ This plugin monitors the disk space usage of mounted disks, under Linux. +Two charts are available for every mount: + - Disk Space Usage + - Disk Files (inodes) Usage + +## configuration + +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`. + +``` +[plugin:proc:diskspace] + # remove charts of unmounted disks = yes + # update every = 1 + # check for new mount points every = 15 + # exclude space metrics on paths = /proc/* /sys/* /var/run/user/* /run/user/* /snap/* /var/lib/docker/* + # exclude space metrics on filesystems = *gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl + # space usage for all disks = auto + # inodes usage for all disks = auto +``` + +Charts can be enabled/disabled for every mount separately: + +``` +[plugin:proc:diskspace:/] + # space usage = auto + # inodes usage = auto +``` + > for disks performance monitoring, see the `proc` plugin, [here](../proc.plugin/#monitoring-disks) diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c index ab3b7508eb..77b87b0934 100644 --- a/collectors/diskspace.plugin/plugin_diskspace.c +++ b/collectors/diskspace.plugin/plugin_diskspace.c @@ -190,7 +190,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) { if(unlikely(m->do_space == CONFIG_BOOLEAN_NO && m->do_inodes == CONFIG_BOOLEAN_NO)) return; - if(unlikely(mi->flags & MOUNTINFO_READONLY && !m->collected)) + if(unlikely(mi->flags & MOUNTINFO_READONLY && !m->collected && m->do_space != CONFIG_BOOLEAN_YES && m->do_inodes != CONFIG_BOOLEAN_YES)) return; struct statvfs buff_statvfs; |