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

PRTG Json sensor

Votes:

0

Hello, i need to create a sensor that make a get command on a PLC that answer is in Json format, i've tried the REST Custom sensor with a custom template based on the data i need to "read" from the Json, and it's like this:

{
   "prtg": {
     "result": [
       {    
          "channel": "allarme_fumo" ,
		  "value": 0
		 },  
		 {        
          "channel": "porta_aperta" ,
		  "value": 0
	     },
		 {        
          "channel": "allarme_temperatura_prima_soglia", 
		  "value":  0
	     },
		 {        
          "channel": "allarme_temperatura_seconda_soglia", 
		  "value":  0

The Json response is be like this:

{"allarme_fumo":0,"porta_aperta":1,"allarme_temperatura_prima_soglia":0,"allarme_temperatura_seconda_soglia":0,

My problem is PRTG sensor not read the Json result but read the template result, so if the Json have 1 in the response PRTG sensor remain at 0.

how can i write on the template that prtg must go to read the value from the Json?

get json rest

Created on Feb 10, 2023 2:40:28 PM



6 Replies

Votes:

0

Hello,

do you read that JSON with a custom script, or with the Rest Custom sensor?

Created on Feb 14, 2023 1:00:16 PM by  Arne Seifert [Paessler Support]



Votes:

0

i use the Rest custom with a template

Created on Feb 15, 2023 7:09:18 AM



Votes:

0

Hello,

please use the Rest Custom v2 sensor for this. You can create a JSON path with online tools like this one.

Created on Feb 15, 2023 2:47:47 PM by  Arne Seifert [Paessler Support]



Votes:

0

i tried the Rest custom V2 but, from what I understood, with this sensor i have to configure manually all channel and the limit is 10 channels. In my json i have 50 channels to monitoring. So i tried to create a sensor with V2 but i receive this message "Unparseable value in channel 1. The queried field "x.allarme_temperatura_prima_soglia" is empty." the JSON path is x.allarme_temperatura_prima_soglia

Created on Feb 15, 2023 3:43:16 PM



Votes:

0

Hello,

please replace x with $.

Created on Feb 16, 2023 12:44:48 PM by  Arne Seifert [Paessler Support]



Votes:

0

Thank you it's working, i tested also with the template and it's working Thnaks

Created on Feb 17, 2023 12:00:37 PM




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.