mehdy / keepalived-exporter

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

The exporter requires to run as "root" to work #82

Closed kodachimaru closed 1 year ago

kodachimaru commented 2 years ago

If I run it as a non root user, I get this error

prometheus@pgsyncslave:/home/sosuna/keepalived-exporter-1.0.0.linux-amd64$ curl localhost:9165/metrics
ERRO[0010] Failed to send signal                         error="operation not permitted" pid=12008
ERRO[0010] Failed to send STATS signal to keepalived     error="operation not permitted"
ERRO[0010] No data found to be exported                  error="operation not permitted" json=false

And the only metric returned is

keepalived_up 0

If I run it as "root" instead, the exporter works just fine. But obviously I don't wanna run it as root...

kodachimaru commented 2 years ago

I am running keepalived as root, maybe it could be because of that?

mehdy commented 1 year ago

@kodachimaru That's correct. Since you're running keepalived as root the files that keepalived creates are owned by the root users. I recommend running keepalived and keepalived-exporter as non-root users with a shared group.

Sorry for the long delay. Feel free to reopen if it didn't solve your problem.