New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

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

Free PRTG
Download >>

 

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

 

Top Tags


View all Tags


Error in Custom REST sensor

Votes:

0

Your Vote:

Up

Down

Hi,

I have a template for the REST custom sensor:

{
    "prtg": {
      "result": [
	{
          "channel": "Status",
          "valueLookup": "prtg.customlookups.paloalto",
          "value": lookup($..["status"],"Established")
		  
        }
      ]
    }
}

I get the error : Could no evaluate channel value of Status: expected type string for parameter 0 but got []interface {}.

Without the lookup I get this error:

Could not create channel Status0: expected number but got success (string).

{
    "prtg": {
      "result": [
	{
          "channel": "Status",
          "value": $..["status"]
		  
        }
      ]
    }
}

So I fought fixing the error with the lookup would work, but it doesnt.

What am I doing wrong?

api custom-sensor rest

Created on Feb 5, 2019 12:50:20 PM by  blachetta (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

The value your returning should be a number corresponding to a value in your lookup file.

e.g. you might have the following in your lookup file:

<SingleInt state="Error" value="0">Down</SingleInt>
<SingleInt state="OK" value="1">Up</SingleInt>

Then, if your sensor detected something was down, your response data would look like this:

{
    "prtg": {
        "result": [
            {
                "channel": "Status",
                "valueLookup": "prtg.customlookups.paloalto",
                "value": 0
            }
        ]
    }
}

PRTG would then display this as "Error by lookup value 'Down' in channel 'Status'".

Given this has been open for 10 months without an answer I really hope you've figured this out already and I'm replying in case anyone else hits the same issue!

Created on Dec 13, 2019 11:47:53 AM by  Ross McLachlan (0) 1

Last change on Dec 13, 2019 1:52:01 PM by  Ross McLachlan (0) 1



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.