Update df.py#918
Open
Man-in-Black wants to merge 1 commit into
Open
Conversation
changed the order of df_blocks to that it is possible to set rules which allowed it to monitor /var/lib/docker
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA. |
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General information
This change affects the Checkmk Linux agent disk space check (df), specifically the order in which df_blocks entries are processed. The df check is used to monitor filesystem usage on Linux/Unix systems and relies on the order of mount point rules to determine which paths are included or excluded from monitoring.
Bug reports
Please include:
/var/lib/dockercontains overlay2 filesystems, volumes and container layers/var/lib/docker(or a sub-path like/var/lib/docker/overlay2)df_blocks), repeat the discovery — the mount points now appear correctlyProposed changes
What is the expected behavior?
By reordering the df_blocks entries, it should be possible to define rules that explicitly allow monitoring of /var/lib/docker and its subpaths (e.g. overlay mounts, volumes), even though these are typically excluded by default or overridden by broader exclusion rules.
What is the observed behavior?
Previously, the order of entries in df_blocks caused broad exclusion rules (e.g. for virtual or overlay filesystems used by Docker) to take precedence over more specific allow rules for /var/lib/docker. As a result, Docker-related mount points were silently skipped and could not be monitored even when explicitly configured.
In what way does your patch change the current behavior?
The patch changes the order of entries in df_blocks so that more specific inclusion rules are evaluated before broader exclusion rules. This follows a "most specific rule wins" principle and aligns with the expected behavior when an administrator explicitly wants to monitor /var/lib/docker.
Is this a new problem?
This issue becomes relevant in environments where Docker is heavily used and disk space monitoring of /var/lib/docker is required — for example, to detect runaway image/container storage consumption. The need arose from operational requirements in Docker-based infrastructure where unmonitored storage growth caused incidents.