Refactor return code search, new function
Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
parent
e0a860273c
commit
619ce45d73
|
@ -306,11 +306,17 @@ class MonitoringPlugin(object):
|
||||||
print 'V' + str(level) + ': ' + output
|
print 'V' + str(level) + ': ' + output
|
||||||
|
|
||||||
|
|
||||||
def exit(self):
|
def max_returncode(self, returncodes):
|
||||||
for returncode in self.returncode_priority:
|
for rc in self.returncode_priority:
|
||||||
if returncode in self.__returncode:
|
if rc in returncodes:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
return rc
|
||||||
|
|
||||||
|
|
||||||
|
def exit(self):
|
||||||
|
returncode = self.max_returncode(self.__returncode)
|
||||||
|
|
||||||
self.back2nagios(returncode, statusline=self.__output, multiline=self.__multilineoutput, performancedata=self.__performancedata)
|
self.back2nagios(returncode, statusline=self.__output, multiline=self.__multilineoutput, performancedata=self.__performancedata)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue