summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/check_breeze.pl22
-rw-r--r--contrib/check_dhcp.c10
-rw-r--r--contrib/check_flexlm.pl82
-rw-r--r--contrib/check_hltherm.c209
-rwxr-xr-xcontrib/check_hprsc.pl215
-rw-r--r--contrib/check_ipxping.c5
-rw-r--r--contrib/check_mysql.c4
-rw-r--r--contrib/check_uptime.c8
-rw-r--r--contrib/check_wave.pl77
-rw-r--r--contrib/readme.txt115
-rw-r--r--contrib/tarballs/berger-ping.tar.gzbin2411 -> 2411 bytes
-rw-r--r--contrib/tarballs/bowen-langley_plugins.tar.gzbin28728 -> 28742 bytes
-rw-r--r--contrib/tarballs/check_bgp-1.0.tar.gzbin1444 -> 1469 bytes
-rw-r--r--contrib/tarballs/check_breeze.tar.gzbin358 -> 0 bytes
-rw-r--r--contrib/tarballs/check_flexlm.tar.gzbin1169 -> 0 bytes
-rw-r--r--contrib/tarballs/check_hltherm.tar.gzbin2087 -> 0 bytes
-rw-r--r--contrib/tarballs/check_hprsc.tar.gzbin1942 -> 0 bytes
-rw-r--r--contrib/tarballs/check_memory.tgz (renamed from contrib/check_memory.tgz)bin5813 -> 5813 bytes
-rw-r--r--contrib/tarballs/check_radius.tar.gzbin25173 -> 25190 bytes
-rw-r--r--contrib/tarballs/check_wave.tar.gzbin591 -> 0 bytes
-rw-r--r--contrib/tarballs/hopcroft-plugins.tar.gzbin3657 -> 3657 bytes
-rw-r--r--contrib/tarballs/radius.tar.gzbin1913 -> 1913 bytes
22 files changed, 633 insertions, 114 deletions
diff --git a/contrib/check_breeze.pl b/contrib/check_breeze.pl
new file mode 100644
index 0000000..bb83765
--- /dev/null
+++ b/contrib/check_breeze.pl
@@ -0,0 +1,22 @@
1#!/usr/bin/perl
2
3# Plugin to test signal strength on Breezecom wireless equipment
4# Contributed by Jeffrey Blank
5
6$Host=$ARGV[0];
7$sig_crit=$ARGV[1];
8$sig_warn=$ARGV[2];
9$sig=0;
10$sig = `snmpget $Host public .1.3.6.1.4.1.710.3.2.3.1.3.0`;
11@test=split(/ /,$sig);
12$sig=@test[2];
13$sig=int($sig);
14if ($sig>100){$sig=100}
15
16print "Signal Strength at: $sig%\n";
17if ($sig<$sig_crit)
18 {exit(2)}
19if ($sig<$sig_warn)
20 {exit(1)}
21
22exit(0);
diff --git a/contrib/check_dhcp.c b/contrib/check_dhcp.c
index 8168b94..6a6037f 100644
--- a/contrib/check_dhcp.c
+++ b/contrib/check_dhcp.c
@@ -4,7 +4,7 @@
4* 4*
5* Program: DHCP plugin for Nagios 5* Program: DHCP plugin for Nagios
6* License: GPL 6* License: GPL
7* Copyright (c) 2001 Ethan Galstad (nagios@nagios.org) 7* Copyright (c) 2001-2002 Ethan Galstad (nagios@nagios.org)
8* 8*
9* License Information: 9* License Information:
10* 10*
@@ -437,7 +437,7 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in
437 struct sockaddr_in myname; 437 struct sockaddr_in myname;
438 int result; 438 int result;
439 439
440 result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr_in *)dest,sizeof(*dest)); 440 result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest));
441 441
442#ifdef DEBUG 442#ifdef DEBUG
443 printf("send_dhcp_packet result: %d\n",result); 443 printf("send_dhcp_packet result: %d\n",result);
@@ -480,11 +480,11 @@ int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, st
480 /* why do we need to peek first? i don't know, its a hack. without it, the source address of the first packet received was 480 /* why do we need to peek first? i don't know, its a hack. without it, the source address of the first packet received was
481 not being interpreted correctly. sigh... */ 481 not being interpreted correctly. sigh... */
482 bzero(&source_address,sizeof(source_address)); 482 bzero(&source_address,sizeof(source_address));
483 recv_result=recvfrom(sock,(char *)buffer,buffer_size,MSG_PEEK,(struct sockaddr_in *)&source_address,&address_size); 483 recv_result=recvfrom(sock,(char *)buffer,buffer_size,MSG_PEEK,(struct sockaddr *)&source_address,&address_size);
484#ifdef DEBUG 484#ifdef DEBUG
485 printf("recv_result_1: %d\n",recv_result); 485 printf("recv_result_1: %d\n",recv_result);
486#endif 486#endif
487 recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr_in *)&source_address,&address_size); 487 recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)&source_address,&address_size);
488#ifdef DEBUG 488#ifdef DEBUG
489 printf("recv_result_2: %d\n",recv_result); 489 printf("recv_result_2: %d\n",recv_result);
490#endif 490#endif
@@ -812,7 +812,7 @@ void print_help(void){
812 812
813 /*print_revision(PROGNAME,"$Revision$");*/ 813 /*print_revision(PROGNAME,"$Revision$");*/
814 814
815 printf("Copyright (c) 2001 Ethan Galstad (nagios@nagios.org)\n\n"); 815 printf("Copyright (c) 2001-2002 Ethan Galstad (nagios@nagios.org)\n\n");
816 printf("This plugin tests the availability of DHCP servers on a network.\n\n"); 816 printf("This plugin tests the availability of DHCP servers on a network.\n\n");
817 817
818 print_usage(); 818 print_usage();
diff --git a/contrib/check_flexlm.pl b/contrib/check_flexlm.pl
new file mode 100644
index 0000000..8fa0e33
--- /dev/null
+++ b/contrib/check_flexlm.pl
@@ -0,0 +1,82 @@
1#!/usr/local/bin/perl
2#
3# usage:
4# check_flexlm.pl license_file
5#
6# Check available flexlm license managers.
7# Use lmstat to check the status of the license server
8# described by the license file given as argument.
9# Check and interpret the output of lmstat
10# and create returncodes and output.
11#
12# Contrary to the nagios concept, this script takes
13# a file, not a hostname as an argument and returns
14# the status of hosts and services described in that
15# file. Use these hosts.cfg entries as an example
16#
17#host[anchor]=any host will do;some.address.com;;check-host-alive;3;120;24x7;1;1;1;
18#service[anchor]=yodel;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yodel_lic
19#service[anchor]=yeehaw;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yeehaw_lic
20#command[check_flexlm]=/some/path/libexec/check_flexlm.pl $ARG1$
21#
22# Notes:
23# - you need the lmstat utility which comes with flexlm.
24# - set the correct path in the variable $lmstat.
25#
26# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com
27# current status: looks like working
28#
29# Copyright Notice: Do as you please, credit me, but don't blame me
30#
31
32# Just in case of problems, let's not hang Nagios
33$SIG{'ALRM'} = sub {
34 print "No Answer from Client\n";
35 exit 2;
36};
37alarm(20);
38
39$lmstat = "/opt/lic/sw/cadadm/default/bin/lmstat";
40
41$licfile = shift;
42
43#print "$licfile \n";
44
45open CMD,"$lmstat -c $licfile |";
46
47$serverup = 0;
48
49while ( <CMD> ) {
50 if ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*)/ ) {
51 $ls1 = $1;
52 $ls2 = $2;
53 $ls3 = $3;
54 $lf1 = $lf2 = $lf3 = 0;
55 $servers = 3;
56 } elsif ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*)/ ) {
57 $ls1 = $1;
58 $ls2 = $ls3 = "";
59 $lf1 = $lf2 = $lf3 = 0;
60 $servers = 1;
61 } elsif ( / *$ls1: license server UP/ ) {
62 print "$ls1 UP, ";
63 $lf1 = 1
64 } elsif ( / *$ls2: license server UP/ ) {
65 print "$ls2 UP, ";
66 $lf2 = 1
67 } elsif ( / *$ls3: license server UP/ ) {
68 print "$ls3 UP, ";
69 $lf3 = 1
70 } elsif ( / *([^:]*: UP .*)/ ) {
71 print " license server for $1\n";
72 $serverup = 1;
73 }
74}
75if ( $serverup == 0 ) {
76 print " license server not running\n";
77 exit 2;
78}
79
80exit 0 if ( $servers == $lf1 + $lf2 + $lf3 );
81exit 1 if ( $servers == 3 && $lf1 + $lf2 + $lf3 == 2 );
82exit 2;
diff --git a/contrib/check_hltherm.c b/contrib/check_hltherm.c
new file mode 100644
index 0000000..85c989f
--- /dev/null
+++ b/contrib/check_hltherm.c
@@ -0,0 +1,209 @@
1/******************************************************************************************
2 *
3 * CHECK_HLTHERM.C
4 *
5 * Program: Hot Little Therm temperature plugin for Nagios
6 * License: GPL
7 * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)
8 *
9 * Last Modified: 02-28-2002
10 *
11 * Command line: check_hltherm <probe> <wtemp> <ctemp> [-l label] [-s scale] [-lower]
12 *
13 * Description:
14 *
15 * This plugin checks the temperature of a given temperature probe on a
16 * Hot Little Therm digital thermometer. The plugin uses the 'therm' utility
17 * that is included with the HLT software to check the probe temperature. Both
18 * the HLT digital thermometer and software are produced by Spiderplant. See
19 * their website at http://www.spiderplant.com/hlt for more information.
20 *
21 *****************************************************************************************/
22
23#include "config.h"
24#include "common.h"
25#include "popen.h"
26
27#define DEFAULT_TIMEOUT 10 /* default timeout in seconds */
28
29#define HLTHERM_COMMAND "/usr/local/bin/therm" /* this should be moved out to the configure script */
30
31
32static void timeout_alarm_handler(int); /* author must provide */
33int process_arguments(int, char **);
34
35int timeout_interval=DEFAULT_TIMEOUT;
36
37double wtemp=0.0L;
38double ctemp=0.0L;
39
40int check_lower_temps=FALSE;
41
42char probe[MAX_INPUT_BUFFER]="";
43char label[MAX_INPUT_BUFFER]="Temperature";
44char scale[MAX_INPUT_BUFFER]="Degrees";
45
46FILE *fp;
47
48
49int main(int argc, char **argv){
50 int result=STATE_OK;
51 char command[MAX_INPUT_BUFFER];
52 double temp=0.0L;
53 char input_buffer[MAX_INPUT_BUFFER];
54 int found=0;
55
56 /* process command line arguments */
57 result=process_arguments(argc,argv);
58
59 /* display usage if there was a problem */
60 if(result==ERROR){
61 printf("Incorrect arguments supplied\n");
62 printf("\n");
63 printf("Hot Little Therm temperature plugin for Nagios\n");
64 printf("Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)\n");
65 printf("Last Modified: 02-28-2002\n");
66 printf("License: GPL\n");
67 printf("\n");
68 printf("Usage: %s <probe> <wtemp> <ctemp> [-l label] [-s scale] [-lower]\n",argv[0]);
69 printf("\n");
70 printf("Options:\n");
71 printf(" <wtemp> = Temperature necessary to result in a WARNING state\n");
72 printf(" <ctemp> = Temperature necessary to result in a CRITICAL state\n");
73 printf(" [label] = A descriptive label for the probe. Example: \"Outside Temp\"\n");
74 printf(" [scale] = A descriptive label for the temperature scale. Example: \"Celsius\"\n");
75 printf(" [-lower] = Evaluate temperatures with lower values being more critical\n");
76 printf("\n");
77 printf("This plugin checks the temperature of a given temperature probe on a\n");
78 printf("Hot Little Therm digital thermometer. The plugin uses the 'therm' utility\n");
79 printf("included with the HLT software to check the probe temperature. Both the\n");
80 printf("HLT digital thermometer and software are produced by Spiderplant. See\n");
81 printf("their website at http://www.spiderplant.com/hlt for more information.\n");
82 printf("\n");
83 return STATE_UNKNOWN;
84 }
85
86
87 result=STATE_OK;
88
89 /* Set signal handling and alarm */
90 if(signal(SIGALRM,timeout_alarm_handler)==SIG_ERR){
91 printf("Cannot catch SIGALRM");
92 return STATE_UNKNOWN;
93 }
94
95 /* handle timeouts gracefully */
96 alarm(timeout_interval);
97
98 /* create the command line we're going to use */
99 snprintf(command,sizeof(command),"%s %s",HLTHERM_COMMAND,probe);
100 command[sizeof(command)-1]='\x0';
101
102 /* run the command to check the temperature on the probe */
103 fp=spopen(command);
104 if(fp==NULL){
105 printf("Could not open pipe: %s\n",command);
106 return STATE_UNKNOWN;
107 }
108
109 if(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){
110 found=1;
111 temp=(double)atof(input_buffer);
112 }
113
114 /* close the pipe */
115 spclose(fp);
116
117 if(result==STATE_OK){
118
119 if(found==0){
120 printf("Therm problem - Could not read program output\n");
121 result=STATE_CRITICAL;
122 }
123 else{
124 if(check_lower_temps==TRUE){
125 if(temp<=ctemp)
126 result=STATE_CRITICAL;
127 else if(temp<=wtemp)
128 result=STATE_WARNING;
129 }
130 else{
131 if(temp>=ctemp)
132 result=STATE_CRITICAL;
133 else if(temp>=wtemp)
134 result=STATE_WARNING;
135 }
136
137 printf("Therm %s: %s = %2.1f %s\n",(result==STATE_OK)?"ok":"problem",label,temp,scale);
138 }
139 }
140
141 return result;
142 }
143
144
145/* process command-line arguments */
146int process_arguments(int argc, char **argv){
147 int x;
148
149 /* not enough options were supplied */
150 if(argc<4)
151 return ERROR;
152
153 /* first option is always the probe name */
154 strncpy(probe,argv[1],sizeof(probe)-1);
155 probe[sizeof(probe)-1]='\x0';
156
157 /* 2nd and 3rd options are temperature thresholds */
158 wtemp=(double)atof(argv[2]);
159 ctemp=(double)atof(argv[3]);
160
161 /* process all remaining arguments */
162 for(x=5;x<=argc;x++){
163
164 /* we got the lower temperature option */
165 if(!strcmp(argv[x-1],"-lower"))
166 check_lower_temps=TRUE;
167
168 /* we got the label */
169 else if(!strcmp(argv[x-1],"-l")){
170 if(x<argc){
171 strncpy(label,argv[x],sizeof(label));
172 label[sizeof(label)-1]='\x0';
173 x++;
174 }
175 else
176 return ERROR;
177 }
178
179 /* we got the scale */
180 else if(!strcmp(argv[x-1],"-s")){
181 if(x<argc){
182 strncpy(scale,argv[x],sizeof(scale));
183 scale[sizeof(scale)-1]='\x0';
184 x++;
185 }
186 else
187 return ERROR;
188 }
189
190 /* else we got something else... */
191 else
192 return ERROR;
193 }
194
195 return OK;
196 }
197
198
199
200/* handle timeouts gracefully... */
201static void timeout_alarm_handler(int signo){
202
203 if(signo==SIGALRM){
204
205 kill(childpid[fileno(fp)],SIGKILL);
206 printf("Therm problem - Check timed out after %d seconds\n",timeout_interval);
207 exit(STATE_CRITICAL);
208 }
209 }
diff --git a/contrib/check_hprsc.pl b/contrib/check_hprsc.pl
new file mode 100755
index 0000000..23e6261
--- /dev/null
+++ b/contrib/check_hprsc.pl
@@ -0,0 +1,215 @@
1#!/usr/bin/perl -wT
2#
3# Copyright (c) 2000 Hugo Gayosso
4#
5# Description:
6# Nagios plug-in that monitors the resources on an HP-UX machine
7# by querying the SNMP daemon
8#
9# License: General Public License (GPL)
10# http://www.gnu.org/copyleft/gpl.txt
11#
12# ChangeLog
13#
14
15# Requirements: Perl 5.005 or higher
16
17# Variable initialization
18$ENV{'PATH'}="";
19$ENV{'ENV'}="";
20$ENV{'BASH_ENV'}="";
21
22
23if (-e "/usr/bin/snmpwalk") {
24 $snmpwalk = "/usr/bin/snmpwalk";
25} elsif (-e "/usr/local/bin/snmpwalk") {
26 $snmpwalk = "/usr/local/snmpwalk";
27}
28
29
30# HP-UX SNMP OIDs
31$filesystemID1_OID = ".1.3.6.1.4.1.11.2.3.1.2.2.1.1";
32$mounted_OID = ".1.3.6.1.4.1.11.2.3.1.2.2.1.3";
33$totalspace_OID = ".1.3.6.1.4.1.11.2.3.1.2.2.1.4";
34$freespace_OID = ".1.3.6.1.4.1.11.2.3.1.2.2.1.6";
35$path_OID = ".1.3.6.1.4.1.11.2.3.1.2.2.1.10";
36$cpu_5min_OID = ".1.3.6.1.4.1.11.2.3.1.1.4";
37
38use Getopt::Long;
39
40GetOptions( "check-filesystem" => \$chk_fs,
41 "show-filesystems" => \$show_fs,
42 "check-filesystemID" => \$chk_fsid,
43 "check-cpu" => \$chk_cpu,
44 "host=s" => \$target_host,
45 "community=s" => \$target_community,
46 "filesystemID1=i" => \$fsid1_opt,
47 "filesystem=s" => \$fs_opt,
48 "warning=i" => \$warning_opt,
49 "critical=i" => \$critical_opt);
50
51if ($chk_fs) {
52 walk_data($snmpwalk, $target_host, $target_community, $mounted_OID );
53 walk_data($snmpwalk, $target_host, $target_community, $totalspace_OID );
54 walk_data($snmpwalk, $target_host, $target_community, $freespace_OID ); check_filesystem($fs_opt, $warning_opt, $critical_opt);
55} elsif ($show_fs) {
56 walk_data($snmpwalk, $target_host, $target_community, $filesystemID1_OID);
57 walk_data($snmpwalk, $target_host, $target_community, $mounted_OID );
58 walk_data($snmpwalk, $target_host, $target_community, $path_OID);
59 show_filesystem();
60} elsif ($chk_fsid){
61 $totalspace_fsID_OID = "$totalspace_OID.$fsid1_opt";
62 $freespace_fsID_OID = "$freespace_OID.$fsid1_opt";
63 walk_data($snmpwalk, $target_host, $target_community, $totalspace_fsID_OID);
64 walk_data($snmpwalk, $target_host, $target_community, $freespace_fsID_OID);
65 check_filesystemID1($fsid1_opt, $warning_opt, $critical_opt);
66} elsif ($chk_cpu) {
67 get_cpu_load($snmpwalk, $target_host, $target_community, $cpu_5min_OID);
68 check_cpu_5min($cpu, $warning_opt, $critical_opt);
69} else {
70 print "\n\nUsage:\n";
71 print "Checking 5-min CPU Load:\n";
72 print " $0 --check-cpu -warning <threshold> --critical <threshold> --host <yourhost> --community <SNMP community>\n\n";
73 print "Checking local filesystem mounted on a host:\n";
74 print " $0 --show-filesystems --host <hostname> --community <SNMP community>\n\n";
75 print "Checking by filesystem name:\n";
76 print " $0 --check-filesystem --filesystem </dev/vg00/lvol1> --warning <% used space> --critical <% used space> --host <hostname> --community <SNMP community>\n\n";
77 print "Checking by filesystem ID:\n";
78 print " $0 --check-filesystemID --filesystemID <filesystemID1> --warning <% used space> --critical <% used space> --host <hostname> --community <SNMP community>\n\n";
79}
80
81sub get_cpu_load {
82 my ($snmpwalk, $target_host, $target_community, $OID) = @_;
83 die "cannot fork: $!" unless defined($pid = open(SNMPWALK, "-|"));
84
85 if ($pid) { # parent
86 while (<SNMPWALK>) {
87 my @snmpdata = split(/:/,$_);
88 $cpu = $snmpdata[1]/100;
89 }
90 close(SNMPWALK) or warn "kid exited $?";
91 } else { # child
92 exec($snmpwalk,$target_host,$target_community,$OID) or die "can't exec program: $!";
93 }
94}
95
96sub walk_data {
97#This function queries the SNMP daemon for the specific OID
98 my ($snmpwalk, $target_host, $target_community, $OID) = @_;
99
100 die "cannot fork: $!" unless defined($pid = open(SNMPWALK, "-|"));
101
102 if ($pid) { # parent
103 while (<SNMPWALK>) {
104 $output = $_;
105 sort_walk_data($output);
106 }
107 close(SNMPWALK) or warn "kid exited $?";
108 } else { # child
109 exec($snmpwalk,$target_host,$target_community,$OID) or die "can't exec program: $!";
110 }
111}
112
113sub sort_walk_data {
114 my ($snmp_data) = @_;
115 @fields = split(/\./,$snmp_data);
116 $item = $fields[8];
117 $filesystemID1 = $fields[9];
118 @fields2 = split(/=/,$fields[10]);
119# $filesystemID2 = $fields2[0];
120 $value = $fields2[1];
121 chomp($value);
122 if ($value =~ /"/) {
123 @fields3 = split(/"/,$value);
124 $value = $fields3[1];
125 }
126 if ($item == 3) {
127 $mounted{$filesystemID1} = "$value";
128 } elsif ($item == 4) {
129 $totalspace{$filesystemID1} = "$value";
130 } elsif ($item == 6) {
131 $freespace{$filesystemID1} = "$value";
132 } elsif ($item == 10) {
133 $filesystempath{$filesystemID1} = "$value";
134 }
135}
136
137sub show_filesystem {
138 print "\n\nfilesystemID1\tmounted filesystem\tfilesystem path\n";
139 foreach $element (keys %mounted) {
140 print "$element\t$mounted{$element}\t\t$filesystempath{$element}\n";
141 }
142 print "\n\n";
143}
144
145sub check_filesystem {
146
147# Warning = percentage of used space >= $warning and < $critical
148# Critical = percentage of used space > $warning and >= $critical
149# OK = percentage of used space < $warning and < $critical
150
151 my ($mounted_filesystem, $warning, $critical) = @_;
152 foreach $element (keys %mounted) {
153 if ($mounted{$element} eq $mounted_filesystem) {
154 my $warning_result = $totalspace{$element}*(100-$warning)/100;
155 my $critical_result = $totalspace{$element}*(100-$critical)/100;
156 my $result_percent = $freespace{$element}*100/$totalspace{$element};
157 if (($freespace{$element} <= $warning_result) && ($freespace{$element} > $critical_result)) {
158 printf "Only %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
159 exit 1;
160 } elsif ($freespace{$element} <= $critical_result) {
161 printf "Only %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
162 exit 2;
163 } else {
164 printf "Disk ok - %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
165 exit 0;
166 }
167 }
168 }
169 print "$mounted_filesystem doesn't exist in $target_host\n\n";
170 exit -1;
171}
172
173sub check_filesystemID1{
174# Warning = percentage of used space >= $warning and < $critical
175# Critical = percentage of used space > $warning and >= $critical
176# OK = percentage of used space < $warning and < $critical
177
178 my ($fsid1, $warning, $critical) = @_;
179 foreach $element (keys %totalspace) {
180 if ($element eq $fsid1) {
181 my $warning_result = $totalspace{$element}*(100-$warning)/100;
182 my $critical_result = $totalspace{$element}*(100-$critical)/100;
183 my $result_percent = $freespace{$element}*100/$totalspace{$element};
184 if (($freespace{$element} <= $warning_result) && ($freespace{$element} >= $critical_result)) {
185 printf "Only %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
186 exit 1;
187 } elsif ($freespace{$element} <= $critical_result) {
188 printf "Only %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
189 exit 2;
190 } else {
191 printf "Disk ok - %d M (%d%s) free\n",$freespace{$element}/1024,$result_percent,"%";
192 exit 0;
193 }
194 }
195 }
196 print "$fsid1 doesn't exist in $target_host\n\n";
197 exit -1;
198}
199
200sub check_cpu_5min {
201 my ($cpu, $warn, $crit) = @_;
202 if ($cpu >= $crit) {
203 print "Critical- 5-min load: $cpu\n";
204 exit 2;
205 } elsif ($cpu >= $warn) {
206 print "Warning - 5-min load: $cpu\n";
207 exit 1;
208 } else {
209 print "Load ok - 5-min load: $cpu\n";
210 exit 0;
211 }
212}
213
214
215
diff --git a/contrib/check_ipxping.c b/contrib/check_ipxping.c
index 1ba10fe..937b921 100644
--- a/contrib/check_ipxping.c
+++ b/contrib/check_ipxping.c
@@ -27,9 +27,10 @@
27 * 27 *
28 *****************************************************************************************/ 28 *****************************************************************************************/
29 29
30#include "../common/config.h" 30#include "config.h"
31#include "../common/common.h" 31#include "common.h"
32#include "netutils.h" 32#include "netutils.h"
33#include "popen.h"
33 34
34/* this should be moved out to the configure script! */ 35/* this should be moved out to the configure script! */
35#define IPXPING_COMMAND "/tmp/ipxping/ipxping" 36#define IPXPING_COMMAND "/tmp/ipxping/ipxping"
diff --git a/contrib/check_mysql.c b/contrib/check_mysql.c
index 9abacf8..56725dc 100644
--- a/contrib/check_mysql.c
+++ b/contrib/check_mysql.c
@@ -30,8 +30,8 @@
30 * 30 *
31 *******************************************************************/ 31 *******************************************************************/
32 32
33#include "../common/config.h" 33#include "config.h"
34#include "../common/common.h" 34#include "common.h"
35#include "mysql.h" 35#include "mysql.h"
36 36
37MYSQL mysql; 37MYSQL mysql;
diff --git a/contrib/check_uptime.c b/contrib/check_uptime.c
index 46a1b82..fe98123 100644
--- a/contrib/check_uptime.c
+++ b/contrib/check_uptime.c
@@ -21,10 +21,10 @@
21 * 21 *
22 *****************************************************************************/ 22 *****************************************************************************/
23 23
24#include "common/config.h" 24#include "config.h"
25#include "common/common.h" 25#include "common.h"
26#include "common/utils.h" 26#include "utils.h"
27#include "common/popen.h" 27#include "popen.h"
28 28
29int main(int argc, char **argv) 29int main(int argc, char **argv)
30{ 30{
diff --git a/contrib/check_wave.pl b/contrib/check_wave.pl
new file mode 100644
index 0000000..56b59fe
--- /dev/null
+++ b/contrib/check_wave.pl
@@ -0,0 +1,77 @@
1#!/usr/bin/perl
2
3# CHECK_WAVE.PL
4# Plugin to test signal strength on Speedlan wireless equipment
5# Contributed by Jeffry Blank
6
7$Host=$ARGV[0];
8$sig_crit=$ARGV[1];
9$sig_warn=$ARGV[2];
10
11
12
13
14$low1 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
15@test=split(/ /,$low1);
16$low1=@test[2];
17
18
19$med1 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
20@test=split(/ /,$med1);
21$med1=@test[2];
22
23
24$high1 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
25@test=split(/ /,$high1);
26$high1=@test[2];
27
28sleep(2);
29
30
31
32$snr = `snmpget $Host public .1.3.6.1.4.1.762.2.5.2.1.17.1`;
33@test=split(/ /,$snr);
34$snr=@test[2];
35$snr=int($snr*25);
36$low2 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
37@test=split(/ /,$low2);
38$low2=@test[2];
39
40
41$med2 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
42@test=split(/ /,$med2);
43$med2=@test[2];
44
45
46$high2 = `snmpget $Host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
47@test=split(/ /,$high2);
48$high2=@test[2];
49
50
51
52$low=$low2-$low1;
53$med=$med2-$med1;
54$high=$high2-$high1;
55
56$tot=$low+$med+$high;
57
58
59if ($tot==0)
60 {
61 $ss=0;
62 }
63else
64 {
65 $lowavg=$low/$tot;
66 $medavg=$med/$tot;
67 $highavg=$high/$tot;
68 $ss=($medavg*50)+($highavg*100);
69 }
70printf("Signal Strength at: %3.0f%, SNR at $snr%",$ss);
71#print "Signal Strength at: $ss%, SNR at $snr%";
72if ($ss<$sig_crit)
73 {exit(2)}
74if ($ss<$sig_warn)
75 {exit(1)}
76
77exit(0);
diff --git a/contrib/readme.txt b/contrib/readme.txt
index d9ae025..6438c99 100644
--- a/contrib/readme.txt
+++ b/contrib/readme.txt
@@ -4,13 +4,22 @@ Contrib Plugins README
4This directory contains plugins which have been contributed by various people, but that 4This directory contains plugins which have been contributed by various people, but that
5have not yet been incorporated into the core plugins distribution. 5have not yet been incorporated into the core plugins distribution.
6 6
7Most Perl plugins should work without modification. Some of the C plugins may require
8a few tweaks to compile.
9
7If you have questions regarding the use of these plugins, try contacting the author(s) 10If you have questions regarding the use of these plugins, try contacting the author(s)
8or post a message to the nagios-users mailing list (nagios-users@onelist.com) 11or post a message to the nagiosplug-help mailing list (nagiosplug-help@lists.sourceforge.net)
9requesting assistance. 12requesting assistance.
10 13
11 14
12Plugin Overview 15
13--------------- 16Contrib Tarballs
17----------------
18
19In addition to the plugins located in this directory, there are some additional tarballs
20containing plugins in the tarballs/ subdirectory. They have not yet been organized.
21A brief description of their contents follows.
22
14 23
15berger-ping.tar.gz - Perl script version of the check_ping plugin and a corresponding 24berger-ping.tar.gz - Perl script version of the check_ping plugin and a corresponding
16 CGI (mtr.cgi) that uses mtr to traceroute a path to a host. 25 CGI (mtr.cgi) that uses mtr to traceroute a path to a host.
@@ -21,71 +30,13 @@ bowen-langley_plugins.tar.gz
21 (Adam Bown & Thomas Langley) 30 (Adam Bown & Thomas Langley)
22 31
23 32
24check_bgpstate.tar.gz - Perl script intended for monitoring BGP sessions on Cisco routers. 33check_bgp-1.0.tar.gz - Perl script intended for monitoring BGP sessions on Cisco routers.
25 Only useful if you are using BGP4 as a routing protocol. For 34 Only useful if you are using BGP4 as a routing protocol. For
26 critical alert the AS (autonomous system) number has to be in the 35 critical alert the AS (autonomous system) number has to be in the
27 uplinks hash (see the source code). Requires SNMP read community. 36 uplinks hash (see the source code). Requires SNMP read community.
28 (Christoph Kron) 37 (Christoph Kron)
29 38
30check_breeze.tar.gz - Perl script to test signal strength on Breezecom wireless 39check_memory.tgz - C plugin to check available system memory
31 equipment (Jeffrey Blank)
32
33check_dns_random.tar.gz - Perl script to see if dns resolves hosts randomly from a list
34 using the check_dns plugin (Richard Mayhew)
35
36check_flexlm.tar.gz - Perl script to check a flexlm licensing manager using lmtest
37 (Ernst-Dieter Martin)
38
39check_hltherm.tar.gz - C program to check the temperature on a Hot Little Therm temperature
40 probe. The HLT device, along with temperature probes, can be obtained
41 from Spiderplant at http://www.spiderplant.com
42 (Ethan Galstad)
43
44check_ifoperstatus.tar.gz
45 - Perl script that checks the operational interface status (up/down) for
46 one interface on cisco/ascend routers. Especially useful for monitoring
47 leased lines. Requires SNMP read community and SNMP interface key.
48 (Christoph Kron)
49
50check_ifstatus.tar.gz - Perl script that checks operational interface status for every interface
51 on cisco routers. Requires SNMP read community.
52 (Christoph Kron)
53
54check_ipxping.tar.gz - C program that it similiar to the check_ping plugin, except that it
55 send IPX ping packets to Novell servers or other IPX devices. This
56 requires the ipxping binary for Linux systems. It does NOT by work
57 without modification with the ipxping binary for SunOS/Solaris.
58 (Ethan Galstad)
59
60check_maxchannels.tar.gz
61 - Perl script that can only be used for monitoring Ascend/Lucent Max/TNT
62 access server. Checks ISDN channels and modem cards. Also shows ISDN and
63 modem usage. Requires SNMP read community.
64 (Christoph Kron)
65
66check_maxwanstate.tar.gz
67 - Perl script that can only be used for monitoring Ascend/Lucent Max/TNT
68 access server. Checks if every enabled E1/T1 interface is operational
69 (link active). Requires SNMP read community.
70 (Christoph Kron)
71
72check_memory.tgz - C program to check available system memory - RAM, swap, buffers,
73 and cache (Joshua Jackson)
74
75check_nfs.tar.gz - Perl script to test and NFS server using rpcinfo
76 (Ernst-Dieter Martin)
77 <NOW PART OF check_rpc IN CORE>
78
79check_ntp.tar.gz - Perl script to check an NTP time source (Bo Kernsey)
80 <MOVED TO CORE>
81
82check_ora.tar.gz - Shell script that will check an Oracle database and the TNS listener.
83 Unlike the check_oracle plugin, this plugin detects when a database is
84 down and does not create temp files (Jason Hedden)
85 <MOVED TO CORE>
86
87check_pop3.tar.gz - Perl script that checks to see if POP3 is running and whether or not
88 authentication can take place (Richard Mayhew)
89 40
90check_radius.tar.gz - C program to check RADIUS authentication. This is a hacked version of 41check_radius.tar.gz - C program to check RADIUS authentication. This is a hacked version of
91 the Cistron Radiusd program radtest that acts as a plugin for Nagios. 42 the Cistron Radiusd program radtest that acts as a plugin for Nagios.
@@ -95,24 +46,6 @@ check_radius.tar.gz - C program to check RADIUS authentication. This is a ha
95 will not appear in the core plugin distribution! 46 will not appear in the core plugin distribution!
96 (Adam Jacob) 47 (Adam Jacob)
97 48
98check_real.tar.gz - C program to check the status of a REAL media server
99 (Pedro Leite)
100 <MOVED TO CORE>
101
102check_rpc.pl.gz - Perl script to check rpc services. Will check to see if the a specified
103 program is running on the specified server (Chris Kolquist)
104
105check_sap.tar.gz - Shell script to check an SAP message or application server. Requires
106 that you install the saprfc-devel-45A-1.i386.rpm (or higher) package
107 on your system. The package can be obtained from the SAP FTP site in
108 the /general/misc/unsupported/linux directory. (Kavel Salavec)
109
110check_uptime.tar.gz - C program to check system uptime. Must be compiled with the release
111 1.2.8 or later of the plugins. (Teresa Ramanan)
112
113check_wave.tar.gz - Perl script to test signal strength on Speedlan wireless
114 equipment (Jeffrey Blank)
115
116hopcroft-plugins.tar.gz - Various example plugin scripts contributed by Stanley Hopcroft. 49hopcroft-plugins.tar.gz - Various example plugin scripts contributed by Stanley Hopcroft.
117 Includes a plugin to check Internet connectivity by checking various 50 Includes a plugin to check Internet connectivity by checking various
118 popular search engines, a plugin to check the availability of login 51 popular search engines, a plugin to check the availability of login
@@ -121,27 +54,7 @@ hopcroft-plugins.tar.gz - Various example plugin scripts contributed by Stanley
121 search via the web. 54 search via the web.
122 (Stanley Hopcroft) 55 (Stanley Hopcroft)
123 56
124maser-oracle.tar.gz - This is a modification to the check_oracle plugin script that returns
125 the response time in milliseconds. Requires the Oracle tnsping utility.
126 (Christoph Maser)
127
128radius.tar.gz - Code modifications necessary to make the radexample app 57radius.tar.gz - Code modifications necessary to make the radexample app
129 supplied with the radiusclient code work as a RADIUS plugin 58 supplied with the radiusclient code work as a RADIUS plugin
130 for Nagios (Nick Shore) 59 for Nagios (Nick Shore)
131 60
132vincent-check_radius.tar.gz
133 - C program to check RADIUS authentication. Requires the radiusclient
134 library available from ftp://ftp.cityline.net/pub/radiusclient/
135 (Robert August Vincent II)
136 <MOVED TO CORE>
137
138weipert-mysql.tar.gz - C program to check a connection to a MySQL database server, with an
139 optional username and password. Requires mysql.h and libmysqlclient
140 to compile (Time Weipert)
141
142wright-mysql.tar.gz - Perl script to check MySQL database servers. Requires that mysqladmin(1)
143 be installed on the system (included in the MySQL distribution). This
144 plugin can accept warning and critical thresholds for the number of threads
145 in use by the server (Mitch Wright)
146
147
diff --git a/contrib/tarballs/berger-ping.tar.gz b/contrib/tarballs/berger-ping.tar.gz
index cc58750..c95b787 100644
--- a/contrib/tarballs/berger-ping.tar.gz
+++ b/contrib/tarballs/berger-ping.tar.gz
Binary files differ
diff --git a/contrib/tarballs/bowen-langley_plugins.tar.gz b/contrib/tarballs/bowen-langley_plugins.tar.gz
index 6195109..a9ad1e8 100644
--- a/contrib/tarballs/bowen-langley_plugins.tar.gz
+++ b/contrib/tarballs/bowen-langley_plugins.tar.gz
Binary files differ
diff --git a/contrib/tarballs/check_bgp-1.0.tar.gz b/contrib/tarballs/check_bgp-1.0.tar.gz
index 9d45c19..0496ddb 100644
--- a/contrib/tarballs/check_bgp-1.0.tar.gz
+++ b/contrib/tarballs/check_bgp-1.0.tar.gz
Binary files differ
diff --git a/contrib/tarballs/check_breeze.tar.gz b/contrib/tarballs/check_breeze.tar.gz
deleted file mode 100644
index fb5186e..0000000
--- a/contrib/tarballs/check_breeze.tar.gz
+++ /dev/null
Binary files differ
diff --git a/contrib/tarballs/check_flexlm.tar.gz b/contrib/tarballs/check_flexlm.tar.gz
deleted file mode 100644
index 4ab7144..0000000
--- a/contrib/tarballs/check_flexlm.tar.gz
+++ /dev/null
Binary files differ
diff --git a/contrib/tarballs/check_hltherm.tar.gz b/contrib/tarballs/check_hltherm.tar.gz
deleted file mode 100644
index 7c45cc8..0000000
--- a/contrib/tarballs/check_hltherm.tar.gz
+++ /dev/null
Binary files differ
diff --git a/contrib/tarballs/check_hprsc.tar.gz b/contrib/tarballs/check_hprsc.tar.gz
deleted file mode 100644
index 8998ff8..0000000
--- a/contrib/tarballs/check_hprsc.tar.gz
+++ /dev/null
Binary files differ
diff --git a/contrib/check_memory.tgz b/contrib/tarballs/check_memory.tgz
index b0f8016..b0f8016 100644
--- a/contrib/check_memory.tgz
+++ b/contrib/tarballs/check_memory.tgz
Binary files differ
diff --git a/contrib/tarballs/check_radius.tar.gz b/contrib/tarballs/check_radius.tar.gz
index 70bb08a..cca6338 100644
--- a/contrib/tarballs/check_radius.tar.gz
+++ b/contrib/tarballs/check_radius.tar.gz
Binary files differ
diff --git a/contrib/tarballs/check_wave.tar.gz b/contrib/tarballs/check_wave.tar.gz
deleted file mode 100644
index 755be5a..0000000
--- a/contrib/tarballs/check_wave.tar.gz
+++ /dev/null
Binary files differ
diff --git a/contrib/tarballs/hopcroft-plugins.tar.gz b/contrib/tarballs/hopcroft-plugins.tar.gz
index 0406a74..41ad6db 100644
--- a/contrib/tarballs/hopcroft-plugins.tar.gz
+++ b/contrib/tarballs/hopcroft-plugins.tar.gz
Binary files differ
diff --git a/contrib/tarballs/radius.tar.gz b/contrib/tarballs/radius.tar.gz
index 022dc3b..41bca5f 100644
--- a/contrib/tarballs/radius.tar.gz
+++ b/contrib/tarballs/radius.tar.gz
Binary files differ