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

XML/REST Sensor: Process is terminated due to StackOverflowException

Votes:

0

I have created a http xml/rest sensor to receive some data from a rest api, the setup is below:

URL: https://<appliance>/api/reports/status/

XML Node: 99142989543d4e6fbe5b8acffa5766eb/status

HTTP Headers: CMD_TOKEN:token

When this sensor scans it always reports the last message as 'Process is terminated due to StackOverflowException'

Can anyone advise what I'm doing wrong?

custom-html json xml-rest

Created on Aug 11, 2017 10:06:18 AM



9 Replies

Votes:

0

Hello there,

In PRTG's installation path, subfolder "Sensor System" you find "XMLValue.exe". Please backup the file and replace the original then with this one: http://download3.paessler.com/beta/XMLValue.exe.zip

Does it work then? Also run the executable from command prompt, it will show you which parameters you can pass along and run it then with parameters from commandline to see what you get there.

Kind regards,

Erhard

Created on Aug 15, 2017 11:51:43 AM by  Erhard Mikulik [Paessler Support]



Votes:

0

Hi, the new XMLValue program seems to work, however I'm having some trouble extracting the node that I require. The API returns a JSON string, in the format:

{  
   "99142989543d4e6fbe5b8acffa5766eb":{  
      "tags":[  ],
      "shadowprotect":{  
           "status": "queued"
       },
      "name":"Test",
      "machine_details":{  },
      "imagemanager":{  },
      "timezone":3600,
      "org":"Default Organization",
      "status":"ok",
      "lost_contact":0
   }
}

When I try and get the status node using -n=99142989543d4e6fbe5b8acffa5766eb/status I get an error 'Expression must evaluate to a node-set.' If i set -n=status it returns the value of a node called status that is inside the shadowprotect object, and not the status value that is inside the 99142989543d4e6fbe5b8acffa5766eb object.

Could you tell me the correct way to format the -n= parameter to get the required node?

Thanks!

Created on Aug 15, 2017 1:58:16 PM

Last change on Aug 16, 2017 3:16:14 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

You're after this node "status": "queued", right? Try it like this in the sensor's settings: 99142989543d4e6fbe5b8acffa5766eb/shadowprotect/status

Kind regards,

Erhard

Created on Aug 16, 2017 3:33:42 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Hi,

I'm actually after the node "status":"ok" which I thought should be 99142989543d4e6fbe5b8acffa5766eb/status but this gives an error of 'Expression must evaluate to a node-set.'

For testing purposes I have tried the version that you provided, that is also giving the same error: 'Expression must evaluate to a node-set.'

Is there anyway to fix this?

Created on Aug 16, 2017 3:43:11 PM



Votes:

0

Hello again,

It appears to be a bug, the responsible is currently on vacation, so I don't have a quick fix right now. In the current Preview Version of PRTG is new REST Custom BETA sensor included. You can switch Auto-Update to Preview Channel, install it and use the new sensor then. It should work with this one.

Kind regards,

Erhard

Created on Aug 17, 2017 2:50:44 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Hello again,

The problem here is that the JSON is converted to XML before processing. XML node names are not allowed to start with a number, causing an invalid xml, which is what happened here.

Please find here another version for testing, which you can use to replace the existing executable in PRTG's installation path, subfolder "Sensor System".

Kind regards,

Erhard

Created on Sep 4, 2017 3:11:17 PM by  Erhard Mikulik [Paessler Support]

Last change on Sep 5, 2017 2:37:16 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Hi, the newest version of XMLValue.exe works much better, however, it might be better if instead of giving a response as:

0:Node 99142989543d4e6fbe5b8acffa5766eb/status holds value ok.

Which shows up in PRTG as a message of 'Node 99142989543d4e6fbe5b8acffa5766eb/status holds value ok.' and a value of 0

It would be slightly nicer if it would just return the response as ok (or whatever that value at that node actually is)

This is only a minor inconvenience and can be worked around. Thanks for the help!

Created on Sep 5, 2017 10:06:50 AM



Votes:

0

Thank you, shogan, I will address your feedback accordingly.

Kind regards,

Erhard

Created on Sep 5, 2017 2:38:13 PM by  Erhard Mikulik [Paessler Support]



Votes:

0

Hello shogan,

Feedback from the dev was that he's a bit reluctant in changing the output as that might affect other users also. Meaning it changes the behavior to something that might pose a problem for existing users, when the output is suddenly handled differently.

Kind regards,

Erhard

Created on Sep 7, 2017 11:50:22 AM by  Erhard Mikulik [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.