forked from pool/monitoring-plugins
4db29d7900
Enhancements * check_curl: Add an option to verify the peer certificate & host using the system CA's Fixes * check_icmp: fix simple typo, conspicuosly -> conspicuously * check_curl: fixed help, usage and errors for TLS 1.3 * check_curl: fixed a potential buffer overflow in url buffer * check_dns: split multiple IP addresses passed in one -a argument * check_curl: added string_statuscode function for printing HTTP/1.1 and HTTP/2 correctly * check_curl: fix crash if http header contains leading spaces * check_curl: display a specific human-readable error message where possible * check_pgsql: Using snprintf which honors the buffers size and guarantees null termination. * check_snmp: put the "c" (to mark a counter) after the perfdata value * check_http: Increase regexp limit * check_http: make -C obvious * check_curl: Increase regexp limit (to 1024 as in check_http) * check_curl: make -C obvious (from check_http) - refreshed patches: + monitoring-plugins-1.4.6-no_chown.patch + monitoring-plugins-2.1.1-check_logfile.patch + monitoring-plugins-2.2-mariadb_102_build_fix.patch + monitoring-plugins-2.3-check_ntp_perf_absolute.patch + monitoring-plugins-too_few_arguments_for_check_disk.patch + monitoring-plugins-wrong_return_in_check_swap.patch + monitoring-plugins.check_hpjd.c-64bit-portability-issue.patch + monitoring-plugins.check_snmp.arrayaddress.patch - add sha1 checksum file as source OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins?expand=0&rev=85
91 lines
2.4 KiB
Diff
91 lines
2.4 KiB
Diff
Index: monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
|
===================================================================
|
|
--- monitoring-plugins-2.3.1.orig/plugins-scripts/check_log.sh
|
|
+++ monitoring-plugins-2.3.1/plugins-scripts/check_log.sh
|
|
@@ -115,27 +115,27 @@ while test -n "$1"; do
|
|
exit $STATE_OK
|
|
;;
|
|
--filename)
|
|
- logfile=$2
|
|
+ logfile="$2"
|
|
shift
|
|
;;
|
|
-F)
|
|
- logfile=$2
|
|
+ logfile="$2"
|
|
shift
|
|
;;
|
|
--oldlog)
|
|
- oldlog=$2
|
|
+ oldlog="$2"
|
|
shift
|
|
;;
|
|
-O)
|
|
- oldlog=$2
|
|
+ oldlog="$2"
|
|
shift
|
|
;;
|
|
--query)
|
|
- query=$2
|
|
+ query="$2"
|
|
shift
|
|
;;
|
|
-q)
|
|
- query=$2
|
|
+ query="$2"
|
|
shift
|
|
;;
|
|
-x)
|
|
@@ -157,10 +157,10 @@ done
|
|
|
|
# If the source log file doesn't exist, exit
|
|
|
|
-if [ ! -e $logfile ]; then
|
|
+if [ ! -e "$logfile" ]; then
|
|
echo "Log check error: Log file $logfile does not exist!"
|
|
exit $STATE_UNKNOWN
|
|
-elif [ ! -r $logfile ] ; then
|
|
+elif [ ! -r "$logfile" ] ; then
|
|
echo "Log check error: Log file $logfile is not readable!"
|
|
exit $STATE_UNKNOWN
|
|
fi
|
|
@@ -169,8 +169,8 @@ fi
|
|
# we're running this test, so copy the original log file over to
|
|
# the old diff file and exit
|
|
|
|
-if [ ! -e $oldlog ]; then
|
|
- cat $logfile > $oldlog
|
|
+if [ ! -e "$oldlog" ]; then
|
|
+ cat "$logfile" > "$oldlog"
|
|
echo "Log check data initialized..."
|
|
exit $STATE_OK
|
|
fi
|
|
@@ -184,20 +184,20 @@ if [ -x /bin/mktemp ]; then
|
|
else
|
|
tempdiff=`/bin/date '+%H%M%S'`
|
|
tempdiff="/tmp/check_log.${tempdiff}"
|
|
- touch $tempdiff
|
|
- chmod 600 $tempdiff
|
|
+ touch "$tempdiff"
|
|
+ chmod 600 "$tempdiff"
|
|
fi
|
|
|
|
-diff $logfile $oldlog | grep -v "^>" > $tempdiff
|
|
+diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
|
|
|
|
# Count the number of matching log entries we have
|
|
-count=`grep -c "$query" $tempdiff`
|
|
+count=`grep -c "$query" "$tempdiff"`
|
|
|
|
# Get the last matching entry in the diff file
|
|
-lastentry=`grep "$query" $tempdiff | tail -1`
|
|
+lastentry=`grep "$query" "$tempdiff" | tail -1`
|
|
|
|
-rm -f $tempdiff
|
|
-cat $logfile > $oldlog
|
|
+rm -f "$tempdiff"
|
|
+cat "$logfile" > "$oldlog"
|
|
|
|
if [ "$count" = "0" ]; then # no matches, exit with no error
|
|
echo "Log check ok - 0 pattern matches found"
|