[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_ntp.pl,1.15,1.16

Karl DeBisschop kdebisschop at users.sourceforge.net
Fri Mar 14 05:45:11 CET 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv29049/plugins-scripts

Modified Files:
	check_ntp.pl 
Log Message:
add timeout, fix taint chacking diom

Index: check_ntp.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ntp.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** check_ntp.pl	5 Mar 2003 07:27:07 -0000	1.15
--- check_ntp.pl	14 Mar 2003 13:28:41 -0000	1.16
***************
*** 62,66 ****
  use strict;
  use Getopt::Long;
! use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $opt_j $opt_k $verbose $PROGNAME $def_jitter);
  use lib utils.pm; 
  use utils qw($TIMEOUT %ERRORS &print_revision &support);
--- 62,66 ----
  use strict;
  use Getopt::Long;
! use vars qw($opt_V $opt_h $opt_H $opt_t $opt_w $opt_c $opt_j $opt_k $verbose $PROGNAME $def_jitter);
  use lib utils.pm; 
  use utils qw($TIMEOUT %ERRORS &print_revision &support);
***************
*** 89,94 ****
  	 "w=f" => \$opt_w, "warning=f"  => \$opt_w,   # offset|adjust warning if above this number
  	 "c=f" => \$opt_c, "critical=f" => \$opt_c,   # offset|adjust critical if above this number
! 	 "j=s" => \$opt_j, "jwarn=s"    => \$opt_j,   # jitter warning if above this number
! 	 "k=s" => \$opt_k, "jcrit=s"    => \$opt_k,   # jitter critical if above this number
  	 "H=s" => \$opt_H, "hostname=s" => \$opt_H);
  
--- 89,95 ----
  	 "w=f" => \$opt_w, "warning=f"  => \$opt_w,   # offset|adjust warning if above this number
  	 "c=f" => \$opt_c, "critical=f" => \$opt_c,   # offset|adjust critical if above this number
! 	 "j=s" => \$opt_j, "jwarn=i"    => \$opt_j,   # jitter warning if above this number
! 	 "k=s" => \$opt_k, "jcrit=i"    => \$opt_k,   # jitter critical if above this number
! 	 "t=s" => \$opt_t, "timeout=i"  => \$opt_t,
  	 "H=s" => \$opt_H, "hostname=s" => \$opt_H);
  
***************
*** 116,130 ****
  }
  
! ($opt_w) || ($opt_w = $DEFAULT_OFFSET_WARN);
! my $owarn = $1 if ($opt_w =~ /([0-9.]+)/);
  
! ($opt_c) || ($opt_c = $DEFAULT_OFFSET_CRIT);
! my $ocrit = $1 if ($opt_c =~ /([0-9.]+)/);
  
! ($opt_j) || ($opt_j = $DEFAULT_JITTER_WARN);
! my $jwarn = $1 if ($opt_j =~ /([0-9]+)/);
  
! ($opt_k) || ($opt_k = $DEFAULT_JITTER_CRIT);
! my $jcrit = $1 if ($opt_k =~ /([0-9]+)/);
  
  if ($ocrit < $owarn ) {
--- 117,136 ----
  }
  
! my ($timeout, $owarn, $ocrit, $jwarn, $jcrit);
  
! $timeout = $TIMEOUT;
! ($opt_t) && ($opt_t =~ /^([0-9]+)$/) && ($timeout = $1);
  
! $owarn = $DEFAULT_OFFSET_WARN;
! ($opt_w) && ($opt_w =~ /^([0-9.]+)$/) && ($owarn = $1);
  
! $ocrit = $DEFAULT_OFFSET_CRIT;
! ($opt_c) && ($opt_c =~ /^([0-9.]+)$/) && ($ocrit = $1);
! 
! $jwarn = $DEFAULT_JITTER_WARN;
! ($opt_j) && ($opt_j =~ /^([0-9]+)$/) && ($jwarn = $1);
! 
! $jcrit = $DEFAULT_JITTER_CRIT;
! ($opt_k) && ($opt_k =~ /^([0-9]+)$/) && ($jcrit = $1);
  
  if ($ocrit < $owarn ) {
***************
*** 166,170 ****
  	exit $ERRORS{"UNKNOWN"};
  };
! alarm($TIMEOUT);
  
  
--- 172,176 ----
  	exit $ERRORS{"UNKNOWN"};
  };
! alarm($timeout);
  
  





More information about the Commits mailing list