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

Create custom configuration template file for Rest Custom sensor

Votes:

0

Good day.

I receive response from API server like this:

{
"output": null,
"errorList": [ {
"text": "There is no person with provided PIN",
"type": 7
}],
"errorPayload": null,
"isSuccess": false
}

Tell me, please, how can I create configuration template file for this vale so that sensor switch to green color?

prtg rest value

Created on Sep 13, 2018 1:04:11 PM

Last change on Sep 17, 2018 6:26:57 AM by  Sebastian Kniege [Paessler Support]



3 Replies

Votes:

0

Hello Afon,

Thank you very much for your contact.

Do you already monitor this output with a Rest Custom sensor?
Just to check, did you already review the corresponding manual article in regards to the REST Custom Sensor? Please also see this section, that refers to details about the return value format.

Best regards,
Sebastian

Created on Sep 17, 2018 6:30:55 AM by  Sebastian Kniege [Paessler Support]



Votes:

0

From manual, I can't find how to output the text value which I got from API endpoint. I can't write the syntax this procedure correctly. Let me understand how I must declare variable for the text type, how assign value to this variable?

Thanks.

Created on Sep 17, 2018 8:57:44 AM



Votes:

0

Hello Afon,

Please check the formatting of the text. It should be outside of the result as stated in our Custom Sensors documentation.

{
  "prtg": {
    "text": "Found State-Value: " + $.name.state,
    "result": [
      {
        "channel": "State",
        "value": lookup($.name.state, "active"),
        "limitmode": 1,
        "LimitMinError": 0,
        "LimitErrorMsg": "The value for 'state' is not 'active'!"
      }
    ]
  }
}

Best regards,
Sebastian

Created on Sep 19, 2018 5:10:44 AM by  Sebastian Kniege [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.