monitoringplugin: Shorter output for 1 check in brain
Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
parent
9b2009c2c8
commit
24ed140d4a
|
@ -234,6 +234,14 @@ class MonitoringPlugin(object):
|
||||||
|
|
||||||
|
|
||||||
def brain2output(self):
|
def brain2output(self):
|
||||||
|
if len(self.__brain_checks) == 1:
|
||||||
|
check = self.__brain_checks[0]
|
||||||
|
self.add_output(check.get('output'))
|
||||||
|
if check.get('multilineoutput'):
|
||||||
|
self.add_multilineoutput(check.get('multilineoutput'))
|
||||||
|
self.add_returncode(check.get('returncode') or 0)
|
||||||
|
|
||||||
|
else:
|
||||||
out = [[], [], [], []]
|
out = [[], [], [], []]
|
||||||
for check in self.__brain_checks:
|
for check in self.__brain_checks:
|
||||||
tagtarget = self.tagtarget(check['tag'], check.get('target'))
|
tagtarget = self.tagtarget(check['tag'], check.get('target'))
|
||||||
|
@ -241,10 +249,6 @@ class MonitoringPlugin(object):
|
||||||
self.add_returncode(returncode)
|
self.add_returncode(returncode)
|
||||||
|
|
||||||
out[returncode].append(tagtarget)
|
out[returncode].append(tagtarget)
|
||||||
#if returncode == 0:
|
|
||||||
# self.add_output(tagtarget)
|
|
||||||
#else:
|
|
||||||
# self.add_output(tagtarget + '(' + check.get('output') + ') ')
|
|
||||||
|
|
||||||
self.add_multilineoutput(self.RETURNSTRINGS[returncode] + ' ' + tagtarget + ' - ' + check.get('output'))
|
self.add_multilineoutput(self.RETURNSTRINGS[returncode] + ' ' + tagtarget + ' - ' + check.get('output'))
|
||||||
if check.get('multilineoutput'):
|
if check.get('multilineoutput'):
|
||||||
|
|
Loading…
Reference in a new issue