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

Inquiry about PRTG json templete (Custom sensor)

Votes:

0

Your Vote:

Up

Down

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 by  smj20228 (0) 1

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



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

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]



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.