From: Nizamudeen A Date: Wed, 10 Sep 2025 13:00:36 +0000 (+0530) Subject: monitoring: add user-agent headers to the urllib X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F65470%2Fhead;p=ceph.git monitoring: add user-agent headers to the urllib The documentation started raising 403 suddenly. Adding User-Agent headers to the request Signed-off-by: Nizamudeen A --- diff --git a/monitoring/ceph-mixin/tests_alerts/validate_rules.py b/monitoring/ceph-mixin/tests_alerts/validate_rules.py index c24ce5c59d55..8c1e32930249 100755 --- a/monitoring/ceph-mixin/tests_alerts/validate_rules.py +++ b/monitoring/ceph-mixin/tests_alerts/validate_rules.py @@ -84,7 +84,14 @@ class HTMLCache: if url in self.cache: return self.cache[url] - req = urllib.request.Request(url) + headers = { + "User-Agent": ( + "Mozilla/5.0 (X11; Linux x86_64) " + "AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/139.0.0.0 Safari/537.36" + ), + } + req = urllib.request.Request(url, headers=headers) try: r = urllib.request.urlopen(req) except urllib.error.HTTPError as e: