From: Xueshan Feng Date: Fri, 22 Sep 2006 05:03:33 +0000 (+0000) Subject: fix gloabl variable problem X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=338c08472a5c03195aab335ab4f0a57c6ae77e7c;p=packages%2Fa%2Fafs-monitor.git fix gloabl variable problem --- diff --git a/check_afsspace b/check_afsspace index b0eacd8..0e9fbce 100755 --- a/check_afsspace +++ b/check_afsspace @@ -15,6 +15,16 @@ # percentage and with status 2 if the free space is above a critical # percentage (this works with the Nagios check architecture). +############################################################################## +# Modules and declarations +############################################################################## + +require 5.003; + +use strict; +use vars qw($CRITICAL $ID $TIMEOUT $VOS $WARNINGS); + +use Getopt::Long qw(GetOptions); ############################################################################## # Site configuration ############################################################################## @@ -32,16 +42,6 @@ $TIMEOUT = 300; ($VOS) = grep { -x $_ } qw(/usr/bin/vos /usr/local/bin/vos); $VOS ||= '/usr/bin/vos'; -############################################################################## -# Modules and declarations -############################################################################## - -require 5.003; - -use strict; -use vars qw($CRITICAL $ID $TIMEOUT $VOS $WARNINGS); - -use Getopt::Long qw(GetOptions); ############################################################################## # Implementation diff --git a/check_bos b/check_bos index 7635e51..428cd1b 100755 --- a/check_bos +++ b/check_bos @@ -16,6 +16,16 @@ # true, print that information to STDOUT. Suitable for being run inside # Nagios. +############################################################################## +# Modules and declarations +############################################################################## + +require 5.005; + +use strict; +use vars qw($BOS $ID @OKAY $TIMEOUT); + +use Getopt::Long qw(GetOptions); ############################################################################## # Site configuration ############################################################################## @@ -43,16 +53,6 @@ $TIMEOUT = 10; qr/^\s*Command \d+ is / ); -############################################################################## -# Modules and declarations -############################################################################## - -require 5.005; - -use strict; -use vars qw($BOS $ID @OKAY $TIMEOUT); - -use Getopt::Long qw(GetOptions); ############################################################################## # Implementation diff --git a/check_rxdebug b/check_rxdebug index d2d34ca..d09b4b2 100755 --- a/check_rxdebug +++ b/check_rxdebug @@ -16,6 +16,16 @@ # warning) and with status 2 if there are more than eight connections in that # state. The thresholds can be overridden from the command line. +############################################################################## +# Modules and declarations +############################################################################## + +require 5.003; + +use strict; +use vars qw($CRITICAL $ID $RXDEBUG $TIMEOUT $WARNINGS); + +use Getopt::Long qw(GetOptions); ############################################################################## # Site configuration ############################################################################## @@ -33,16 +43,6 @@ $TIMEOUT = 60; ($RXDEBUG) = grep { -x $_ } qw(/usr/bin/rxdebug /usr/local/bin/rxdebug); $RXDEBUG ||= '/usr/bin/rxdebug'; -############################################################################## -# Modules and declarations -############################################################################## - -require 5.003; - -use strict; -use vars qw($CRITICAL $ID $RXDEBUG $TIMEOUT $WARNINGS); - -use Getopt::Long qw(GetOptions); ############################################################################## # Implementation diff --git a/check_udebug b/check_udebug index 45cadd4..e3d0d30 100755 --- a/check_udebug +++ b/check_udebug @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -$ID = q$Id$; +# $ID = q$Id$; # # check_udebug -- Check AFS database servers using udebug for Nagios. # @@ -14,6 +14,17 @@ $ID = q$Id$; # site (ensuring that it considers all of the other servers up-to-date) or if # any of the servers don't believe there is a sync site. +############################################################################## +# Modules and declarations +############################################################################## + +require 5.003; + +use strict; +use vars qw($ID $TIMEOUT $UDEBUG); + +use Getopt::Long qw(GetOptions); + ############################################################################## # Site configuration ############################################################################## @@ -26,16 +37,6 @@ $TIMEOUT = 10; ($UDEBUG) = grep { -x $_ } qw(/usr/bin/udebug /usr/local/bin/udebug); $UDEBUG ||= '/usr/bin/udebug'; -############################################################################## -# Modules and declarations -############################################################################## - -require 5.003; - -use strict; -use vars qw($ID $TIMEOUT $UDEBUG); - -use Getopt::Long qw(GetOptions); ############################################################################## # Implementation