summaryrefslogtreecommitdiffstats
path: root/NPTest.pm
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-03-29 15:30:34 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-03-29 15:30:34 (GMT)
commita0f387467691292fe62c66e56fbc8476c7ecbb2d (patch)
tree18a69005950fac466b6d2e25874c7abf66db5a2f /NPTest.pm
parent3824f7350251d4d10a794b6b9390333dbe567c57 (diff)
downloadmonitoring-plugins-a0f387467691292fe62c66e56fbc8476c7ecbb2d.tar.gz
Will die if signal received from a testCmd
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1364 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'NPTest.pm')
-rw-r--r--NPTest.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/NPTest.pm b/NPTest.pm
index f3fb896..1372d14 100644
--- a/NPTest.pm
+++ b/NPTest.pm
@@ -609,10 +609,13 @@ sub testCmd {
609 my $object = $class->new; 609 my $object = $class->new;
610 610
611 my $output = `$command`; 611 my $output = `$command`;
612 $object->return_code($? >> 8);
613 $_ = $? & 127;
614 if ($_) {
615 die "Got signal $_ for command $command";
616 }
612 chomp $output; 617 chomp $output;
613
614 $object->output($output); 618 $object->output($output);
615 $object->return_code($? >> 8);
616 619
617 if ($ENV{'NPTEST_DEBUG'}) { 620 if ($ENV{'NPTEST_DEBUG'}) {
618 my ($pkg, $file, $line) = caller(0); 621 my ($pkg, $file, $line) = caller(0);