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
Article Comments
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.
Feb, 2022 - Permalink
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.
Feb, 2022 - Permalink