Exporter cannot access bird control socket
Task Info (Flyspray) | |
---|---|
Opened By | Brian BIdulock (bidulock) |
Task ID | 74548 |
Type | Bug Report |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2022-04-24 10:19:04 UTC |
Status | Assigned |
Assignee | Tim (bastelfreak) |
Details
Description:
The configuration of prometheus-bird-exporter.service is restricting it from accessing the /run/bird/bird.ctl socket necessary for it to scrape metrics.
This is because it is run with User=bird_exporter Group=bird_exporter which prohibit it from accessing the /run/bird/bird.ctl socket.
Additional info:
-
package version(s)
bird 2.0.9-2 prometheus-bird-exporter 1.2.6-1
-
config and/or log files etc.
#/etc/conf.d/prometheus-bird-exporter BIRD_EXPORTER_ARGS="-bird.v2=true -bird.socket /run/bird/bird.ctl"
above config otherwise prometheus-bird-exporter.service looks for control socket in /var/run/bird.ctl by default.
-
link to upstream bug report, if any
Steps to reproduce:
Install bird and prometheus-bird-exporter
$> systemctl start bird.service
$> prometheus-bird-exporter -bird.v2=true -bird.socket /run/bird/bird.ctl & $> curl localhost:9324/metrics
The above two will work (as prometheus-bird-exporter is run as root).
$> kill %1 $> systemctl start prometheus-bird-exporter.service $> curl localhost:9324/metrics $> systemctl status prometheus-bird-exporter.service
Above yields:
Apr 24 03:58:57 hamm prometheus-bird-exporter[676776]: time="2022-04-24T09:58:57Z" level=error msg="dial unix /run/bird/bird.ctl: connect: permission denied" Apr 24 03:59:00 hamm prometheus-bird-exporter[676776]: time="2022-04-24T09:59:00Z" level=error msg="dial unix /run/bird/bird.ctl: connect: permission denied"