ClusterLabs / ha_cluster_exporter

Prometheus exporter for Pacemaker based Linux HA clusters
Apache License 2.0
78 stars 35 forks source link

Running as non-root user #242

Closed ColmMcBarron closed 9 months ago

ColmMcBarron commented 1 year ago

How should this be setup to run as a non root user with read only access?

A sudo user with access to the binaries returns a lot of permissions errors.

level=warn msg="pacemaker collector scrape failed"
level=warn msg="corosync collector scrape failed"

Running the raw commands for cfgtool also throw an error.

Running it as root works fine.

I am guessing there are some underlying binaries that need to be added to the sudoers file?

Maybe this is a documentation problem.

ThomasG77 commented 9 months ago

You may look at https://docs.goreplay.org/untitled/running-as-non-root-user

stefanotorresi commented 9 months ago

Running the raw commands for cfgtool also throw an error.

If running the raw commands throws an error, then the upstream tool needs to support sudo usage in the first place, there is not much we can do in the exporter; we just consume those tools, and if they assume root, the exporter needs to do so as well.