I am trying to make a custom advanced sensor to monitor MS Exchange status, however, the xml seems cannot be regonized by PRTG server.
I created 2 testing scripts, both of them got valid output on Windows Powershell. But PRTG server could not regonize the script 1 with error messgae
"Error reading response: Invalid XML (XML Parser mismatch: Wanted </<<<>, got </prtg>)"
Here is my testing ps scripts
1) With Exchange powershell imported
$session = new-pssession -ConfigurationName "Microsoft.Exchange" -ConnectionUri "http://TESTEXCH01/Powershell" -Authentication Kerberos import-pssession -Session $session -AllowClobber -DisableNameChecking | out-null Write-Host "<prtg>" Write-Host "<result>" Write-Host "<channel>Test Channel</channel>" Write-Host "<value>0</value>" Write-Host "</result>" Write-Host "</prtg>" remove-pssession -Session $session
2) Without Exchange powershell imported
Write-Host "<prtg>" Write-Host "<result>" Write-Host "<channel>Test Channel</channel>" Write-Host "<value>0</value>" Write-Host "</result>" Write-Host "</prtg>"
Can anymore help please?
Article Comments
Thanks Greg, you are right, it works either I add -Credentials $credentials in the session or changing to "Use Windows credentials of parent device". Thank you so much!!!!
Oct, 2013 - Permalink
Have you checked that the Powershell (x86) is allowed to run Remote Signed scripts?
Also please check that the sensor type you are using is EXE/Script Advanced and that the files are in the Custom Sensors\EXEXML folder.
Lastly, with this script you will need to run the sensor with the credentials of the parent device and use Domain Admin credentials for this.
Oct, 2013 - Permalink