What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

JSON Parser Error

Votes:

0

Your Vote:

Up

Down

Hi Guys,

I hope someone can help my by my Stubid question :-)

So I woud use the REST Custom Sensor to get data from Freifunk Node the URL is https://map.ffrn.de/data/nodes.json

So I Create a Template with following entries:

{ "prtg": { "description" : { "device": "SLR-Offloader-003", "comment": "demo" }, "result": [ { "channel": "online", "value": nodes.000c2904305e.flags.online } ] } }

But when I create the Sensor I get

Parsing error: { "prtg": { "description" : { "device": "SLR-Offloader-003", "comment": "demo" }, "result": [ { "channel": "online", "value": nodes.000c2904305e.flags.online } ] } }:10:23 - 10:27 unexpected Float while scanning object end expected "," or "}".

Hase someone a Idea to fix it and whats wrong?

Thanks all

custom freifunk json rest sensor

Created on Dec 31, 2019 11:31:59 AM by  ehein (0) 1



3 Replies

Votes:

0

Your Vote:

Up

Down

This is not valid Json,

"value": nodes.000c2904305e.flags.online

Needs to be

"value": "nodes.000c2904305e.flags.online"

But... keep in mind that PRTG can only handle integer and/or decimal values.
So "nodes.000c2904305e.flags.online" will still be an invalid output for PRTG.


Sensors | Multi Channel Sensors | Tools | Notifications

Kind regards,

[[http://prtgtoolsfamily.com]] PRTG Tools Family

Created on Dec 31, 2019 12:22:19 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Votes:

0

Your Vote:

Up

Down

Hi Thanks for the Reply,

I make a mistake but it does not work so that is the "New" template. So this is all test. Later I would greb more Details out of the JSON file.

so that is the new one

{
  "prtg": 
  {
    "result": 
	[
      {
        "channel": "online",
        "value": $.nodes.000c2904305e.flags.online
      }
    ]
  }
}

About the handler, the Output of this is true or false I think prtg kan handle it :-)

Created on Dec 31, 2019 3:28:03 PM by  ehein (0) 1



Votes:

0

Your Vote:

Up

Down

Hi ehein,

Please note that the "value" parameter needs to be a integer or float. Please make sure the <Float> setting matches the kind of value provided. Otherwise PRTG will show 0 values.

Created on Jan 1, 2020 9:02:20 AM by  Moritz Heller [Paessler Support]



Please log in or register to enter your reply.


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.