From 300651b80a31450db659d74c6773b7b0a984b6fd Mon Sep 17 00:00:00 2001 From: Alexandre Rigaud Date: Fri, 2 Jun 2017 15:55:43 +0200 Subject: [PATCH] Update check-netapp-ng.pl Fixed issue #27 --- nagios/check-netapp-ng.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nagios/check-netapp-ng.pl b/nagios/check-netapp-ng.pl index f767c2d..65b19a2 100755 --- a/nagios/check-netapp-ng.pl +++ b/nagios/check-netapp-ng.pl @@ -46,6 +46,7 @@ use File::Basename; use Getopt::Long; use Time::Local; use IPC::Cmd qw(run_forked); +use Time::HiRes qw[ time alarm ]; Getopt::Long::Configure('bundling'); @@ -538,6 +539,7 @@ if (!defined($counterFilePath)) { # Starting Alarm +$SIG{ALRM} = sub {print "Script execution timeout\n"; exit 2}; alarm($TIMEOUT); # Establish SNMP Session