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

Use of variables in Rest Custom sensor / 201 should be green

Votes:

0

Hello,

two questions about the Rest Cusom Sensor,

is it possible to save a variable? My scenario: I create a new record with the POST command, but would like to delete that same record again. So I have to reuse the ID of the first POST to do a second POST command.

While creating the record, I receive a "201", but that shows as red in the sensor. Only 200 gives green. Can I change this behaviour?

kind regards, Filip

get post prtg rest-custom

Created on Feb 8, 2022 8:51:30 AM



1 Reply

Votes:

0

Hello Filip,

Thank you for your message.

Regarding what you would like to achieve, I invite you to use a custom script with the EXE/Script or EXE/Script Advanced sensor as it is not possible to re-use data for a second request with the REST Custom (V2) sensors.

Using a custom script will allow you to do so and return a value in PRTG, by following the format expected by the sensor. You will find the latter in this manual: https://www.paessler.com/manuals/prtg/custom_sensors.

Regarding the HTTP response code, I'm afraid that it is not possible to change the corresponding sensor behavior. Nevertheless, the sensor status should be in UP state when the response code belong to the range 2xx.

If you have questions, do not hesitate.

Kind regards.

Created on Feb 8, 2022 1:01:11 PM by  Florian Lesage [Paessler Support]

Last change on Feb 8, 2022 2:07:14 PM by  Florian Lesage [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.