Closed
Description
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:"