From 91ea20628e0f0ff53d58b3d957197c8cd70709c0 Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Tue, 9 Jul 2024 14:11:01 +0200 Subject: [PATCH] collector: don't prepend path if already absolute Fixes #199 Signed-off-by: Conrad Hoffmann --- collector.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/collector.go b/collector.go index 8611ae8..656faa6 100644 --- a/collector.go +++ b/collector.go @@ -99,7 +99,10 @@ func (c metaCollector) Collect(ch chan<- prometheus.Metric) { var up int level.Debug(logger).Log("msg", "Running collector", "target", target.host, "collector", collector.Name()) - fqcmd := path.Join(*executablesPath, collector.Cmd()) + fqcmd := collector.Cmd() + if !path.IsAbs(fqcmd) { + fqcmd = path.Join(*executablesPath, collector.Cmd()) + } args := collector.Args() cfg := config.GetFreeipmiConfig()