summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_disk_smb.pl
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.org>2017-03-13 10:47:52 (GMT)
committerGitHub <noreply@github.com>2017-03-13 10:47:52 (GMT)
commitc810dd0dfc9c42035c514af6606f8d6471c4e7d4 (patch)
tree535867da963dd4faad93b0448d15e086f1906612 /plugins-scripts/check_disk_smb.pl
parent9daeceaed39b04e79ba364e311e0532e4fdf711f (diff)
parent77aa6d4ebf1bd3567395c92b9e5cc9daa74e9838 (diff)
downloadmonitoring-plugins-c810dd0dfc9c42035c514af6606f8d6471c4e7d4.tar.gz
Merge pull request #1469 from sni/master
make tests more reliable
Diffstat (limited to 'plugins-scripts/check_disk_smb.pl')
-rwxr-xr-xplugins-scripts/check_disk_smb.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 9899226..28c49e8 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -19,7 +19,7 @@
19# 19#
20 20
21require 5.004; 21require 5.004;
22use POSIX; 22use POSIX qw(setsid);
23use strict; 23use strict;
24use Getopt::Long; 24use Getopt::Long;
25use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose); 25use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose);
@@ -28,6 +28,9 @@ use FindBin;
28use lib "$FindBin::Bin"; 28use lib "$FindBin::Bin";
29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
30 30
31# make us session leader which makes all childs exit if we do
32setsid;
33
31sub print_help (); 34sub print_help ();
32sub print_usage (); 35sub print_usage ();
33 36
@@ -175,6 +178,8 @@ my @lines = undef;
175# Just in case of problems, let's not hang the monitoring system 178# Just in case of problems, let's not hang the monitoring system
176$SIG{'ALRM'} = sub { 179$SIG{'ALRM'} = sub {
177 print "No Answer from Client\n"; 180 print "No Answer from Client\n";
181 $SIG{'INT'} = 'IGNORE';
182 kill(-2, $$);
178 exit $ERRORS{"UNKNOWN"}; 183 exit $ERRORS{"UNKNOWN"};
179}; 184};
180alarm($TIMEOUT); 185alarm($TIMEOUT);