Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 + IPv4 switch to see if both are healty #1242

Open
1 task done
resu-cireneg opened this issue Jan 31, 2022 · 28 comments · May be fixed by #3885
Open
1 task done

IPv6 + IPv4 switch to see if both are healty #1242

resu-cireneg opened this issue Jan 31, 2022 · 28 comments · May be fixed by #3885
Labels
area:monitor Everything related to monitors blocked-upstream upstream (i.e. a dependency we depend on will have to do this work) feature-request Request for new features to be added type:enhance-existing feature wants to enhance existing monitor

Comments

@resu-cireneg
Copy link

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

API, New Monitor, UI Feature

🔖 Feature description

  • currently it depends on whatever the environment is configured to prefer ( e.g. /etc/gai.conf )
  • there is no proof if IPv4 + IPv6 Host return the same result

✔️ Solution

a little button "resolve ipv6+ipv6" or "dual-stack-check" and the respecting part in the monitoring stack

❓ Alternatives

No response

📝 Additional Context

No response

@resu-cireneg resu-cireneg added the feature-request Request for new features to be added label Jan 31, 2022
@resu-cireneg resu-cireneg changed the title IPv6 + IPv4 swwitch to see if both are healty IPv6 + IPv4 switch to see if both are healty Jan 31, 2022
@BroOtti
Copy link

BroOtti commented May 25, 2022

Seems to be a duplicate of #1025
Also, it doesn't seem to depend on whatever the environment is configured to prefer. On default IPv6 is preferred, but uptime kuma still checks on IPv4 and not on IPv6. Properly, I could just disable IPv4 on my uptime kuma host, but that way I need to activate it again if I want to update uptime kuma as GitHub only supports IPv4...
The best solution would be to add the option of which IP to use, but at least uptime kuma should follow the standard and use IPv6 as default.

@JulianGro
Copy link

The problem for OP and me is that we cannot check that IPv4 and IPv6 works.
#1025 isn't strictly the same because that is about switching between IPv4 and IPv6 instead of testing both.

@Henk57
Copy link

Henk57 commented Aug 2, 2022

Same issue with me. On a location a NAS is only on IPv6. Uptime kuma sees this server as down while it is up and running with a valid DNS and FQDN.

@dtrckd
Copy link

dtrckd commented Dec 22, 2022

see how https://updown.io/ handle ipv4 + ipv6, not even need to switch, it would be a really nice feature.

@RaitoBezarius
Copy link

Am interested into implementing this as I am running into a lot of false positives due to IPv4/IPv6 thing.

@traylenator
Copy link

Even a tick box for ipv4 or ipv6 only and then easy enough to create two monitors if needs be - probably easier.

@ProjectExy
Copy link

Even a tick box for ipv4 or ipv6 only and then easy enough to create two monitors if needs be - probably easier.

Im hoping for this

@larsch
Copy link

larsch commented Aug 23, 2023

Generally speaking, a single URL with hostname can resolve to both IPv4 and IPv6 address(es), but also MULTIPLE addresses. An uptime monitor should really be checking all resolutions of the domain name, not just the default or first one it happens to get.

@stefanux
Copy link

An uptime monitor should really be checking all resolutions of the domain name, not just the default or first one it happens to get.

not sure if there is any monitoring solution which checks both A/AAAA and possibly even multiple records of them. seems out of scope for uptime kuma since you could simply add more checks for everything you need (v4 and v6).

if you have multiple A/AAAA-Records for http you normally would check on IP and use specific hostname to get correct site, this could be done via
setting "URL" to "https://1.2.3.4/my-monitoring-uri" and send host header using "JSON-Headers":

{
    "Host": "www.MY.HOST.TLD"
}

most basic is the feature to choose address family for all protocols when using DNS.

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Aug 23, 2023

if you have multiple A/AAAA-Records for http you normally would check on IP and use specific hostname to get correct site, this could be done via

Please not this likely bug in ipv6 handling of axios: #3564
Fixing said bug would possibly require an upgrade of axios which is blocked by there not being a documentation on how to upgrade from 0.x to 1.x and what changes were made or more debugging.

@larsch
Copy link

larsch commented Aug 23, 2023

not sure if there is any monitoring solution which checks both A/AAAA and possibly even multiple records of them. seems out of scope for uptime kuma since you could simply add more checks for everything you need (v4 and v6).

You could. I still think the current model can be dangerous for the naive user. You get a green label, even if your connectivity is partially broken. I'm not complaining here, just suggesting that an implicit check of all domain name resolutions would what the user really needs, and often didn't realise that they wanted.

