summaryrefslogtreecommitdiffstats
path: root/src/plugin_proc_diskspace.c
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2017-09-17 22:17:33 +0000
committerLennart Weller <lhw@ring0.de>2017-09-17 22:17:33 +0000
commit6aaf5ba7ed0980c14bdc554fc8839a2126455ed5 (patch)
tree6161925716661486e7f47c479668a9487b039d83 /src/plugin_proc_diskspace.c
parentNew upstream version 1.7.0+dfsg (diff)
downloadnetdata-6aaf5ba7ed0980c14bdc554fc8839a2126455ed5.tar.xz
netdata-6aaf5ba7ed0980c14bdc554fc8839a2126455ed5.zip
New upstream version 1.8.0+dfsgupstream/1.8.0+dfsg
Diffstat (limited to 'src/plugin_proc_diskspace.c')
-rw-r--r--src/plugin_proc_diskspace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugin_proc_diskspace.c b/src/plugin_proc_diskspace.c
index 750086a2c..52c1f5ae6 100644
--- a/src/plugin_proc_diskspace.c
+++ b/src/plugin_proc_diskspace.c
@@ -6,6 +6,7 @@
static struct mountinfo *disk_mountinfo_root = NULL;
static int check_for_new_mountpoints_every = 15;
+static int cleanup_mount_points = 1;
static inline void mountinfo_reload(int force) {
static time_t last_loaded = 0;
@@ -58,7 +59,7 @@ int mount_point_cleanup(void *entry, void *data) {
return 0;
}
- if(likely(mp->collected)) {
+ if(likely(cleanup_mount_points && mp->collected)) {
mp->collected = 0;
mp->updated = 0;
mp->shown_error = 0;
@@ -328,6 +329,8 @@ void *proc_diskspace_main(void *ptr) {
int vdo_cpu_netdata = config_get_boolean("plugin:proc", "netdata server resources", 1);
+ cleanup_mount_points = config_get_boolean(CONFIG_SECTION_DISKSPACE, "remove charts of unmounted disks" , cleanup_mount_points);
+
int update_every = (int)config_get_number(CONFIG_SECTION_DISKSPACE, "update every", localhost->rrd_update_every);
if(update_every < localhost->rrd_update_every)
update_every = localhost->rrd_update_every;
@@ -370,7 +373,8 @@ void *proc_diskspace_main(void *ptr) {
if(unlikely(netdata_exit)) break;
- dictionary_get_all(dict_mountpoints, mount_point_cleanup, NULL);
+ if(dict_mountpoints)
+ dictionary_get_all(dict_mountpoints, mount_point_cleanup, NULL);
if(vdo_cpu_netdata) {
static RRDSET *stcpu_thread = NULL, *st_duration = NULL;