summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
authorM. Sean Finney <seanius@users.sourceforge.net>2005-10-29 15:38:40 +0000
committerM. Sean Finney <seanius@users.sourceforge.net>2005-10-29 15:38:40 +0000
commite082e8565f5f54916511f01eabfab1427503813d (patch)
treecade2ee08dfb56682800c94927896d41e761402d /plugins-scripts
parente2e455a53ef11e27d7ba54db2f11b2caf09c79f2 (diff)
downloadmonitoring-plugins-e082e8565f5f54916511f01eabfab1427503813d.tar.gz
check_log fixes from Ade Rixon
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1263 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_log.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
index 0da732d2..8145bba9 100755
--- a/plugins-scripts/check_log.sh
+++ b/plugins-scripts/check_log.sh
@@ -61,11 +61,13 @@
61PATH="" 61PATH=""
62 62
63ECHO="/bin/echo" 63ECHO="/bin/echo"
64GREP="/bin/grep" 64GREP="/bin/egrep"
65DIFF="/bin/diff" 65DIFF="/bin/diff"
66TAIL="/bin/tail" 66TAIL="/bin/tail"
67CAT="/bin/cat" 67CAT="/bin/cat"
68RM="/bin/rm" 68RM="/bin/rm"
69CHMOD="/bin/chmod"
70TOUCH="/bin/touch"
69 71
70PROGNAME=`/bin/basename $0` 72PROGNAME=`/bin/basename $0`
71PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` 73PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
@@ -191,8 +193,8 @@ if [ -x /bin/mktemp ]; then
191else 193else
192 tempdiff=`/bin/date '+%H%M%S'` 194 tempdiff=`/bin/date '+%H%M%S'`
193 tempdiff="/tmp/check_log.${tempdiff}" 195 tempdiff="/tmp/check_log.${tempdiff}"
194 /bin/touch $tempdiff 196 $TOUCH $tempdiff
195 chmod 600 $tempdiff 197 $CHMOD 600 $tempdiff
196fi 198fi
197 199
198$DIFF $logfile $oldlog > $tempdiff 200$DIFF $logfile $oldlog > $tempdiff
@@ -201,7 +203,7 @@ $DIFF $logfile $oldlog > $tempdiff
201count=`$GREP -c "$query" $tempdiff` 203count=`$GREP -c "$query" $tempdiff`
202 204
203# Get the last matching entry in the diff file 205# Get the last matching entry in the diff file
204lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1` 206lastentry=`$GREP "$query" $tempdiff | $TAIL -1`
205 207
206$RM -f $tempdiff 208$RM -f $tempdiff
207$CAT $logfile > $oldlog 209$CAT $logfile > $oldlog