i want to create a Script/Discovery-Rule wich creates me a json output for a discovery-rule.
This one works fine on powershell.exe
$File1="c:temptest.txt"
$File2="c:temptest2.txt"
$File3="c:temptest3.txt"
files_discovery.ps1 -filepaths $file1, $file2, $file3
Output –>good locking json output
I got 2 Problems at Zabbix 7:
First Problem: The Discovery-Key only Works with one Parameter.
At Template-level, i want to Provide 3 Macros ({$FILE1},{$FILE2},{$FILE3}.
This Item-Key works with one Macro:
system.run[powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:program FilesZabbix Agent 2zabbix_agent2.dscriptsFiles_Discovery.ps1" -FilePaths {$FILE1}]
But i´m to stupid to tell Zabbix, to use the other Macros.
With -Filepaths {$FILE1},{$FILE2} i got the Error “Invalid Second Parameter“.
With -Filepaths {$FILE1},{$FILE2},{$FILE3} i got the Error “To many Parameters“
Second Problem: AllowKey Syntax
This one works, with one Macro, but not with 2 or more Macros:
AllowKey=system.run[powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:program FilesZabbix Agent 2zabbix_agent2.dscriptsFiles_Discovery.ps1" -FilePaths *]
With two or three Macros, i got the Message: Unknown metric system.run
I hope someone has an idea
Thanks in Advance!
Daniel