diff options
author | Lennart Weller <lhw@ring0.de> | 2017-09-17 22:17:45 +0000 |
---|---|---|
committer | Lennart Weller <lhw@ring0.de> | 2017-09-17 22:17:45 +0000 |
commit | 7ee3962eaca4214264964ae32c86de457a90e382 (patch) | |
tree | 5a784485351593ac6d74fa9fd9bbd8fe7c9c3fe0 /src/plugin_proc_diskspace.c | |
parent | maintscript eludes me (diff) | |
parent | New upstream version 1.8.0+dfsg (diff) | |
download | netdata-7ee3962eaca4214264964ae32c86de457a90e382.tar.xz netdata-7ee3962eaca4214264964ae32c86de457a90e382.zip |
Updated version 1.8.0+dfsg from 'upstream/1.8.0+dfsg'
with Debian dir 412de09d9bca38fe00146ef090f9e53f76493882
Diffstat (limited to '')
-rw-r--r-- | src/plugin_proc_diskspace.c | 8 |
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; |