summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Monitoring/Plugin/Functions.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Monitoring/Plugin/Functions.pm b/lib/Monitoring/Plugin/Functions.pm
index 62bb14b..a19db49 100644
--- a/lib/Monitoring/Plugin/Functions.pm
+++ b/lib/Monitoring/Plugin/Functions.pm
@@ -118,7 +118,10 @@ sub plugin_exit {
118 118
119 # Setup output 119 # Setup output
120 my $output = "$STATUS_TEXT{$code}"; 120 my $output = "$STATUS_TEXT{$code}";
121 $output .= " - $message" if defined $message && $message ne ''; 121 if (defined $message && $message ne '') {
122 $output .= " - " unless $message =~ /^[ \f\r\t\w]*\n/;
123 $output .= $message;
124 }
122 my $shortname = ($arg->{plugin} ? $arg->{plugin}->shortname : undef); 125 my $shortname = ($arg->{plugin} ? $arg->{plugin}->shortname : undef);
123 $shortname ||= get_shortname(); # Should happen only if funnctions are called directly 126 $shortname ||= get_shortname(); # Should happen only if funnctions are called directly
124 $output = "$shortname $output" if $shortname; 127 $output = "$shortname $output" if $shortname;