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

Rest Custom sensor json template

Votes:

0

Hello,

I woul like to create a REST custom sensor to monitor a JSON return value.

The return value looks like this:

[
{
"playerId": "5ba4c379fd806fb029653ba2",
"status": "UP",
"details": ""
},
{
"playerId": "5bc84622f584a05053a928b0",
"status": "UP",
"details": ""
},
{
"playerId": "5bd6dd1827baca48474f1cc4",
"status": "DOWN",
"details": "Player 3 status not playing"
},
{
"playerId": "5c6ce2cf278668f445548f2d",
"status": "DOWN",
"details": "Player 4 has no campaigns published"
},
{
"playerId": "5c6cea3bf7a4f9341509bce7",
"status": "DOWN",
"details": "Player 5 last screenshot are long ago"
},
{
"playerId": "5c6e8a71961e25a43eb6e109",
"status": "UP",
"details": ""
},
{
"playerId": "5cb6df5743b5be4c1ba601b2",
"status": "UP",
"details": ""
}
]


I tried:

 {
        "channel": "playerId",
        "value": $.sensorxref[].playerId
      },
      {
        "channel": "status",
        "value": $.sensorxref[].status
      },
      {
        "channel": "details",
        "value": $.sensorxref[].details
   }

but I get an error:

"result": [ { "channel": "playerId", "value": $.sensorxref[].playerId }, { "channel": "status", "value": $.sensorxref[].status }, { "channel": "details", "value": $.sensorxref[].details } ] } } :5:139 - 5:140 unexpected "=" while scanning extensions.

json prtg rest

Created on Nov 5, 2019 10:57:41 AM

Last change on Nov 5, 2019 11:14:30 AM by  Torsten Lindner [Paessler Support]



Replies

Nobody has replied yet


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.