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

Powershell Custom Sensor

Votes:

0

Hi.

I have a Problem with a Custom Powershell Sensor. Version: 15.1.15.2021

I added a testfile "test.ps1" to PRTG Network Monitor\Custom Sensors\EXEXML.

Content: Write-Host "<prtg>" "<result>" "<channel>name</channel>" "<value>1</value>" "</result>" "</prtg>" Exit 0

If I add a sensor, I get the following error: XML: Structural error in xml file, 1 open items. -- JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Invalid JSON.). (Code: PE231)

Can you help me?

custom-sensor powershell prtg

Created on May 20, 2015 8:08:06 AM



4 Replies

Votes:

0

What happens when you manually execute the script on your PRTG server?

Is running powershell scripts enabled on your PRTG server?

Created on May 20, 2015 11:52:53 AM



Votes:

0

Execution-Policy is set to Unrestricted.

If I execute the script, I get the following content: <prtg> <result> <channel>name</channel> <value>1</value> </result> </prtg>

Created on May 21, 2015 6:04:27 AM



Votes:

0

Can you try the following code:

Write-Host @" <prtg> <result> <channel>name</channel> <value>1</value> </result> </prtg> "@

Has Set-ExecutionPolicy Unrestricted been executed in a 32 bit PowerShell with administrative privileges?

Created on May 21, 2015 6:33:28 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi.

I worked with Powershell x64. After i set the Executionpolicy to Unrestricted twice in x86 it worked.

Many Thanks

Created on May 21, 2015 6:58:19 AM




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.