I've written a couple of custom sensors using powershell (which works when run in powershell). However when these custom sensors are added to a device, an error appears:
Query Failed: Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Nothing seems to make this implementation work.
However, when I wrap this PS1 file in a batch script and save as a separate custom sensor, it works: example batch script
cd %SystemRoot%\sysnative\WindowsPowerShell\v1.0\ powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\test-Stats.ps1"
in other words, i'm forcing the PS1 script to be run using a different powershell architecure.
Is there a PRTG fix for this please?
Add comment