Explorar el Código

check_log lost ability to use regexes for query (-q) in 2.1.4

Fix for issue #258
John C. Frickson hace 8 años
padre
commit
cd53a82944
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      NEWS
  2. 2 2
      plugins-scripts/check_log.sh

+ 1 - 0
NEWS

@@ -18,6 +18,7 @@ This file documents the major additions and syntax changes between releases.
 	check_ntp_time calls `write` on a UDP socket without a successful call to `connect`
 	check_mysql_query & mysql_query: extra-opts causes crash
 	check_log does not check for "-O oldlog"
+	check_log lost ability to use regexes for query (-q) in 2.1.4
 
 
 2.2.1 2017-04-19

+ 2 - 2
plugins-scripts/check_log.sh

@@ -215,10 +215,10 @@ fi
 diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
 
 # Count the number of matching log entries we have
-count=$(grep -c "$query" "$tempdiff")
+count=$(egrep -c "$query" "$tempdiff")
 
 # Get the last matching entry in the diff file
-lastentry=$(grep "$query" "$tempdiff" | tail -1)
+lastentry=$(egrep "$query" "$tempdiff" | tail -1)
 
 rm -f "$tempdiff"
 cat "$logfile" > "$oldlog"