eclipse-bluechi / bluechi

Eclipse BlueChi is a systemd service controller intended for multi-node environments with a predefined number of nodes and with a focus on highly regulated ecosystems such as those requiring functional safety.
https://bluechi.readthedocs.io/en/latest/
GNU Lesser General Public License v2.1
129 stars 37 forks source link

Want systemd-cgtop like feature across nodes #188

Open alexlarsson opened 1 year ago

alexlarsson commented 1 year ago

I.e. ability to get this kind of data from any node when you are on the manager node.

I'm not sure what apis systemd-cgtop uses, but it may very well be that it only uses the systemd properties that are already exposed by hirte, and all we need is a client application which collects this information.

alexlarsson commented 1 year ago

Here is the cgtop code: https://github.com/systemd/systemd/blob/main/src/cgtop/cgtop.c

engelmi commented 1 year ago

After an initial, brief research looking at the cgtop source code and other documentation it turns out that the functionality of cgtop is only provided via the CLI tool - there is no D-Bus API providing these kind of information directly.

The cgtop code itself is quite tightly tied into the systemd's library, so copying (and changing the code to our needs) would result in basically copying a huge part of systemds code base. Therefore, this is probably not a reasonable solution.

Another option could be to extend cgtop in systemd, e.g. building another binary and wrapping it in a systemd service, so that it provides a D-Bus interface with the required information - either via PR to systemd itself or in a fork.

There are probably more options to implement this, but considering the high complexity and effort needed as well as the (currently) low priority this issue is deprioritized for now.