I've put a powershell Advanced script in prtg but keep getting the output: missing prtg. The script works fine in powershell. The script contains a string to run C# code to make a Http request and should return a xml string with channel values. (see example output)

example output:

<prtg><result><channel>Loading time</channel><Value>20</Value></result></prtg>

After a run on prtg , the log outputs are empty. I also tried setting the unrestricted and remotesigned settings. What else can I do?


Article Comments

Hi,
I just tried to recreat the issue, but it seems not related to the output itself as this works fine when just delivering back the same to PRTG.
The error message could indicate that the .NET Framework is missing on the machine where you want to run the script.
Best regards


Jul, 2012 - Permalink

I get the same 'Last message': Error reading response: missing /prtg. I am using the DFSR Backlog script from the Google code repository for custom sensors. I enabled the write results to file and get a message concerning the Powershell execution policy. I have this set to Unrestricted on the remote probe and both server I'm trying to get results from. The results file is blank if I set the sensor to use the parent device's Windows credentials (which is a domain administrator account). I tried disabling UAC and have .Net Framework 4 installed on the remote probe. I get valid results with all PRTG XML tags when I run in from the remote probe.


Aug, 2012 - Permalink

Hi,
depending on the system architecture (32/64 bit) you will have to set the execution policy in different powershells. As PRTG is a 32 bit application it uses the 32 bit powershell (\Windows\SysWOW64) and therefore the execution policy has to be set there.
Then the script should be executed properly.
Best regards


Aug, 2012 - Permalink