diff --git a/monitoringplugin.py b/monitoringplugin.py index ef29eb6..dcec5d7 100644 --- a/monitoringplugin.py +++ b/monitoringplugin.py @@ -306,11 +306,17 @@ class MonitoringPlugin(object): print 'V' + str(level) + ': ' + output - def exit(self): - for returncode in self.returncode_priority: - if returncode in self.__returncode: + def max_returncode(self, returncodes): + for rc in self.returncode_priority: + if rc in returncodes: break + return rc + + + def exit(self): + returncode = self.max_returncode(self.__returncode) + self.back2nagios(returncode, statusline=self.__output, multiline=self.__multilineoutput, performancedata=self.__performancedata)