mehdy / keepalived-exporter

Prometheus Keepalived exporter
GNU General Public License v3.0
115 stars 37 forks source link

The exporter does not get any metrics #69

Closed christian-vdz closed 3 years ago

christian-vdz commented 3 years ago

Hello,

I installed the exporter using the binary into /srv/ directory and I am using Keepalived v2.0.19 (10/19,2019) on Ubuntu Focal.

When I execute the exporter using a dedicated user, the exporter can't get any metrics :

# service keepalived-exporter status
systemd[1]: Started Keepalived Exporter Server.
keepalived-exporter[102339]: time="2021-02-17T08:40:18+01:00" level=info msg="Listening on address: :9165"
keepalived-exporter[102339]: time="2021-02-17T08:40:35+01:00" level=error msg="Failed to send signal" error="operation not permitted" pid=74793
keepalived-exporter[102339]: time="2021-02-17T08:40:35+01:00" level=error msg="Failed to send STATS signal to keepalived" error="operation not permitted"
keepalived-exporter[102339]: time="2021-02-17T08:40:35+01:00" level=error msg="No data found to be exported" error="operation not permitted" json=false

When I execute the exporter as root, I get the following error :

/srv/keepalived-exporter-1.0.0.linux-amd64# ./keepalived-exporter
INFO[0000] Listening on address: :9165
panic: runtime error: index out of range [2] with length 1

goroutine 32 [running]:
github.com/cafebazaar/keepalived-exporter/internal/collector.(*KeepalivedCollector).Collect(0xc000080910, 0xc0000b1560)
    /home/seena/storage/keepalived-exporter/internal/collector/collector.go:151 +0x29ef
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
    /home/seena/go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:444 +0x19d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
    /home/seena/go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:536 +0xe36

Do you have any idea of how I can fix this?

Thanks. Kind regards, Christian

christian-vdz commented 3 years ago

works with v1.1.0