Module: check_mk
Branch: master
Commit: a8b378bd54cb775b0661f41e0688d2c84bbdbd60
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8b378bd54cb77…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 13 16:07:16 2019 +0100
systemd_units.services_summary: Only discover when systemd infos are available
Change-Id: I16c78351268ac648235f415bd82c6a23014c2aa1
---
checks/systemd_units | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/checks/systemd_units b/checks/systemd_units
index 409117e..4def27f 100644
--- a/checks/systemd_units
+++ b/checks/systemd_units
@@ -120,7 +120,6 @@ discovery_systemd_units_services_rules = []
def discovery_systemd_units_services(parsed):
-
services = parsed.get('service', {})
def regex_match(what, name):
@@ -151,7 +150,6 @@ def discovery_systemd_units_services(parsed):
def check_systemd_units_services(item, params, parsed):
-
services = parsed.get('service', {})
service = services.get(item, None)
if service is None:
@@ -172,8 +170,9 @@ check_info['systemd_units.services'] = {
}
-def discovery_systemd_units_services_summary(_no_parsed):
- yield 'Summary', {}
+def discovery_systemd_units_services_summary(parsed):
+ if parsed:
+ yield 'Summary', {}
def check_systemd_units_services_summary(_no_item, params, parsed):