summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhendu Ghosh <sghosh@users.sourceforge.net>2002-05-02 16:43:29 (GMT)
committerSubhendu Ghosh <sghosh@users.sourceforge.net>2002-05-02 16:43:29 (GMT)
commitbecc0f34e60500798bd15bf5af6e4b8c52707d0a (patch)
treec117e73085955568f57d4eb89f41640297796977
parentbbcaeb1db1666c606a3578d3d24f1618f8c9947c (diff)
downloadmonitoring-plugins-becc0f34e60500798bd15bf5af6e4b8c52707d0a.tar.gz
fix for embedded perl
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@21 f882894a-f735-0410-b71e-b25c423dba1c
-rwxr-xr-xplugins-scripts/check_breeze.pl26
-rwxr-xr-xplugins-scripts/check_disk_smb.pl14
-rwxr-xr-xplugins-scripts/check_flexlm.pl10
-rwxr-xr-xplugins-scripts/check_ircd.pl12
-rwxr-xr-xplugins-scripts/check_netdns.pl13
-rwxr-xr-xplugins-scripts/check_ntp.pl14
-rwxr-xr-xplugins-scripts/check_rpc.pl10
-rwxr-xr-xplugins-scripts/check_wave.pl10
8 files changed, 47 insertions, 62 deletions
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl
index 79e36be..bd73f42 100755
--- a/plugins-scripts/check_breeze.pl
+++ b/plugins-scripts/check_breeze.pl
@@ -1,16 +1,11 @@
1#! /usr/bin/perl -wT 1#! /usr/bin/perl -wT
2 2
3BEGIN {
4 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
5 $runtimedir = $1;
6 $PROGNAME = $2;
7 }
8}
9 3
10use strict; 4use strict;
11use Getopt::Long; 5use Getopt::Long;
12use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $PROGNAME); 6use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $PROGNAME);
13use lib $main::runtimedir; 7use FindBin;
8use lib "$FindBin::Bin" ;
14use utils qw(%ERRORS &print_revision &support &usage); 9use utils qw(%ERRORS &print_revision &support &usage);
15 10
16sub print_help (); 11sub print_help ();
@@ -26,7 +21,8 @@ GetOptions
26 "h" => \$opt_h, "help" => \$opt_h, 21 "h" => \$opt_h, "help" => \$opt_h,
27 "w=s" => \$opt_w, "warning=s" => \$opt_w, 22 "w=s" => \$opt_w, "warning=s" => \$opt_w,
28 "c=s" => \$opt_c, "critical=s" => \$opt_c, 23 "c=s" => \$opt_c, "critical=s" => \$opt_c,
29 "H=s" => \$opt_H, "hostname=s" => \$opt_H); 24 "H=s" => \$opt_H, "hostname=s" => \$opt_H,
25 "C=s" => \$opt_C, "community=s" => \$opt_C);
30 26
31if ($opt_V) { 27if ($opt_V) {
32 print_revision($PROGNAME,'$Revision$'); 28 print_revision($PROGNAME,'$Revision$');
@@ -35,20 +31,22 @@ if ($opt_V) {
35 31
36if ($opt_h) {print_help(); exit $ERRORS{'OK'};} 32if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
37 33
38($opt_H) || ($opt_H = shift) || usage("Host name/address not specified\n"); 34($opt_H) || usage("Host name/address not specified\n");
39my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); 35my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
40($host) || usage("Invalid host: $opt_H\n"); 36($host) || usage("Invalid host: $opt_H\n");
41 37
42($opt_w) || ($opt_w = shift) || usage("Warning threshold not specified\n"); 38($opt_w) || usage("Warning threshold not specified\n");
43my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/); 39my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
44($warning) || usage("Invalid warning threshold: $opt_w\n"); 40($warning) || usage("Invalid warning threshold: $opt_w\n");
45 41
46($opt_c) || ($opt_c = shift) || usage("Critical threshold not specified\n"); 42($opt_c) || usage("Critical threshold not specified\n");
47my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/); 43my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
48($critical) || usage("Invalid critical threshold: $opt_c\n"); 44($critical) || usage("Invalid critical threshold: $opt_c\n");
49 45
46($opt_C) || ($opt_C = "public") ;
47
50my $sig=0; 48my $sig=0;
51$sig = `/usr/bin/snmpget $host public .1.3.6.1.4.1.710.3.2.3.1.3.0`; 49$sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
52my @test=split(/ /,$sig); 50my @test=split(/ /,$sig);
53$sig=$test[2]; 51$sig=$test[2];
54$sig=int($sig); 52$sig=int($sig);
@@ -62,7 +60,7 @@ exit $ERRORS{'OK'};
62 60
63 61
64sub print_usage () { 62sub print_usage () {
65 print "Usage: $PROGNAME -H <host> -w <warn> -c <crit>\n"; 63 print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
66} 64}
67 65
68sub print_help () { 66sub print_help () {
@@ -76,6 +74,8 @@ This plugin reports the signal strength of a Breezecom wireless equipment
76 print " 74 print "
77-H, --hostname=HOST 75-H, --hostname=HOST
78 Name or IP address of host to check 76 Name or IP address of host to check
77-C, --community=community
78 SNMPv1 community (default public)
79-w, --warning=INTEGER 79-w, --warning=INTEGER
80 Percentage strength below which a WARNING status will result 80 Percentage strength below which a WARNING status will result
81-c, --critical=INTEGER 81-c, --critical=INTEGER
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index d1b0b3d..9a66ed5 100755
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -14,13 +14,10 @@
14# Modified [warn] and [critical] parameters to accept format of nnn[M|G] to 14# Modified [warn] and [critical] parameters to accept format of nnn[M|G] to
15# allow setting of limits in MBytes or GBytes. Percentage settings for large 15# allow setting of limits in MBytes or GBytes. Percentage settings for large
16# drives is a pain in the butt 16# drives is a pain in the butt
17 17# 2-May-2002 - SGhosh fix for embedded perl
18BEGIN { 18#
19 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) { 19# $Id$
20 $runtimedir = $1; 20#
21 $PROGNAME = $2;
22 }
23}
24 21
25require 5.004; 22require 5.004;
26use POSIX; 23use POSIX;
@@ -28,7 +25,8 @@ use strict;
28use Getopt::Long; 25use Getopt::Long;
29use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose); 26use vars qw($opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose);
30use vars qw($PROGNAME); 27use vars qw($PROGNAME);
31use lib $main::runtimedir; 28use FindBin;
29use lib "$FindBin::Bin";
32use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 30use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
33 31
34sub print_help (); 32sub print_help ();
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl
index 1d26b7c..595a0b3 100755
--- a/plugins-scripts/check_flexlm.pl
+++ b/plugins-scripts/check_flexlm.pl
@@ -26,19 +26,15 @@
26# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com 26# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com
27# 27#
28# License: GPL 28# License: GPL
29# $Id$
29# 30#
30 31
31BEGIN {
32 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
33 $runtimedir = $1;
34 $PROGNAME = $2;
35 }
36}
37 32
38use strict; 33use strict;
39use Getopt::Long; 34use Getopt::Long;
40use vars qw($opt_V $opt_h $opt_F $verbose $PROGNAME); 35use vars qw($opt_V $opt_h $opt_F $verbose $PROGNAME);
41use lib $main::runtimedir; 36use FindBin ;
37use lib "$FindBin::Bin";
42use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 38use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
43 39
44sub print_help (); 40sub print_help ();
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index e4c4bd0..098a8e7 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -38,15 +38,8 @@
38# with perl -wT and 'use strict' 38# with perl -wT and 'use strict'
39# 39#
40# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com) 40# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com)
41# 2002/05/02 SG Fixed for Embedded Perl
41# 42#
42# ------------------------------------------------------------------[ Begin ]--
43
44BEGIN {
45 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
46 $runtimedir = $1;
47 $PROGNAME = $2;
48 }
49}
50 43
51# ----------------------------------------------------------------[ Require ]-- 44# ----------------------------------------------------------------[ Require ]--
52 45
@@ -59,7 +52,8 @@ use strict;
59use Getopt::Long; 52use Getopt::Long;
60use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose); 53use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
61use vars qw($PROGNAME); 54use vars qw($PROGNAME);
62use lib $main::runtimedir; 55use FindBin;
56use lib "$FindBin::Bin";
63use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 57use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
64 58
65# ----------------------------------------------------[ Function Prototypes ]-- 59# ----------------------------------------------------[ Function Prototypes ]--
diff --git a/plugins-scripts/check_netdns.pl b/plugins-scripts/check_netdns.pl
index 4bf7bd7..65ad7be 100755
--- a/plugins-scripts/check_netdns.pl
+++ b/plugins-scripts/check_netdns.pl
@@ -6,8 +6,11 @@
6# Copyright 2000, virCIO, LLP 6# Copyright 2000, virCIO, LLP
7# 7#
8# $Log$ 8# $Log$
9# Revision 1.1 2002/02/28 06:43:00 egalstad 9# Revision 1.2 2002/05/02 16:43:29 sghosh
10# Initial revision 10# fix for embedded perl
11#
12# Revision 1.1.1.1 2002/02/28 06:43:00 egalstad
13# Initial import of existing plugin code
11# 14#
12# Revision 1.1 2000/08/03 20:41:12 karldebisschop 15# Revision 1.1 2000/08/03 20:41:12 karldebisschop
13# rename to avoid conflict when installing 16# rename to avoid conflict when installing
@@ -18,11 +21,15 @@
18# Revision 1.1 2000/07/20 19:09:13 cwg 21# Revision 1.1 2000/07/20 19:09:13 cwg
19# All the pieces needed to use my version of check_dns. 22# All the pieces needed to use my version of check_dns.
20# 23#
24#
21 25
22use Getopt::Long; 26use Getopt::Long;
23use Net::DNS; 27use Net::DNS;
28use Findbin;
29use lib "$FindBin::Bin";
30use utils ;
24 31
25 Getopt::Long::Configure(`bundling`); 32Getopt::Long::Configure(`bundling`);
26GetOptions("V" => $opt_V, "version" => $opt_V, 33GetOptions("V" => $opt_V, "version" => $opt_V,
27 "h" => $opt_h, "help" => $opt_h, 34 "h" => $opt_h, "help" => $opt_h,
28 "t=i" => $opt_t, "timeout=i" => $opt_t, 35 "t=i" => $opt_t, "timeout=i" => $opt_t,
diff --git a/plugins-scripts/check_ntp.pl b/plugins-scripts/check_ntp.pl
index f3f6f78..918ad50 100755
--- a/plugins-scripts/check_ntp.pl
+++ b/plugins-scripts/check_ntp.pl
@@ -7,6 +7,8 @@
7# be installed on the system, however since it's part of the ntp suite, you 7# be installed on the system, however since it's part of the ntp suite, you
8# should already have it installed. 8# should already have it installed.
9# 9#
10# $Id$
11#
10# Nothing clever done in this program - its a very simple bare basics hack to 12# Nothing clever done in this program - its a very simple bare basics hack to
11# get the job done. 13# get the job done.
12# 14#
@@ -45,19 +47,17 @@
45# source. This happens while starting up and if contact 47# source. This happens while starting up and if contact
46# with master has been lost. 48# with master has been lost.
47# 49#
48BEGIN { 50# Modifed to run under Embedded Perl - patch from Douglas Warner
49 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) { 51#
50 $runtimedir = $1; 52
51 $PROGNAME = $2;
52 }
53}
54 53
55require 5.004; 54require 5.004;
56use POSIX; 55use POSIX;
57use strict; 56use strict;
58use Getopt::Long; 57use Getopt::Long;
59use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $verbose $PROGNAME); 58use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $verbose $PROGNAME);
60use lib $main::runtimedir; 59use FindBin;
60use lib "$FindBin::Bin";
61use utils qw($TIMEOUT %ERRORS &print_revision &support); 61use utils qw($TIMEOUT %ERRORS &print_revision &support);
62 62
63sub print_help (); 63sub print_help ();
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl
index 51901ac..2e25f41 100755
--- a/plugins-scripts/check_rpc.pl
+++ b/plugins-scripts/check_rpc.pl
@@ -18,15 +18,11 @@
18# 18#
19# Copyright Notice: GPL 19# Copyright Notice: GPL
20# 20#
21BEGIN { 21
22 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
23 $runtimedir = $1;
24 $PROGNAME = $2;
25 }
26}
27 22
28use strict; 23use strict;
29use lib $main::runtimedir; 24use FindBin;
25use lib "$FindBin::Bin";
30use utils qw($TIMEOUT %ERRORS &print_revision &support); 26use utils qw($TIMEOUT %ERRORS &print_revision &support);
31use vars qw($PROGNAME); 27use vars qw($PROGNAME);
32my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd); 28my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd);
diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl
index c6e6c66..6d58e4f 100755
--- a/plugins-scripts/check_wave.pl
+++ b/plugins-scripts/check_wave.pl
@@ -3,15 +3,9 @@
3# $Id$ 3# $Id$
4 4
5 5
6BEGIN {
7 if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
8 $runtimedir = $1;
9 $PROGNAME = $2;
10 }
11}
12
13use strict; 6use strict;
14use lib $main::runtimedir; 7use FindBin;
8use lib "$Findbin::Bin";
15use utils qw($TIMEOUT %ERRORS &print_revision &support); 9use utils qw($TIMEOUT %ERRORS &print_revision &support);
16use vars qw($PROGNAME); 10use vars qw($PROGNAME);
17use Getopt::Long; 11use Getopt::Long;