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

EXE/Script advanded PowerShell json invalide format

Votes:

0

Hi, Here is my powershell snippet that I want to get on PRTG : return @{ 'prtg' = @{ 'result' = @( @{ 'channel' = $TaskList[0].Name 'value' = 42 } ) 'text' = "Sensor desc" } } When I convert this in json format here is my output :

{ "prtg": { "text": "Sensor desc", "result": [ { "channel": "Name", "value": 42 } ] } }

This format seems correct but i still have this error message : "XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)" Anyone ?

json powershell prtg

Created on Sep 28, 2017 2:35:53 PM



1 Reply

Votes:

0

Hi Hyro,

You can review the API Documentation in PRTG over the Setup -> PRTG API -> Custom Sensors section.

For your result you need to put the value 42 in quotation marks. So it needs to be "42".

Hope this helps,

Eugen

Created on Sep 28, 2017 4:33:02 PM by  Eugen Wilhelm [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.