From af6b9daf1696c47a4163fa8fb578cd45ac42b79b Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Wed, 22 Sep 2021 12:05:10 +0200 Subject: [PATCH] MonitoringPlugin: Multiline verbose output, cleanup --- MyMonPlugin/monitoringplugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MyMonPlugin/monitoringplugin.py b/MyMonPlugin/monitoringplugin.py index cd4c8a7..88027b9 100644 --- a/MyMonPlugin/monitoringplugin.py +++ b/MyMonPlugin/monitoringplugin.py @@ -361,12 +361,12 @@ class MonitoringPlugin(object): bol = 'V' + str(level) + ':' + ' ' * level if prefix: bol += '%s' % prefix - if type(output) in [str, str, ]: - print((bol + output)) + if type(output) in [str, ]: + print(bol + output.lstrip().rstrip().replace('\n', '\n' + bol)) elif type(output) in [list, ]: - print(('\n'.join( ['%s%s' % (bol, l) for l in output] ) )) + print('\n'.join( ['%s%s' % (bol, l) for l in output] ) ) else: - print(('%s%s' % (bol, output) )) + print('%s%s' % (bol, output) ) def max_returncode(self, returncodes):