collector: don't prepend path if already absolute

Fixes #199

Signed-off-by: Conrad Hoffmann <ch@bitfehler.net>
This commit is contained in:
Conrad Hoffmann 2024-07-09 14:11:01 +02:00
parent 6874424d25
commit 91ea20628e
1 changed files with 4 additions and 1 deletions

View File

@ -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()