if you have multiple A/AAAA-Records for http you normally would check on IP and use specific hostname to get correct site, this could be done via setting "URL" to "https://1.2.3.4/my-monitoring-uri" and send host header using "JSON-Headers":

{
    "Host": "www.MY.HOST.TLD"
}

You would also need to be able to specify SNI for this work.

@lucasnz
Copy link

lucasnz commented Oct 12, 2023

I've been working on a PR to resolve this. It would add an option to specify IPv4 or IPv6. If you leave it on "auto detect" (the default) it will use the current logic. It works with the following monitors so far: Ping, TCP, DNS. I'm working on the HTTP monitor then I'll submit it.

Here are some screenshots of the option:
Screenshot 2023-10-12 174951
Screenshot 2023-10-12 175028

@MatzeKitt
Copy link

Thank you!

I’m not sure if "IP Family" is the correct term here, as to my knowledge, it refers to a broader set of IP protocols as TCP, DNS, SMTP etc. – all being part of the IP family. Thus I would suggest going with "IP version".

@lucasnz
Copy link

lucasnz commented Oct 12, 2023

I'm not particularly set on the name. It's called IP Address Family in normally, e.g. in the nodejs doco it calls it address family: https://nodejs.org/api/net.html#socketaddressfamily

@ev0lister
Copy link

IP address family should be fine to use, as per IANA the family version 4 and 6 have assigned number 1 and 2.

That being said, I appreciate the work to be able to determine the ip protocol being used for a monitor.

@lucasnz lucasnz linked a pull request Oct 13, 2023 that will close this issue
7 tasks
@Derkades
Copy link

Thank you for your work on this! It would be great if there was a fourth option to check both IPv4 and IPv6, avoiding the need to create 2 ping jobs. Not sure if that's possible in the current uptime-kuma framework.

@lucasnz
Copy link

lucasnz commented Oct 13, 2023

Thank you for your work on this! It would be great if there was a fourth option to check both IPv4 and IPv6, avoiding the need to create 2 ping jobs. Not sure if that's possible in the current uptime-kuma framework.

I don't see how you would implement a dual check. If IPv4 was down, but IPv6 was up - how would the logic of the monitor be set - should it show as down or up. How would it display which IP version wasn't working? I think it best that this is set up as two monitors for clarity.

@ofifoto
Copy link

ofifoto commented Oct 13, 2023

Two would make the most sense to me, that way the ping graphs would represent an accurate ping time for each (unless one went down the road to have two ping graphs.... but that seems like a lot of extra development effort). If one wanted they could make a group I suppose to contain the two variants (host - host v4, host v6)

@joachimtingvold
Copy link

joachimtingvold commented Oct 17, 2023

If a service is supposed to be dual-stacked, but suddenly becomes single-stacked (regardless of it's IPv4-only or IPv6-only), the service is for all intents and purposes "down" the way I see it. If Kuma monitors both IPv4 and IPv6 simultaneously, it's no problem to alert/identify what address-family that becomes unresponsive (and alert accordingly, like "IPv4 down for service XYZ" or similar).

If the "down" vs. "partially-down" is a controversal topic, it could probably be made as an option (i.e. if it should just alert, but keep the service status "up", or actually mark the whole service as down). Or, maybe even better, introduce "Degraded" status (in addition to "Up" and "Down"). The latter could probably also be tied in with other feature requests (like #2313) to facilitate a way to show bad performance or other kinds of service degradations.

@stefanux
Copy link

@joachimtingvold you cant assume clients are dual-stacked and perform some kind downgrade to v4.
v6 only (or v4 only) cant reach your services therefore its down for them (not a service "degradation" which would imply reachable but slower).

@joachimtingvold
Copy link

joachimtingvold commented Oct 17, 2023

That's essentially what I said; personally I consider a dual-stacked service to be down if it for some reason becomes single-stacked (regardless if IPv4 or IPv6 is broken). However, I merely suggested that it could be a configuration choice, as I can see people look at this differently. There are scenarios where "Degraded" makes sense, and others where "Down" makes sense. As an example, I assume some use Kuma for internal services, and if you have control of the environment (where you can say 100% of the service consumers are dual-stacked), there might be scenarios where you would like to consider the scenario of "dual-stacked service that becomes single-stacked" to be "Degraded", rather than "Down" (as it in many cases would work, just that it needs time to fall back to the working address family -- like Happy Eyeballs and similar mechanics).

@stefanux
Copy link

if the service is not reachable its down, if the host (or the route) is broken its a false alarm in regard to this alarm.
if you dont want a service to be reachable over v6 (or v4) dont publish AAAA/A-records.
essentially you ask for preference order (v6 first, v4 first) or in case of DNS and "ignore downgrade" which is not a behaviour i would recommend for monitoring (sure, its better than "fail silently if downgrade works" but IMHO not much better).

@joachimtingvold
Copy link

I still think it would be beneficial to have options, and let users decice how they want to monitor things. As I mentioned, I see usecases for both variants in controlled environments. If this is implemented as a IPv4/IPv6-dualstacked-specific feature, or combined with the "service grouping"-feature that has been implemented (or at least partially, see #2487 + #2474 + #2693 + #1236, and probably others), I have no strong opinion on. There are many similar problems that dual-stacked monitoring and service grouping have in common. Some of the top of my head;

  • Mark the entire service as down if IPv4 or IPv6 is down
  • Mark service as degraded if IPv4 or IPv6 is down
  • Alert if one part of the service is down (I would like to know specifically if IPv4 or IPv6 failed)
  • Don't alert for both IPv4 and IPv6 if the entire service goes down (just alert once that the service is down)
  • ... and probably more

@stefanux
Copy link

stefanux commented Oct 17, 2023

most tools i know have explicit -4 or -6 switches, or (by default) do downgrades (for which you might want to set the order if v6 > v4 is not desired). not a fan of introducing another status (aside up or down) which would need extra settings in notifications.

@CommanderStorm CommanderStorm added the area:monitor Everything related to monitors label Dec 5, 2023
@CommanderStorm CommanderStorm added the type:enhance-existing feature wants to enhance existing monitor label Dec 9, 2023
@troykelly
Copy link

troykelly commented Dec 9, 2023

There's already extensive support for this clearly, adding my voice to that.

I'd also like to share my thinking on the handling of a v4 and/or v6 outage.

IPv4 and IPv6 are entirely different networks, with different routing and, different network-level issues that could impact performance.

Yes, they are typically handled by the same server, often the same service - but that's not a requirement.

There are IPv4-only networks, dual-stack and IPv6 only networks.

In my opinion, the ability to select the IP family needs to be thought of simply as a time saver for creating two entries - and that's it.

An outage of IPv4 or IPv6 while the other remains up is not a degradation of service - it's an outage - the server is offline for some (or maybe all) of your eyeballs.

Where we can, we already create separate monitors for each IP family:
Screenshot by Dropbox Capture

The failure of both IPv4 and IPv6 may be treated differently by some - perhaps it means some more significant outage of the service or backend rather than a network layer issue - but that really depends on the service, the environment and those who manage it.

IPv6 is a replacement for IPv4 (eventually... maybe... someday?) - we must not make the mistake of thinking that dual stack for life is the solution, and our monitoring tools need to embrace that thinking also.

@ShadowJonathan
Copy link

Not even gai.conf seems to properly order what is being preferred, since axios seems to pick ipv6 over ipv4: axios/axios#5785

@Crash1602

This comment was marked as duplicate.

@joachimtingvold
Copy link

joachimtingvold commented Dec 27, 2024

In my opinion, the ability to select the IP family needs to be thought of simply as a time saver for creating two entries - and that's it.
[…]
Where we can, we already create separate monitors for each IP family:

It's not just "to save time" (by not having to create duplicate rules).

99% of the services I'd like to monitor is using FQDNs with A+AAAA records. I don't want to create A- and AAAA-only FQDNs for the same service (ipv4.service.foobar.com + ipv6.service.foobar.com, etc), just for the sake of being able to monitor the IP-stacks individually.

I'm not interested in using their IP addresses either, and sometimes you are not even able to (i.e. for services that are using dynamic DNS entries or similar). To facilitate this, as a minimum you'd need some kind of "address family" option for the alert (where you can choose between IPv4 or IPv6).

As a "phase 2" of the address family option, you could implement full dual-stack alerting/monitoring for a rule, and uptime-kuma can figure out this by itself (by looking at the DNS response), and monitor one or both of the address families for a given FQDN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors blocked-upstream upstream (i.e. a dependency we depend on will have to do this work) feature-request Request for new features to be added type:enhance-existing feature wants to enhance existing monitor
Projects
None yet
Development

Successfully merging a pull request may close this issue.