summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbcaeb1)
raw | patch | inline | side by side (parent: bbcaeb1)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Thu, 2 May 2002 16:43:29 +0000 (16:43 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Thu, 2 May 2002 16:43:29 +0000 (16:43 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@21 f882894a-f735-0410-b71e-b25c423dba1c
index 79e36be76b6b5e4f0688f0e7a76f1c8c8d3032d4..bd73f42a554937fef4c3854f79c6c27a74df8d6d 100755 (executable)
#! /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 FindBin;
+use lib "$FindBin::Bin" ;
use utils qw(%ERRORS &print_revision &support &usage);
sub print_help ();
"h" => \$opt_h, "help" => \$opt_h,
"w=s" => \$opt_w, "warning=s" => \$opt_w,
"c=s" => \$opt_c, "critical=s" => \$opt_c,
- "H=s" => \$opt_H, "hostname=s" => \$opt_H);
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H,
+ "C=s" => \$opt_C, "community=s" => \$opt_C);
if ($opt_V) {
print_revision($PROGNAME,'$Revision$');
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
-($opt_H) || ($opt_H = shift) || usage("Host name/address not specified\n");
+($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) || ($opt_w = shift) || usage("Warning threshold not specified\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) || ($opt_c = shift) || usage("Critical threshold not specified\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 public .1.3.6.1.4.1.710.3.2.3.1.3.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];
$sig=int($sig);
sub print_usage () {
- print "Usage: $PROGNAME -H <host> -w <warn> -c <crit>\n";
+ print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
}
sub print_help () {
print "
-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
-c, --critical=INTEGER
index d1b0b3d63901f2025d76ce04866a73b2fa95a9c9..9a66ed5dd55b897d587a0d25a0ce636243844dd2 100755 (executable)
# Modified [warn] and [critical] parameters to accept format of nnn[M|G] to
# 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;
- }
-}
+# 2-May-2002 - SGhosh fix for embedded perl
+#
+# $Id$
+#
require 5.004;
use POSIX;
use Getopt::Long;
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 FindBin;
+use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
sub print_help ();
index 1d26b7c8938120ec0c2a07fd90bdc7320410fa93..595a0b341c94e609611d603077bf555583c1fbe0 100755 (executable)
# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com
#
# License: GPL
+# $Id$
#
-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 FindBin ;
+use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
sub print_help ();
index e4c4bd02686f53ec34d3fb619af0c30a3eca7e73..098a8e70adb0463623914bab34ea100ec1835766 100755 (executable)
# with perl -wT and 'use strict'
#
# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com)
+# 2002/05/02 SG Fixed for Embedded Perl
#
-# ------------------------------------------------------------------[ Begin ]--
-
-BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
-}
# ----------------------------------------------------------------[ Require ]--
use Getopt::Long;
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 FindBin;
+use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
# ----------------------------------------------------[ Function Prototypes ]--
index 4bf7bd769a923a0002e48e88f52d7b1b7b1780ab..65ad7beb1aa774d521e371a65fea44382c322a65 100755 (executable)
# Copyright 2000, virCIO, LLP
#
# $Log$
-# Revision 1.1 2002/02/28 06:43:00 egalstad
-# Initial revision
+# 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
#
# Revision 1.1 2000/08/03 20:41:12 karldebisschop
# rename to avoid conflict when installing
# Revision 1.1 2000/07/20 19:09:13 cwg
# 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`);
+Getopt::Long::Configure(`bundling`);
GetOptions("V" => $opt_V, "version" => $opt_V,
"h" => $opt_h, "help" => $opt_h,
"t=i" => $opt_t, "timeout=i" => $opt_t,
index f3f6f78bb9898863608960ed3ef960b9547a6470..918ad50422a81f16bfbf62a7a4595dc010941256 100755 (executable)
# be installed on the system, however since it's part of the ntp suite, you
# should already have it installed.
#
+# $Id$
+#
# Nothing clever done in this program - its a very simple bare basics hack to
# get the job done.
#
# source. This happens while starting up and if contact
# with master has been lost.
#
-BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
-}
+# Modifed to run under Embedded Perl - patch from Douglas Warner
+#
+
require 5.004;
use POSIX;
use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $verbose $PROGNAME);
-use lib $main::runtimedir;
+use FindBin;
+use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
sub print_help ();
index 51901ac00b0ee17396bd1bec75e7d60d8f64ba3b..2e25f4140bdd38029b2d76d8d178fbca92e74e9e 100755 (executable)
#
# Copyright Notice: GPL
#
-BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
-}
+
use strict;
-use lib $main::runtimedir;
+use FindBin;
+use lib "$FindBin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd);
index c6e6c6620e42538dcbaddc6bc8bda95f33b464f6..6d58e4f4f49edc1de1a06e17b400902a0a9eed07 100755 (executable)
# $Id$
-BEGIN {
- if ($0 =~ m/^(.*?)[\/\\]([^\/\\]+)$/) {
- $runtimedir = $1;
- $PROGNAME = $2;
- }
-}
-
use strict;
-use lib $main::runtimedir;
+use FindBin;
+use lib "$Findbin::Bin";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
use Getopt::Long;