I use some of the web server (HTTP) sensors of PRTG. I am not sure if I have to configure the sensors to show a certain sensor status when receiving a certain HTTP status code. Is there a rule for that?
Which HTTP status code leads to which HTTP sensor status?
Votes:
0
8 Replies
Votes:
1
This article applies as of PRTG 22
How an HTTP sensor reacts to HTTP status codes
HTTP sensors show their status depending on the HTTP status codes that they receive.
By default, the sensor states are the following:
HTTP status code | HTTP sensor status |
---|---|
2xx Success | Up (green) Note: Except for status code 200, the REST Custom sensor defines all other 2xx states as the Down status. |
3xx Redirection | Warning (yellow); Down (red) for too many redirects |
4xx Client Error | Down (red) |
5xx Server Error | Down (red) |
You need to manually configure your HTTP sensors only if you want to change these default reactions. In this case, you can change the sensor status based on limits and/or keyword checks.
If you are looking for an alternative where you can adjust the behavior to "accept" a specific HTTP code (for example, green sensor on HTTP 403), you will need to use a custom sensor.
More
Created on Aug 11, 2015 8:26:13 AM by
Martina Wittmann [Paessler Support]
Last change on Apr 11, 2024 12:35:32 PM by
Yasodhara Das [Paessler Support]
Votes:
0
For several checks, I don't want to a 3xx redirect to mean Warning or Down. How do you override these sensor-state/status-code relationships?
Votes:
0
@dcsgpvan: Overriding these value/state pairing is not possible currently. However, you might have a look at this script which could probably be extended.
Best regards
Votes:
0
Hi. We are evaluating PRTG and came across the same issue. This being an old thread - is it still valid?
We have a web service that will reply 403 to PRTG, as the request is not fully qualified with the right data for that service (changing that behaviour is not trivial as we will need to add special support to that code to use a specific header or something). I tried to use the "HTTP advanced" (and all other HTTP), hoping that if I use "dont alarm if text exists in reply" - it wont alarm. Yet it does, as it's 403.
All I wan't to know is that some service is listening/answering on "http://IP:port/". Is there another way?
Votes:
0
Hi there,
Unfortunately, a HTTP error will also always show an alert within PRTG. This is how the sensor is designed and intended for.
You can try adding a "Port Sensor" with the Port "443" and activated "Use Transport-Level Security (default)"-option.
Best regards.
Votes:
0
That worked (tho with the "Do not use Transport-Level Security (default)" - as this is HTTP on port 80 and not HTTPS on 443).
Thanks!
Votes:
0
I have a similar issue and am looking for a solution or consideration for sensor changes. I need a 401 to NOT return an error, I would rather have an http sensor that just monitors the returned status codes and only shows down if no status code was returned (server not there). for example in my situation a 401 is good, thats what i'm looking for a 5XX would be bad, or no response code would be bad.
Votes:
0
Hi there,
There is a script which can check if a desired response code is returned and which shows Ok in case it is and an error in case it isn't.
- 1. Save the following Script as "response_code.ps1" on the PRTG Core Server or Remote Probe under "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE": http://pastebin.com/X7VM23aH [pastebin.com]
- 2. Create a new "EXE/Script" Sensor and choose "response_code.ps1" as the script.
- 3. Use the following parameter and change them accordingly: -url "your-domain.com" -ResponseCode "403" -protocol "https"
For more information related to EXE/Script Sensors, visit the following website:
https://www.paessler.com/manuals/prtg/exe_script_sensor [paessler.com]
Best regards.
Add comment