diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-07-22 23:14:53 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-07-22 23:14:53 +0300 |
commit | d73c4185790d35f6352b32223321f83adce187fb (patch) | |
tree | ea3e03c505a8ad401e4ff4751fe96270a58a9d46 /src/plugin_proc_diskspace.c | |
parent | 16886efb0d56a244fafd73307544e58eae0ab9a5 (diff) |
added setting to disable cleaning up obsolete disks
Diffstat (limited to 'src/plugin_proc_diskspace.c')
-rw-r--r-- | src/plugin_proc_diskspace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugin_proc_diskspace.c b/src/plugin_proc_diskspace.c index 750086a2c2..8ceb60c7da 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; |