Procházet zdrojové kódy

Merge branch 'paulbruedgam-issue722'

Sebastian Wolf před 2 roky
rodič
revize
c1ea2c6b3b
2 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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"