From 3b0fa1b3d40806e319e5bc94969f3f99f7e99ded Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 13 Jul 2012 09:53:12 +0200 Subject: [PATCH] plugin_wrapper: Change return codes lt 0 or gt 3 to 3. Else, Nagios will replace the plugin output with an hardcoded built-in value to tell the user that the RC is out of range. However, when using the wrapper, we're interested in the actual output. --- plugin_wrapper.pl | 5 +++++ 1 file changed, 5 insertions(+) mode change 100755 => 100644 plugin_wrapper.pl diff --git a/plugin_wrapper.pl b/plugin_wrapper.pl old mode 100755 new mode 100644 index 3db473f..4390715 --- a/plugin_wrapper.pl +++ b/plugin_wrapper.pl @@ -64,6 +64,11 @@ if ($p_rc == 255) { my $p_output = join('', @p_output); print $p_output; + +if (($p_rc < 0) || ($p_rc > 3)) { + $p_rc = 3; +} + exit $p_rc; sub exit_usage {