From 754f736dd62a4e93e43db0b07662ed3c828691f7 Mon Sep 17 00:00:00 2001 From: Florian Heigl Date: Sat, 17 Dec 2016 17:36:29 +0100 Subject: [PATCH] Nagios Compliant output Hi, the plugin output should stick to the Nagios plugin guidelines, that means you would need to start with OK/CRIT(ICAL))/UNKNOWN/WARN(ING) Probably you want your actual "System is" text back in the output, I just didn't want to fiddle around in your code. --- check_systemd_state | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_systemd_state b/check_systemd_state index 2b008e2..172e70e 100755 --- a/check_systemd_state +++ b/check_systemd_state @@ -38,8 +38,8 @@ def get_failed_units(): system_state = get_system_state() if system_state in ['running', 'starting']: - print('System OK: {}'.format(system_state)) + print('OK: {}'.format(system_state)) sys.exit(0) else: - print('System NOT OK: {}, failed: {}'.format(system_state, " ".join(get_failed_units()))) + print('CRIT: {}, failed: {}'.format(system_state, " ".join(get_failed_units()))) sys.exit(2)