From 2564208ca8394edf20451ce3146ac1b59e0da0c5 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 3 Oct 2026 03:24:10 +0200 Subject: [PATCH] fix #5997: metrics: influxdb: fall back to the ready endpoint in connection test The connection test for InfluxDB over HTTP(S) queries the '/health' endpoint. The InfluxDB v2 listener of Telegraf only has it since version 1.36, older versions only provide '/api/v2/ready'. So adding such a listener as metric server fails with '404 Not Found', although writing metrics to it would work. If '/health' is not found, query '/api/v2/ready' instead. Other errors, like an invalid token, are still reported right away. Signed-off-by: Michal Fox --- PVE/Status/InfluxDB.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm index de291de..49c702a 100644 --- a/PVE/Status/InfluxDB.pm +++ b/PVE/Status/InfluxDB.pm @@ -267,6 +267,11 @@ sub test_connection { } my $response = $ua->get($url); + # the InfluxDB v2 listener of Telegraf before 1.36 only has the ready endpoint + if ($response->code == 404) { + $response = $ua->get(_get_v2url($cfg, "ready")); + } + if (!$response->is_success) { my $err = $response->status_line; die "$err\n";