How to monitor a CDN'd URL across multiple regions

I’d like to do the following:
we have an external URL that will resolve differently depending which geographic region is being used as the source. very much like a typical CDN, where DNS response varies from country to country, usually pointing to the nearest instance.

how would I go about monitoring this url across different distributed nodes, where each node is associated to a different geographic region?
if it were a static IP, it would be easy to create host records for each instance and a rule to check https for that host… but if it’s just 1 fqdn hostname, and dns result is not consistent across regions…?

i.e hostnameAAA responds as x.y.z in US, but responds as a.b.c in EU
I want to monitor https://hostnameAAA from both US and EU, ensuring that these regions can access the URL and that i have basic response time values for each check…
thanks

Hi @cdnvballer

So, do you have one CMK instance in the US, and one in the EU then, or how did you envision monitoring this particular URL?

When I read the “help text” of a normal host object for the field “IPv4 Address”, I see this
explanation, from which I partially quote and highlight the part that seems relevant for your case in bold:

If you enter a DNS name here, the DNS resolution will be carried out each time the host is checked. Check_MKs DNS cache will NOT be queried. Use this only for hosts with dynamic IP addresses.

Am I oversimplifying your case, or would this work for you?

Thomas

hi,
Basic requirement:
I want check_http to report on reachability and latency to the URL, as it varies from each region.
to me it would be a service check for each region. with differing results.

maybe I missed that part in the doc, but if host entry’s IPv4 is left blank, under what condition would check_mk use DNS cache vs querying DNS? I’ve had to flush check_mk dns cache before to force update on a few internal network host entries that changed IP, so that part isn’t clear…
as well, I cant’ have the same hostname entry, CMK would complain about duplicate host entry when I try that.

I found this, Monitor sites behind CDN - #2 by anon66228339 - Icinga Director - Icinga Community
and may try to apply the same logic to solve my problem. was hoping someone had a cleaner solution. =)

Hi @cdnvballer

No you can’t have the same hostname, twice, that’s right, but you could make two different ones up…
This doesn’t matter, and if you do have set up something in the “IPv4 Address” field, an active HTTP check will use this address resp. DNS name (unless explicitly overridden in its rule).

If you leave the field I mentioned in my earlier post, blank, CMK will - as per the help in the GUI - do the following:

If you do not set this attribute, hostname resolution will be done when you activate the configuration. Check_MKs builtin DNS cache is activated per default in the global configuration to speed up the activation process. The cache is normally updated daily with a cron job. You can manually update the cache with the command cmk -v --update-dns-cache.

But - as I pointed out earlier - if you do set up a name, you circumvent the DNS caching function.

At least that’s how I understand the help text, which you can review by clicking on the little “book” icon on the top right corner of a “host” object.

Perhaps I’m missing something in your requirement, but I feel like this should work quite easily out of the box.

Thomas

Thanks Thomas,

I intiially tried to create a dummy host record, with IP addr 127.0.0.1 …

however, the http check would completely fail even though the check is set to query the URL and not the 127.0.0.1 IP associated with the hostname… not sure why…

I got around this by creating unique DNS alias used by each regions’ server…
so that when the regional instance queries the unique hostname alias, it will get the regionalized answer (nearest server IP) from the CDN…

have to rely on DNS query,can’t avoid it…

Hi @cdnvballer

OK, thanks for sharing your solution. Might be helpful for others with similar issues.

Best of luck to you!
Thomas

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.