Bläddra i källkod

Merge branch 'paulbruedgam-issue722'

Sebastian Wolf 2 år sedan
förälder
incheckning
c1ea2c6b3b
2 ändrade filer med 2 tillägg och 1 borttagningar
  1. 1 0
      NEWS
  2. 1 1
      plugins-scripts/check_oracle.sh

+ 1 - 0
NEWS

@@ -3,6 +3,7 @@ This file documents the major additions and syntax changes between releases.
 2.4.6 2023-08-01
 	FIXES
 	check_mailq: Correctly handle "Mail queue is empty" when monitoring Postfix over SSMTP (#611)
+	check_oracle: Reduce false positives when looking for "OK" messages (#723)
 	utils: Fix compiler warnings (#583, #637)
 
 2.4.5 2023-06-01

+ 1 - 1
plugins-scripts/check_oracle.sh

@@ -137,7 +137,7 @@ export ORACLE_HOME PATH LD_LIBRARY_PATH
 case "$cmd" in
 --tns)
     tnschk=$(tnsping "$2")
-    tnschk2=$(echo "$tnschk" | grep -c OK)
+    tnschk2=$(echo "$tnschk" | grep -Ec "^OK \([[:digit:]]+ msec\)")
     if [ "${tnschk2}" -eq 1 ] ; then 
         tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*}
         echo "OK - reply time ${tnschk3} from $2"