Skip to content

Change checked Disk from LogicalDisk to Volume#453

Merged
LordHepipud merged 4 commits intoIcinga:masterfrom
widhalmt:fix/disk_check_without_quota
Nov 13, 2025
Merged

Change checked Disk from LogicalDisk to Volume#453
LordHepipud merged 4 commits intoIcinga:masterfrom
widhalmt:fix/disk_check_without_quota

Conversation

@widhalmt
Copy link
Member

The reason behind the change is that it seems that LogicalVolume will partly consider disk quotas and partly ignore them. We had an issue where a customer reported negative values for the calculated free space in case they had quotas for the checking user in place. Looks like Size of a LogicalDisk gives the size of the quota and FreeSpace ignores quota. So I changed the queried classes to hope for total values without queries.

@LordHepipud : Please feel free to correct me if I went the wrong path. And: I can think of reasons why you used LogicalDisk instead of Volume, so if there's anything I missed, please feel free to just make "User running the plugin must not have a quota applied" a requirement and throw away my PR.

Some things to note about this PR:

  • @RincewindsHat had the initial idea about what to look for
  • I did something that I would never advise someone to do but I checked first with the maintainer if it's ok as an exception (details follow)
  • I don't know how to code PowerShell
  • I used an LLM to help me with identifying the new code snippets I needed to use
  • I don't have a way to check the code because I don't use Windows

The reason behind the change is that it seems that `LogicalVolume` will partly consider disk quotas and partly ignore them. We had an issue where a customer reported negative values for the calculated free space in case they had quotas for the checking user in place. Looks like `Size` of a `LogicalDisk` gives the size of the quota and `FreeSpace` ignores quota.
So I changed the queried classes to hope for total values without queries.

@LordHepipud : Please feel free to correct me if I went the wrong path. And: I can think of reasons why you used `LogicalDisk` instead of `Volume`, so if there's anything I missed, please feel free to just make "User running the plugin must not have a quota applied" a requirement and throw away my PR.

Some things to note about this PR:

* @RincewindsHat had the initial idea about what to look for
* I did something that I would *never* advise someone to do but I checked *first* with the maintainer if it's ok as an exception (details follow)
* I don't know how to code PowerShell
* I used an LLM to help me with identifying the new code snippets I needed to use
* I don't have a way to check the code because I don't use Windows
@cla-bot cla-bot bot added the cla/signed label Oct 21, 2025
@widhalmt
Copy link
Member Author

ref/NC/872792

Fixes partition total size collection by properly ignoring possible user quotas
@LordHepipud LordHepipud self-assigned this Nov 13, 2025
@LordHepipud LordHepipud added the bug Something isn't working label Nov 13, 2025
@LordHepipud LordHepipud added this to the v1.14.0 milestone Nov 13, 2025
@LordHepipud LordHepipud merged commit 168035e into Icinga:master Nov 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cla/signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants