6 use vars
qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
8 use utils qw(%ERRORS &print_revision &support &usage);
10 $PROGNAME = "check_breeze";
19 Getopt::Long::Configure('bundling');
21 ("V" => \$opt_V, "version" => \$opt_V,
22 "h" => \$opt_h, "help" => \$opt_h,
23 "w=s" => \$opt_w, "warning=s" => \$opt_w,
24 "c=s" => \$opt_c, "critical=s" => \$opt_c,
25 "H=s" => \$opt_H, "hostname=s" => \$opt_H,
26 "C=s" => \$opt_C, "community=s" => \$opt_C);
29 print_revision($PROGNAME,'$Revision$');
33 if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
35 ($opt_H) || usage("Host name/address not specified\n");
36 my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
37 ($host) || usage("Invalid host: $opt_H\n");
39 ($opt_w) || usage("Warning threshold not specified\n");
40 my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
41 ($warning) || usage("Invalid warning threshold: $opt_w\n");
43 ($opt_c) || usage("Critical threshold not specified\n");
44 my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
45 ($critical) || usage("Invalid critical threshold: $opt_c\n");
47 ($opt_C) || ($opt_C = "public") ;
50 $sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
51 my @test=split(/ /,$sig);
54 if ($sig>100){$sig=100}
56 print "Signal Strength at: $sig%\n";
58 exit $ERRORS{'CRITICAL'} if ($sig<$critical);
59 exit $ERRORS{'WARNING'} if ($sig<$warning);
64 print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
68 print_revision($PROGNAME,'$Revision$');
69 print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop
71 This plugin reports the signal strength of a Breezecom wireless equipment
77 Name or IP address of host to check
78 -C, --community=community
79 SNMPv1 community (default public)
81 Percentage strength below which a WARNING status will result
82 -c, --critical=INTEGER
83 Percentage strength below which a CRITICAL status will result