Bit shift right by 8 to get return code from exit status
authorScott Sanders <jssjr@github.com>
Fri, 19 Sep 2014 14:31:18 +0000 (10:31 -0400)
committerFlorian Forster <octo@collectd.org>
Mon, 22 Sep 2014 06:55:29 +0000 (08:55 +0200)
Pull-Request: #741
Signed-off-by: Florian Forster <octo@collectd.org>
contrib/exec-nagios.px

index c7f18c5..ec13b0a 100755 (executable)
@@ -442,7 +442,7 @@ sub execute_script
 
   close ($fh);
   # Save the exit status of the check in $state
-  $state = $?;
+  $state = $? >> 8;
 
   if ($state == 0)
   {