Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Recursive systemd unit monitoring #116

Open
bjornfor opened this issue Nov 23, 2023 · 0 comments
Open

Feature request: Recursive systemd unit monitoring #116

bjornfor opened this issue Nov 23, 2023 · 0 comments

Comments

@bjornfor
Copy link

(Originally posted at prometheus/node_exporter#2830, where it was suggested to post here.)

systemd can connect to systemd inside systemd-nspawn containers to provide a unified view of services from the host.

$ sudo systemctl list-units --recursive
[...normal units *and* units inside systemd-nspawn containers,
    which are prefixed with `<container_name>:`...]

Having this "recursive" option in systemd_exporter would provide easy and robust monitoring of the whole system.

I found that systemd_exporter (and node_exporter) uses https://github.com/coreos/go-systemd to get the state of units, which in turn queries systemd over D-Bus using the org.freedesktop.systemd1.Manager.ListUnits method. I'm not sure if this feature request needs changes to systemd (expose recursive ListUnits?), or if this info can be obtained somehow using multiple D-Bus calls today.

Also worth mentioning is that the systemd CLI (above example) requires root privileges for the --recursive option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant