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.
This commit is contained in:
parent
e95167262b
commit
754f736dd6
1 changed files with 2 additions and 2 deletions
|
@ -38,8 +38,8 @@ def get_failed_units():
|
||||||
|
|
||||||
system_state = get_system_state()
|
system_state = get_system_state()
|
||||||
if system_state in ['running', 'starting']:
|
if system_state in ['running', 'starting']:
|
||||||
print('System OK: {}'.format(system_state))
|
print('OK: {}'.format(system_state))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
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)
|
sys.exit(2)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue