summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts')
-rw-r--r--plugins-scripts/Makefile.am4
-rw-r--r--plugins-scripts/check_disk_smb.pl2
-rwxr-xr-xplugins-scripts/check_ifoperstatus.pl8
-rwxr-xr-xplugins-scripts/check_ifstatus.pl2
-rwxr-xr-xplugins-scripts/check_ircd.pl4
-rwxr-xr-xplugins-scripts/check_log.sh4
-rwxr-xr-xplugins-scripts/check_mailq.pl38
-rwxr-xr-xplugins-scripts/check_oracle.sh16
-rwxr-xr-xplugins-scripts/check_rpc.pl2
-rwxr-xr-xplugins-scripts/check_sensors.sh8
-rwxr-xr-xplugins-scripts/check_uptime.pl2
11 files changed, 57 insertions, 33 deletions
diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am
index 088a445..7879791 100644
--- a/plugins-scripts/Makefile.am
+++ b/plugins-scripts/Makefile.am
@@ -16,13 +16,13 @@ VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/
16libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \ 16libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \
17 check_log check_oracle check_rpc check_sensors check_wave \ 17 check_log check_oracle check_rpc check_sensors check_wave \
18 check_ifstatus check_ifoperstatus check_mailq check_file_age \ 18 check_ifstatus check_ifoperstatus check_mailq check_file_age \
19 check_uptime \ 19 check_uptime check_mssql \
20 utils.sh utils.pm 20 utils.sh utils.pm
21 21
22EXTRA_DIST=check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \ 22EXTRA_DIST=check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \
23 check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \ 23 check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \
24 check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \ 24 check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \
25 check_uptime.pl \ 25 check_uptime.pl check_mssql.pl \
26 utils.sh.in utils.pm.in t 26 utils.sh.in utils.pm.in t
27 27
28EDIT = sed \ 28EDIT = sed \
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
index 15d1634..f4d33a7 100644
--- a/plugins-scripts/check_disk_smb.pl
+++ b/plugins-scripts/check_disk_smb.pl
@@ -28,7 +28,7 @@ use FindBin;
28use lib "$FindBin::Bin"; 28use lib "$FindBin::Bin";
29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); 29use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
30 30
31# make us session leader which makes all childs exit if we do 31# make us session leader which makes all children exit if we do
32setsid; 32setsid;
33 33
34sub print_help (); 34sub print_help ();
diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl
index c190ce9..e335cda 100755
--- a/plugins-scripts/check_ifoperstatus.pl
+++ b/plugins-scripts/check_ifoperstatus.pl
@@ -134,7 +134,7 @@ if (defined $ifdescr || defined $iftype) {
134 } 134 }
135 if ($status==0) { 135 if ($status==0) {
136 $state = "UNKNOWN"; 136 $state = "UNKNOWN";
137 printf "$state: could not retrive ifdescr/iftype snmpkey - $status-$snmpkey\n"; 137 printf "$state: could not retrieve ifdescr/iftype snmpkey - $status-$snmpkey\n";
138 $session->close; 138 $session->close;
139 exit $ERRORS{$state}; 139 exit $ERRORS{$state};
140 } 140 }
@@ -187,7 +187,7 @@ if (defined $ifXTable) {
187 $name = $response->{$snmpIfDescr} ; 187 $name = $response->{$snmpIfDescr} ;
188} 188}
189 189
190## if AdminStatus is down - some one made a consious effort to change config 190## if AdminStatus is down - some one made a conscious effort to change config
191## 191##
192if ( not ($response->{$snmpIfAdminStatus} == 1) ) { 192if ( not ($response->{$snmpIfAdminStatus} == 1) ) {
193 $answer = "Interface $name (index $snmpkey) is administratively down."; 193 $answer = "Interface $name (index $snmpkey) is administratively down.";
@@ -286,7 +286,7 @@ sub print_usage() {
286 printf "check_ifoperstatus -k <IF_KEY> -H <HOSTNAME> [-C <community>]\n"; 286 printf "check_ifoperstatus -k <IF_KEY> -H <HOSTNAME> [-C <community>]\n";
287 printf "Copyright (C) 2000 Christoph Kron\n"; 287 printf "Copyright (C) 2000 Christoph Kron\n";
288 printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n"; 288 printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n";
289 printf "This programm is licensed under the terms of the "; 289 printf "This program is licensed under the terms of the ";
290 printf "GNU General Public License\n(check source code for details)\n"; 290 printf "GNU General Public License\n(check source code for details)\n";
291 printf "\n\n"; 291 printf "\n\n";
292} 292}
@@ -424,7 +424,7 @@ sub process_arguments() {
424 if (defined $seclevel && defined $secname) { 424 if (defined $seclevel && defined $secname) {
425 $session_opts{'-username'} = $secname; 425 $session_opts{'-username'} = $secname;
426 426
427 # Must define a security level even though defualt is noAuthNoPriv 427 # Must define a security level even though default is noAuthNoPriv
428 unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { 428 unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
429 usage("Must define a valid security level even though default is noAuthNoPriv"); 429 usage("Must define a valid security level even though default is noAuthNoPriv");
430 } 430 }
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
index 32984e5..38b87fc 100755
--- a/plugins-scripts/check_ifstatus.pl
+++ b/plugins-scripts/check_ifstatus.pl
@@ -354,7 +354,7 @@ sub process_arguments() {
354 if (defined $seclevel && defined $secname) { 354 if (defined $seclevel && defined $secname) {
355 $session_opts{'-username'} = $secname; 355 $session_opts{'-username'} = $secname;
356 356
357 # Must define a security level even though defualt is noAuthNoPriv 357 # Must define a security level even though default is noAuthNoPriv
358 unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { 358 unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
359 usage("Must define a valid security level even though default is noAuthNoPriv"); 359 usage("Must define a valid security level even though default is noAuthNoPriv");
360 } 360 }
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
index d869ae7..84f2022 100755
--- a/plugins-scripts/check_ircd.pl
+++ b/plugins-scripts/check_ircd.pl
@@ -60,7 +60,7 @@ sub print_usage ();
60sub connection ($$$$); 60sub connection ($$$$);
61sub bindRemote ($$); 61sub bindRemote ($$);
62 62
63# -------------------------------------------------------------[ Enviroment ]-- 63# -------------------------------------------------------------[ Environment ]--
64 64
65$ENV{'PATH'}='@TRUSTED_PATH@'; 65$ENV{'PATH'}='@TRUSTED_PATH@';
66$ENV{'BASH_ENV'}=''; 66$ENV{'BASH_ENV'}='';
@@ -208,7 +208,7 @@ MAIN:
208 208
209 # Just in case of problems, let's not hang the monitoring system 209 # Just in case of problems, let's not hang the monitoring system
210 $SIG{'ALRM'} = sub { 210 $SIG{'ALRM'} = sub {
211 print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; 211 print "Something is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n";
212 exit $ERRORS{"UNKNOWN"}; 212 exit $ERRORS{"UNKNOWN"};
213 }; 213 };
214 214
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
index c623a8d..8ecdd31 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -105,11 +105,11 @@ while test -n "$1"; do
105 case "$1" in 105 case "$1" in
106 -h | --help) 106 -h | --help)
107 print_help 107 print_help
108 exit "$STATE_OK" 108 exit "$STATE_UNKNOWN"
109 ;; 109 ;;
110 -V | --version) 110 -V | --version)
111 print_revision "$PROGNAME" "$REVISION" 111 print_revision "$PROGNAME" "$REVISION"
112 exit "$STATE_OK" 112 exit "$STATE_UNKNOWN"
113 ;; 113 ;;
114 -F | --filename) 114 -F | --filename)
115 logfile=$2 115 logfile=$2
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 27073d3..49156af 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -4,7 +4,7 @@
4# transmittal. 4# transmittal.
5# 5#
6# Initial version support sendmail's mailq command 6# Initial version support sendmail's mailq command
7# Support for mutiple sendmail queues (Carlos Canau) 7# Support for multiple sendmail queues (Carlos Canau)
8# Support for qmail (Benjamin Schmid) 8# Support for qmail (Benjamin Schmid)
9 9
10# License Information: 10# License Information:
@@ -149,7 +149,26 @@ if ($mailq eq "sendmail") {
149##/var/spool/mqueue/qF/df is empty 149##/var/spool/mqueue/qF/df is empty
150## Total Requests: 1 150## Total Requests: 1
151 151
152 152# separate submission/transport queues, empty
153## MSP Queue status...
154## /var/spool/mqueue-client is empty
155## Total requests: 0
156## MTA Queue status...
157## /var/spool/mqueue is empty
158## Total requests: 0
159# separate submission/transport queues: 1
160## MSP Queue status...
161## /var/spool/mqueue-client (1 request)
162## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
163## oAJEfhdW014123 5 Fri Nov 19 14:41 jwm
164## (Deferred: Connection refused by [127.0.0.1])
165## root
166## Total requests: 1
167## MTA Queue status...
168## /var/spool/mqueue is empty
169## Total requests: 0
170
171 my $this_msg_q = 0;
153 while (<MAILQ>) { 172 while (<MAILQ>) {
154 173
155 # match email addr on queue listing 174 # match email addr on queue listing
@@ -189,13 +208,18 @@ if ($mailq eq "sendmail") {
189 # 208 #
190 # single queue: first line 209 # single queue: first line
191 # multi queue: one for each queue. overwrite on multi queue below 210 # multi queue: one for each queue. overwrite on multi queue below
192 $msg_q = $1 ; 211 $this_msg_q = $1 ;
212 $msg_q += $1 ;
193 } 213 }
194 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) { 214 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
195 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ; 215 if ($this_msg_q) {
196 # 216 $this_msg_q = 0 ;
197 # multi queue: last line 217 } else {
198 $msg_q = $1 ; 218 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
219 #
220 # multi queue: last line
221 $msg_q += $1 ;
222 }
199 } 223 }
200 224
201 } 225 }
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
index b14ec50..5998138 100755
--- a/plugins-scripts/check_oracle.sh
+++ b/plugins-scripts/check_oracle.sh
@@ -86,20 +86,20 @@ esac
86# Information options 86# Information options
87case "$cmd" in 87case "$cmd" in
88--help) 88--help)
89 print_help 89 print_help
90 exit "$STATE_OK" 90 exit "$STATE_UNKNOWN"
91 ;; 91 ;;
92-h) 92-h)
93 print_help 93 print_help
94 exit "$STATE_OK" 94 exit "$STATE_UNKNOWN"
95 ;; 95 ;;
96--version) 96--version)
97 print_revision "$PROGNAME" "$REVISION" 97 print_revision "$PROGNAME" "$REVISION"
98 exit "$STATE_OK" 98 exit "$STATE_UNKNOWN"
99 ;; 99 ;;
100-V) 100-V)
101 print_revision "$PROGNAME" "$REVISION" 101 print_revision "$PROGNAME" "$REVISION"
102 exit "$STATE_OK" 102 exit "$STATE_UNKNOWN"
103 ;; 103 ;;
104esac 104esac
105 105
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl
index 47d6e49..8a56b9f 100755
--- a/plugins-scripts/check_rpc.pl
+++ b/plugins-scripts/check_rpc.pl
@@ -5,7 +5,7 @@
5# usage: 5# usage:
6# check_rpc host service 6# check_rpc host service
7# 7#
8# Check if an rpc serice is registered and running 8# Check if an rpc service is registered and running
9# using rpcinfo - $proto $host $prognum 2>&1 |"; 9# using rpcinfo - $proto $host $prognum 2>&1 |";
10# 10#
11# Use these hosts.cfg entries as examples 11# Use these hosts.cfg entries as examples
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
index 921e7b3..866e0e0 100755
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -26,19 +26,19 @@ print_help() {
26case "$1" in 26case "$1" in
27 --help) 27 --help)
28 print_help 28 print_help
29 exit "$STATE_OK" 29 exit "$STATE_UNKNOWN"
30 ;; 30 ;;
31 -h) 31 -h)
32 print_help 32 print_help
33 exit "$STATE_OK" 33 exit "$STATE_UNKNOWN"
34 ;; 34 ;;
35 --version) 35 --version)
36 print_revision "$PROGNAME" "$REVISION" 36 print_revision "$PROGNAME" "$REVISION"
37 exit "$STATE_OK" 37 exit "$STATE_UNKNOWN"
38 ;; 38 ;;
39 -V) 39 -V)
40 print_revision "$PROGNAME" "$REVISION" 40 print_revision "$PROGNAME" "$REVISION"
41 exit "$STATE_OK" 41 exit "$STATE_UNKNOWN"
42 ;; 42 ;;
43 *) 43 *)
44 sensordata=$(sensors 2>&1) 44 sensordata=$(sensors 2>&1)
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
index f954287..d73e40e 100755
--- a/plugins-scripts/check_uptime.pl
+++ b/plugins-scripts/check_uptime.pl
@@ -110,7 +110,7 @@ $pretty_uptime .= sprintf( "%d week%s, ", $weeks, $weeks == 1 ? "" : "s" ) if
110$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days; 110$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days;
111$pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours; 111$pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours;
112$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins; 112$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins;
113# Replace last occurence of comma with "and" 113# Replace last occurrence of comma with "and"
114$pretty_uptime =~ s/, $/ and /; 114$pretty_uptime =~ s/, $/ and /;
115# Always print the seconds (though it may be 0 seconds) 115# Always print the seconds (though it may be 0 seconds)
116$pretty_uptime .= sprintf( "%d second%s", $secs, $secs == 1 ? "" : "s" ); 116$pretty_uptime .= sprintf( "%d second%s", $secs, $secs == 1 ? "" : "s" );