6 use vars
qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
8 use lib "$FindBin::Bin";
9 use utils qw(%ERRORS &print_revision &support &usage);
11 $PROGNAME = "check_breeze";
16 $ENV{'PATH'}='@TRUSTED_PATH@';
20 Getopt::Long::Configure('bundling');
22 ("V" => \$opt_V, "version" => \$opt_V,
23 "h" => \$opt_h, "help" => \$opt_h,
24 "w=s" => \$opt_w, "warning=s" => \$opt_w,
25 "c=s" => \$opt_c, "critical=s" => \$opt_c,
26 "H=s" => \$opt_H, "hostname=s" => \$opt_H,
27 "C=s" => \$opt_C, "community=s" => \$opt_C);
30 print_revision($PROGNAME,'@NP_VERSION@');
31 exit $ERRORS{'UNKNOWN'};
34 if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
36 ($opt_H) || usage("Host name/address not specified\n");
37 my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
38 ($host) || usage("Invalid host: $opt_H\n");
40 ($opt_w) || usage("Warning threshold not specified\n");
41 my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
42 ($warning) || usage("Invalid warning threshold: $opt_w\n");
44 ($opt_c) || usage("Critical threshold not specified\n");
45 my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
46 ($critical) || usage("Invalid critical threshold: $opt_c\n");
48 ($opt_C) || ($opt_C = "public") ;
51 $sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
52 my @test=split(/ /,$sig);
55 if ($sig>100){$sig=100}
57 print "Signal Strength at: $sig%\n";
59 exit $ERRORS{'CRITICAL'} if ($sig<$critical);
60 exit $ERRORS{'WARNING'} if ($sig<$warning);
65 print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
69 print_revision($PROGNAME,'@NP_VERSION@');
70 print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop
72 This plugin reports the signal strength of a Breezecom wireless equipment
78 Name or IP address of host to check
79 -C, --community=community
80 SNMPv1 community (default public)
82 Percentage strength below which a WARNING status will result
83 -c, --critical=INTEGER
84 Percentage strength below which a CRITICAL status will result