prometheus: ignore user@ units when checking for failed units (#50376)

This commit is contained in:
Frédéric Péters 2021-01-22 21:50:52 +01:00
parent e6a7c98ab4
commit f910dfd327
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ def units(ctn):
s = bus.get_object("org.freedesktop.systemd1", "/org/freedesktop/systemd1")
manager = dbus.Interface(s, "org.freedesktop.systemd1.Manager")
units = manager.ListUnits()
n = len([u for u in units if u[3] == "failed"])
n = len([u for u in units if u[3] == "failed" and not u[0].startswith("user@")])
eo_units.labels(ctn, "failed").set(n)