What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Custom advanced sensor for Exchange Powershell

Votes:

0

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?

custom-sensor exchange-powershell prtg

Created on Oct 22, 2013 6:59:03 AM

Last change on Oct 22, 2013 2:04:28 PM by  Greg Campion [Paessler Support]



3 Replies

Accepted Answer

Votes:

0

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.

Created on Oct 22, 2013 2:10:29 PM by  Greg Campion [Paessler Support]



Votes:

0

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!!!!

Created on Oct 23, 2013 2:10:27 AM



Votes:

0

Glad to help :)

Created on Oct 23, 2013 10:34:03 AM by  Greg Campion [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.