Hi there,
I want to set up a sensor to monitor that a particular port on our remote system is closed, so I thought of using the Port Sensor as it has the different goals setup (port open or closed).
I noticed that the sensor is returning the same result in case the connection is refused (i.e. the port is closed) and in the case when the server cannot be reached. Surely the two scenarios are different and the sensor should take in consideration the response from the server (or a timeout in case the server is down altogether).
Am I missing something obvious? Any thoughts?
Many thanks
Mike
Article Comments
Hi Timo,
many thanks for your reply.
My issue is that, for security reasons that are outside my control, I cannot ping the server.
The only way I can check that the server is up and running is to try to connect to a specific port number and get a connection refused message, which will indicate that the server is up and running.
So, to achieve this, I thought that I could use the Port Sensor and set it to use the goal of "closed" to indicate that the port is reachable. That works fine in normal operations and PRTG displays the port as available.
The problem is that in case the server is not reachable, the sensor is still indicating the port as available because it treats the two errors ("connection refused" and "host not found") the same and thinks the port is still available (i.e. it marks it as closed).
I cannot find a way to change the logic of the sensor according to the error message ("connection refused" = Available/Up, "Host not found" = Unavailable/Down) - any suggestions regarding how to achieve this?
Any thoughts?
Many thanks
Mike
Dec, 2019 - Permalink
Hi Mike,
In this case the sensor will indeed treat both errors the same and the sensor will be displayed as green/ok. I'm afraid this behavior cannot be changed. However Is there any open port on your target server? If so you could monitor this port and switch the goal in the sensors setting to "Open" in order to monitor the availability of your target server.
Dec, 2019 - Permalink
Hello Mike,
If the port is closed, the sensor should show the error message "connection refused".
If the target server cannot be reached, the error message should be "Host not found".
It shouldn't be the same error message here, however in both cases the sensor will go into an error (red) status. You can also use an additional ping sensor to monitor if the server is reachable. Using dependencies, the port sensor can automatically be paused as soon as the server (ping sensor) isn't reachable anymore.
Kind Regards,
Timo Dambach
Paessler Tech Support
Dec, 2019 - Permalink