diff options
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r-- | lib/Nagios/Plugin/Functions.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm index e77bc4f..9cb7eb6 100644 --- a/lib/Nagios/Plugin/Functions.pm +++ b/lib/Nagios/Plugin/Functions.pm | |||
@@ -75,7 +75,12 @@ sub nagios_exit { | |||
75 | # Set defaults | 75 | # Set defaults |
76 | $code = UNKNOWN unless defined $code && exists $STATUS_TEXT{$code}; | 76 | $code = UNKNOWN unless defined $code && exists $STATUS_TEXT{$code}; |
77 | $message = '' unless defined $message; | 77 | $message = '' unless defined $message; |
78 | $message = join(' ', @$message) if ref $message eq 'ARRAY'; | 78 | if (ref $message && ref $message eq 'ARRAY') { |
79 | $message = join(' ', map { chomp; $_ } @$message); | ||
80 | } | ||
81 | else { | ||
82 | chomp $message; | ||
83 | } | ||
79 | 84 | ||
80 | # Setup output | 85 | # Setup output |
81 | my $output = "$STATUS_TEXT{$code}"; | 86 | my $output = "$STATUS_TEXT{$code}"; |