Skip to content

Conversation

@RincewindsHat
Copy link
Member

replaces #2131

This is a port of #2131 which I adapted, since my refactoring made the original
commit inapplicable.

All thanks to @mjeanson for this.

When running the check on an ipv6 address with a sticky onredirect
policy like in this example:

  check_curl -6 -H example.com -I ::1 -f sticky

It results in a getaddrinfo error:

  HTTP CRITICAL - Unable to lookup IP address for '[::1]': getaddrinfo returned -3 - Temporary failure in name resolution

This happens because in check_http() if the content of server_addr is an
ipv6 address enclosing brackets are added and on redirection a
subsequent call to check_http() will pass this now bracketed value to
getaddrinfo resulting in the error.

To work around this, strip the brackets from the address prior to the
lookup_host() call.
@RincewindsHat RincewindsHat merged commit db2983d into monitoring-plugins:master Nov 28, 2025
7 checks passed
@RincewindsHat RincewindsHat deleted the fix/check_curl_sticky_redir branch November 28, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant