mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
235 stars 91 forks source link

Characters between : (colon) and ; (semi-colon) gets removed in performance data output, including the colon #748

Open johanthoren opened 2 years ago

johanthoren commented 2 years ago

Issue and Steps to Reproduce

  1. Create a powershell script containing:
    Write-Output "OK: All is well|'FOO'=10;4:5;6:9;"
  2. Add it as an external command named check_colon.
  3. Check using check_nrpe:
    # /opt/plugins/check_nrpe -s -H <IP> -c "check_colon"
    OK: All is well|'FOO'=10;4;6

Expected Behavior

I expected the output to be: OK: All is well|'FOO'=10;4:5;6:9

Actual Behavior

Instead, the colons and the number following the colons were removed. OK: All is well|'FOO'=10;4;6

Details

Additional Details

NSClient++ log:

2021-09-16 11:22:48: debug:c:\source\master\modules\CheckExternalScripts\CheckExternalScripts.cpp:371: Command line: cmd /c echo scripts\custom\check_colon.ps1; exit($lastexitcode) | powershell.exe -command -

ITRS reference ticket: 240089