Escape spaces in Invoke-IcingaCheckProcessCount

Hi there,

I am testing out Invoke-IcingaCheckProcessCount in a lab environment at home, and I am attempting to monitor if the ‘Plex Media Service’ process is running.

PS C:\Windows\system32> Get-Process -Name 'Plex Media Server'

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    837     338   117452     124536  15,743.31   5428   2 Plex Media Server

Running this manually in PS appears to work fine:

PS C:\Windows\system32> Invoke-IcingaCheckProcessCount -Warning '1:' -Critical '1:' -Process 'Plex Media Server'
[OK] Check package "Process Check"
| 'process_count_plex_media_server'=1;1:;1:

However when I use check command configured via Director, it appears it is treating the space between the process name as an escape character:

Plugin Output:

[CRITICAL] Check package "Process Check" - [CRITICAL] Process Count "Plex"
\_ [CRITICAL] Process Count "Plex": Value "0" is lower than threshold "1"

Executed command:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' '-C' 'try { Use-Icinga; } catch { Write-Output '\''The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check for further details'\''; exit 3; }; Exit-IcingaPluginNotInstalled '\''Invoke-IcingaCheckProcessCount'\''; exit Invoke-IcingaCheckProcessCount' '-Warning' '1:' '-Critical' '1:' '-Process' 'Plex Media Server' '-Verbosity' '0'

Custom Variables:

Custom Variables:

icingacheckprocesscount_array_process	Plex Media Server
icingacheckprocesscount_int32_verbosity	0
icingacheckprocesscount_object_critical	1:
icingacheckprocesscount_object_warning	1:
icingacheckprocesscount_switchparameter_noperfdata	false

Is there any way to escape the spaces? I’ve tried a few combinations but could not work it out.