Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.13: Thresholds are not parsed correctly in the icinga generated command #796

Open
Kaelnor opened this issue Mar 13, 2025 · 0 comments
Open

Comments

@Kaelnor
Copy link

Kaelnor commented Mar 13, 2025

Hi, we recently updated IcingaForWindows from 1.12 to 1.13.2 and we are experiencing a anomaly for partition space thresholds.

I saw that the thresholds have been reworked in #750. Here is an exemple of the issue.

  • Running the powershell command directly on the server works fine:
PS C:\Users\Administrator> Invoke-IcingaCheckPartitionSpace -Warning "30%:" -Critical "20%:"
[WARNING] Free Partition Space: 1 Warning 1 Ok [WARNING] Partition E:
\_ [WARNING] Partition E: Value 29.20GiB (29,20%) is lower than threshold 29.99GiB (30%)
| c::ifw_partitionspace::free=42795675648;38460613018;25640408678;0;128202000000 e::ifw_partitionspace::free=31352365056;32206591181;21471060787;0;107355300000
  • Icinga running the command via the generated config file fails
[UNKNOWN] Free Partition Space: 1 Unknown [UNKNOWN] Partition C:
\_ [UNKNOWN] Partition C: Warning threshold range "12820204339" is greater than Critical threshold range "6410102170"

The full command generated by icinga

'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' '-NoProfile' '-NoLogo' '-ExecutionPolicy' 'ByPass' '-C' 'try { Use-Icinga -Minimal; } catch { Write-Output '\''The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'\''; Write-Output '\''Error:'\'' $($_.Exception.Message)Components:`r`n$( Get-Module -ListAvailable '\''icinga-powershell-*'\'' )`r`n'\''Module-Path:'\''`r`n$($Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command '\''invoke-icingacheckusedpartitionspace'\'' ' '-Warning' '10%:' '-Critical' '5%:' '-Include' '@('\''C'\'')' '-Exclude' '@()'

using the following vars in the config:

IcingaCheckUsedPartitionSpace_Critical: "5%:", 
IcingaCheckUsedPartitionSpace_Include: [ "C" ], 
IcingaCheckUsedPartitionSpace_Warning: "10%:"

I suspect that the parsing eats the : or interprets it incorrectly from the provided command.

I tried putting the litteral escape character ine the thresholds but that does not change anything

IcingaCheckUsedPartitionSpace_Critical: "5%`:", 
IcingaCheckUsedPartitionSpace_Include: [ "C" ], 
IcingaCheckUsedPartitionSpace_Warning: "10%`:"

The same threshold definition of "10%:" worked fine in 1.12.

UPDATE: Putting the threshold as "10%:100%" explictly is a workaround and seems to do the correct thing.

UPDATE2: Thresholds with Bytes ranges are correctly parsed, for instance this works:

IcingaCheckUsedPartitionSpace_Critical: "5GB:", 
IcingaCheckUsedPartitionSpace_Warning: "10GB:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant