Skip to content

Problem with negative threshold range when using REST-API #528

Closed
@dbecker1234

Description

@dbecker1234

Expected Behavior

An argument with negative threshold range should get passed to the check script no matter if Api-Check Forwarder is enabled or not.

Current Behavior

When Api-Check Forwarder is enabled you get the following error message:

Invalid range specified for threshold: InputValue "-0,​0299999993294477" and Threshold True

Possible Solution

Steps to Reproduce (for bugs)

  1. Configure a check using a negative threshold range as an argument. For example Invoke-IcingaCheckTimeSync:

'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:rn$( Get-Module -ListAvailable '\''icinga-powershell-*'\'' )rn'\''Module-Path:'\''rn$($Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command '\''Invoke-IcingaCheckTimeSync'\'' ' '-Server' 'ntp.example.org' '-Warning' '-10:10' '-Critical' '-20:20' '-Verbosity' '2'

  1. Ensure that Api-Check Forwarder is enabled
  2. You get the error message above
  3. Disable Api-Check Forwarder: the check starts working
  4. Use a positive threshold range for both -Warning and -Critical -> also working
  5. Execute Invoke-IcingaCheckTimeSync directly in PowerShell -> works

Context

Your Environment

  • PowerShell Version used ($PSVersionTable.PSVersion): 4.0

  • Operating System and version (Get-IcingaWindowsInformation Win32_OperatingSystem | Select-Object Version, BuildNumber, Caption): Version: 6.3.9600, BuildNumber 9600, Server 2012 R2
    But all version affected including newer systems.

Metadata

Metadata

Assignees

Labels

BugThere is an issue present

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions