diskspace plugin should not stat() excluded mountpoints (#4494)
* diskspace plugin should not stat() excluded mountpoints; fixes #4491 * it should be reversed
Costa Tsaousis committed
Oct 26, 2018 at 02:45 UTC
7395d64aed0416b3c470f6b1cbf61e21bf77a508
1 file changed
+2
-1
collectors/diskspace.plugin/plugin_diskspace.c
+2
-1
@@ -133,7 +133,8 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
133
}
134
135
// check if the mount point is a directory #2407
136
- {
136
+ // but only when it is enabled by default #4491
137
+ if(def_space != CONFIG_BOOLEAN_NO || def_inodes != CONFIG_BOOLEAN_NO) {
138
struct stat bs;
139
if(stat(mi->mount_point, &bs) == -1) {
140
error("DISKSPACE: Cannot stat() mount point '%s' (disk '%s', filesystem '%s', root '%s')."