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

Inquiry about PRTG json templete (Custom sensor)

Votes:

0

Below is the json result I want to receive an alert when "enabled" is not "yes". And I would like to see the following results in PRTG as a message, No matter how I make a template, an error occurs. Ask for help how to create a template. Please Help me.....

   { 
     "instance_name": "sso9090",
     "restart": "false",
     "started": "yes",
     "id": "sso9090",
     "version": "1610601403",
     "enabled": "yes"
   },
   {  
     "instance_name": "sso8080",
     "restart": "false",
     "started": "yes",
     "id": "sso8080",
     "version": "1610960581",
     "enabled": "yes"
   }

custom-sensor json-templet prtg rest-api

Created on Mar 23, 2021 9:42:18 AM

Last change on Mar 23, 2021 9:55:15 AM by  Felix Wiesneth [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Hello SMJ,

The custom sensors require a particular syntax for PRTG which is documented on the Setup > PRTG API > Custom Sensors page.

For single values, it looks like this:

		{
		 "prtg": {
		  "result": [
		   {
		    "channel": "First channel",
		    "value": 10
		   },
		   {
		    "channel": "Second channel",
		    "value": 20
		   }
		  ]
		 }
		}

This means that you need to convert the Enabled: Yes / No into an integer for PRTG, since PRTG does only store numerical values.

For the error message

		{
		 "prtg": {
		  "error": 1,
		  "text": "Not Enabled"
		 }
		}

would be the required syntax. The text will then be visible in the sensor message, but not evaluated for thresholds.

Hope this helps.


Kind regards,
Felix Saure, Tech Support Team

Created on Mar 24, 2021 11:39:39 AM by  Felix Saure [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.