Dynatrace / dynatrace-api

BSD 3-Clause "New" or "Revised" License
102 stars 87 forks source link

Add UDP protocol option for the port check extension #65

Closed dlopes7 closed 3 years ago

dlopes7 commented 3 years ago

A customer requested and paid us to add UDP support.

There is no universal way to test UDP, we are imitating what netcat does here, which is:

  1. Send an empty UDP Datagram
  2. Wait for a server response with a 2 second timeout
  3. If we receive a response (unlikely) - TEST OK
  4. If we receive a Connection exception - TEST FAILED
  5. If we receive a timeout exception, we ping the HOST.
  6. If both the timeout and ping fail - TEST FAILED, if the ping passes - TEST OK

This is not a reliable test, because UDP is not a reliable protocol

myieye commented 3 years ago

Sounds well thought through! 👍