Module: check_mk
Branch: master
Commit: c0a0b0adc1313c71545f801932747584a5948654
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0a0b0adc1313c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 13 16:04:21 2019 +0100
Fixed systemd parse function without systemd installed
Change-Id: I895ff4b6708300b1cbb27a2b9032b113a0bc0d7d
---
checks/systemd_units | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/checks/systemd_units b/checks/systemd_units
index 8a9bf10..409117e 100644
--- a/checks/systemd_units
+++ b/checks/systemd_units
@@ -63,8 +63,11 @@ _SYSTEMD_UNITS = [
def parse_systemd_units(info):
-
parsed = {}
+
+ if not info:
+ return {}
+
# second to last line (see above): "X loaded units listed."
count = int(info[-2][0])
if count == 0: