Hi,
with the C Agent there was no problem using the following UserParamter:
With Agent2 (5.0.4 on Windows Server 2016) I'll get an error as soon as I put quotes around my path to the script.
Without quotes I'm getting an error because of the space in the path:
When using a path without spaces or using the 8dot3 names it is working unless I put quotes around the path.
Do I need to mask/escape the quotes in my case or is it a bug in Agent2? Or is it a bad idea to put scripts in the Zabbix install directory or in a place with spaces in the path?
Thanks
Jan
with the C Agent there was no problem using the following UserParamter:
Code:
UserParameter=my.script,powershell.exe -NoLogo -NoProfile -Noninteractive -ExecutionPolicy Bypass -File "%ProgramFiles%\Zabbix Agent\Scripts\MyScript.ps1-Param1 "$1" -Param2 $2"
"Error processing -File" "C:\Program": Illegal character in the path. Enter a valid path for the -File parameter.
Error processing file "C:\Program" because the file does not have the extension ".ps1". Provide the valid name of a Windows PowerShell script file and try again.
Code:
UserParameter=My.Script[*],powershell.exe -NoLogo -NoProfile -Noninteractive -ExecutionPolicy Bypass -File C:\PROGRA~1\ZABBIX~1\Scripts\MyScript.ps1 -Param1 "$1" -Param2 $2
Thanks
Jan
Comment