From c7777408ea462d61632c04239b48b0ef2445cb03 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 15 Mar 2021 15:26:46 +0100 Subject: [PATCH] metrics: influx: special case 'health' api path i _get_v2url the forwards compatible api of 1.8 only contains this path (not api/v2/health) and it it also contained in the v2 api Signed-off-by: Dominik Csapak --- PVE/Status/InfluxDB.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm index 542d8006..55c6efce 100644 --- a/PVE/Status/InfluxDB.pm +++ b/PVE/Status/InfluxDB.pm @@ -175,7 +175,12 @@ sub _get_v2url { if ($api_prefix ne '' && $api_prefix =~ m!^/*(.+)/*$!) { $api_prefix = "/$1/"; } - return "${proto}://${host}:${port}${api_prefix}api/v2/${api_path}"; + + if ($api_path ne 'health') { + $api_path = "api/v2/${api_path}"; + } + + return "${proto}://${host}:${port}${api_prefix}${api_path}"; } sub _connect {