From d8b81e9ef3947a36e2647f4e54a63e3b259b103b Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 1 Oct 2013 14:59:35 +0200 Subject: check_oracle: --tns bad string matching check_oracle in the 1.4.15 release doesn't correctly parse the output gotten from at least Oracle 11 (with german locales). I guess it's probably more. Also it completely needlessly uses sed where basic bash string parsing actually does more than suffice (and does not run into possible problems with locales like sed ;)). -- Just turning attached patch of github issue #1015 into a push request. (Closes #1015 and #1191) --- plugins-scripts/check_oracle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-scripts') diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index ceac95dc..1873a3c2 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -137,7 +137,7 @@ case "$cmd" in tnschk=` tnsping $2` tnschk2=` echo $tnschk | grep -c OK` if [ ${tnschk2} -eq 1 ] ; then - tnschk3=` echo $tnschk | sed -e 's/.*(//' -e 's/).*//'` + tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*} echo "OK - reply time ${tnschk3} from $2" exit $STATE_OK else -- cgit v1.2.3 From d4b6d09f104f73c462e0e0c8a297ba9fc7c5a53e Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Wed, 20 Aug 2014 20:29:23 +0200 Subject: check_log.sh: droping path from basename while evaluating PROGNAME (Closes Debian Bug #758662) --- plugins-scripts/check_log.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-scripts') diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index 8653a5e1..f67eff69 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh @@ -58,7 +58,7 @@ # Paths to commands used in this script. These # may have to be modified to match your system setup. -PROGNAME=`/bin/basename $0` +PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION="@NP_VERSION@" PATH="@TRUSTED_PATH@" -- cgit v1.2.3 From 3a668c0f87f3ad31f28997ed43b374edf78f6227 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Wed, 20 Aug 2014 20:32:09 +0200 Subject: Setting PATH at first --- plugins-scripts/check_log.sh | 5 ++--- plugins-scripts/check_oracle.sh | 3 ++- plugins-scripts/check_sensors.sh | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins-scripts') diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index f67eff69..d28c8d0a 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh @@ -58,12 +58,11 @@ # Paths to commands used in this script. These # may have to be modified to match your system setup. +PATH="@TRUSTED_PATH@" +export PATH PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION="@NP_VERSION@" -PATH="@TRUSTED_PATH@" - -export PATH . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 1873a3c2..96078aca 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -6,10 +6,11 @@ # This Monitoring plugin was created to check Oracle status # +PATH="@TRUSTED_PATH@" +export PATH PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION="@NP_VERSION@" -PATH="@TRUSTED_PATH@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh index 05c64c48..f7428301 100755 --- a/plugins-scripts/check_sensors.sh +++ b/plugins-scripts/check_sensors.sh @@ -1,11 +1,10 @@ #!/bin/sh +PATH="@TRUSTED_PATH@" +export PATH PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION="@NP_VERSION@" -PATH="@TRUSTED_PATH@" - -export PATH . $PROGPATH/utils.sh -- cgit v1.2.3 From 37b8081504baca0df9e19818f686f25011835d1b Mon Sep 17 00:00:00 2001 From: Simon Meggle Date: Mon, 1 Sep 2014 17:08:49 +0200 Subject: check_mailq: fixed mailer names (Closes #1289) --- plugins-scripts/check_mailq.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins-scripts') diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index bd78981e..0e8100d0 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -332,7 +332,7 @@ elsif ( $mailq eq "postfix" ) { }elsif ($lines[0]=~/Mail queue is empty/) { $msg_q = 0; }else{ - print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n"; + print "Couldn't match $utils::PATH_TO_MAILQ output\n"; exit $ERRORS{'UNKNOWN'}; } @@ -340,7 +340,7 @@ elsif ( $mailq eq "postfix" ) { #if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) { # my $msg_p = $1; #}else{ - # print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n"; + # print "Couldn't match $utils::PATH_TO_MAILQ output\n"; # exit $ERRORS{'UNKNOWN'}; #} -- cgit v1.2.3