[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_breeze.pl,1.1.1.1,1.2 check_disk_smb.pl,1.1.1.1,1.2 check_flexlm.pl,1.1.1.1,1.2 check_ircd.pl,1.1.1.1,1.2 check_netdns.pl,1.1.1.1,1.2 check_ntp.pl,1.1.1.1,1.2 check_rpc.pl,1.1.1.1,1.2 check_wave.pl,1.1.1.1,1.2
Subhendu Ghosh
sghosh at users.sourceforge.net
Thu May 2 09:44:27 CEST 2002
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory usw-pr-cvs1:/tmp/cvs-serv14349
Modified Files:
check_breeze.pl check_disk_smb.pl check_flexlm.pl
check_ircd.pl check_netdns.pl check_ntp.pl check_rpc.pl
check_wave.pl
Log Message:
fix for embedded perl
Index: check_breeze.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_breeze.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_breeze.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_breeze.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 1,15 ****
#! /usr/bin/perl -wT
- BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
- }
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $PROGNAME);
! use lib $main::runtimedir;
use utils qw(%ERRORS &print_revision &support &usage);
--- 1,10 ----
#! /usr/bin/perl -wT
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $PROGNAME);
! use FindBin;
! use lib "$FindBin::Bin" ;
use utils qw(%ERRORS &print_revision &support &usage);
***************
*** 27,31 ****
"w=s" => \$opt_w, "warning=s" => \$opt_w,
"c=s" => \$opt_c, "critical=s" => \$opt_c,
! "H=s" => \$opt_H, "hostname=s" => \$opt_H);
if ($opt_V) {
--- 22,27 ----
"w=s" => \$opt_w, "warning=s" => \$opt_w,
"c=s" => \$opt_c, "critical=s" => \$opt_c,
! "H=s" => \$opt_H, "hostname=s" => \$opt_H,
! "C=s" => \$opt_C, "community=s" => \$opt_C);
if ($opt_V) {
***************
*** 36,53 ****
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
! ($opt_H) || ($opt_H = shift) || usage("Host name/address not specified\n");
my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
($host) || usage("Invalid host: $opt_H\n");
! ($opt_w) || ($opt_w = shift) || usage("Warning threshold not specified\n");
my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
($warning) || usage("Invalid warning threshold: $opt_w\n");
! ($opt_c) || ($opt_c = shift) || usage("Critical threshold not specified\n");
my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
($critical) || usage("Invalid critical threshold: $opt_c\n");
my $sig=0;
! $sig = `/usr/bin/snmpget $host public .1.3.6.1.4.1.710.3.2.3.1.3.0`;
my @test=split(/ /,$sig);
$sig=$test[2];
--- 32,51 ----
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
! ($opt_H) || usage("Host name/address not specified\n");
my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
($host) || usage("Invalid host: $opt_H\n");
! ($opt_w) || usage("Warning threshold not specified\n");
my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
($warning) || usage("Invalid warning threshold: $opt_w\n");
! ($opt_c) || usage("Critical threshold not specified\n");
my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
($critical) || usage("Invalid critical threshold: $opt_c\n");
+ ($opt_C) || ($opt_C = "public") ;
+
my $sig=0;
! $sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
my @test=split(/ /,$sig);
$sig=$test[2];
***************
*** 63,67 ****
sub print_usage () {
! print "Usage: $PROGNAME -H <host> -w <warn> -c <crit>\n";
}
--- 61,65 ----
sub print_usage () {
! print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
}
***************
*** 77,80 ****
--- 75,80 ----
-H, --hostname=HOST
Name or IP address of host to check
+ -C, --community=community
+ SNMPv1 community (default public)
-w, --warning=INTEGER
Percentage strength below which a WARNING status will result
Index: check_disk_smb.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_disk_smb.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_disk_smb.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_disk_smb.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 15,25 ****
# allow setting of limits in MBytes or GBytes. Percentage settings for large
# drives is a pain in the butt
!
! BEGIN {
! if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
! $runtimedir = $1;
! $PROGNAME = $2;
! }
! }
require 5.004;
--- 15,22 ----
# allow setting of limits in MBytes or GBytes. Percentage settings for large
# drives is a pain in the butt
! # 2-May-2002 - SGhosh fix for embedded perl
! #
! # $Id$
! #
require 5.004;
***************
*** 29,33 ****
use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
--- 26,31 ----
use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
! use FindBin;
! use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
Index: check_flexlm.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_flexlm.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_flexlm.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_flexlm.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 27,43 ****
#
# License: GPL
#
- BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
- }
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_F $verbose $PROGNAME);
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
--- 27,39 ----
#
# License: GPL
+ # $Id$
#
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_F $verbose $PROGNAME);
! use FindBin ;
! use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
Index: check_ircd.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ircd.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_ircd.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_ircd.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 39,51 ****
#
# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com)
#
- # ------------------------------------------------------------------[ Begin ]--
-
- BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
- }
# ----------------------------------------------------------------[ Require ]--
--- 39,44 ----
#
# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com)
+ # 2002/05/02 SG Fixed for Embedded Perl
#
# ----------------------------------------------------------------[ Require ]--
***************
*** 60,64 ****
use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
--- 53,58 ----
use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
use vars qw($PROGNAME);
! use FindBin;
! use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
Index: check_netdns.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_netdns.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_netdns.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_netdns.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 7,10 ****
--- 7,13 ----
#
# $Log$
+ # Revision 1.2 2002/05/02 16:43:29 sghosh
+ # fix for embedded perl
+ #
# Revision 1.1.1.1 2002/02/28 06:43:00 egalstad
# Initial import of existing plugin code
***************
*** 19,27 ****
# All the pieces needed to use my version of check_dns.
#
use Getopt::Long;
use Net::DNS;
! Getopt::Long::Configure(`bundling`);
GetOptions("V" => $opt_V, "version" => $opt_V,
"h" => $opt_h, "help" => $opt_h,
--- 22,34 ----
# All the pieces needed to use my version of check_dns.
#
+ #
use Getopt::Long;
use Net::DNS;
+ use Findbin;
+ use lib "$FindBin::Bin";
+ use utils ;
! Getopt::Long::Configure(`bundling`);
GetOptions("V" => $opt_V, "version" => $opt_V,
"h" => $opt_h, "help" => $opt_h,
Index: check_ntp.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ntp.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_ntp.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_ntp.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 8,11 ****
--- 8,13 ----
# should already have it installed.
#
+ # $Id$
+ #
# Nothing clever done in this program - its a very simple bare basics hack to
# get the job done.
***************
*** 46,55 ****
# with master has been lost.
#
! BEGIN {
! if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
! $runtimedir = $1;
! $PROGNAME = $2;
! }
! }
require 5.004;
--- 48,54 ----
# with master has been lost.
#
! # Modifed to run under Embedded Perl - patch from Douglas Warner
! #
!
require 5.004;
***************
*** 58,62 ****
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $verbose $PROGNAME);
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support);
--- 57,62 ----
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $verbose $PROGNAME);
! use FindBin;
! use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
Index: check_rpc.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_rpc.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_rpc.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_rpc.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 19,31 ****
# Copyright Notice: GPL
#
! BEGIN {
! if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
! $runtimedir = $1;
! $PROGNAME = $2;
! }
! }
use strict;
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
--- 19,27 ----
# Copyright Notice: GPL
#
!
use strict;
! use FindBin;
! use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
Index: check_wave.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_wave.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_wave.pl 28 Feb 2002 06:43:00 -0000 1.1.1.1
--- check_wave.pl 2 May 2002 16:43:29 -0000 1.2
***************
*** 4,16 ****
- BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
- }
-
use strict;
! use lib $main::runtimedir;
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
--- 4,10 ----
use strict;
! use FindBin;
! use lib "$Findbin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
More information about the Commits
mailing list