File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/collectors/diskspace.plugin Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,26 @@ static void calculate_values_and_show_charts(
299299 m->collected++;
300300}
301301
302+ // Check if a ZFS filesystem entry is a dataset (not a pool)
303+ static inline bool is_zfs_dataset(struct mountinfo *mi) {
304+ if(!mi || !mi->filesystem || !mi->mount_source || !mi->mount_source[0])
305+ return false;
306+
307+ if(strcmp(mi->filesystem, "zfs") != 0)
308+ return false;
309+
310+ // For ZFS, the mount_source contains the dataset name (e.g., "tank" or "tank/install")
311+ // Pools have no slash, datasets have at least one slash
312+ return strchr(mi->mount_source, '/') != NULL;
313+ }
314+
302315static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
316+ // Skip ZFS datasets, only monitor ZFS pools
317+ // This prevents alert floods when a pool fills up
318+ if (is_zfs_dataset(mi)) {
319+ return;
320+ }
321+
303322 const char *disk = mi->persistent_id;
304323
305324 static SIMPLE_PATTERN *excluded_mountpoints = NULL;
You can’t perform that action at this time.
0 commit comments