aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts
diff options
context:
space:
mode:
authorGravatar M. Sean Finney <seanius@users.sourceforge.net> 2005-10-29 15:38:40 +0000
committerGravatar M. 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 @@
PATH=""
ECHO="/bin/echo"
-GREP="/bin/grep"
+GREP="/bin/egrep"
DIFF="/bin/diff"
TAIL="/bin/tail"
CAT="/bin/cat"
RM="/bin/rm"
+CHMOD="/bin/chmod"
+TOUCH="/bin/touch"
PROGNAME=`/bin/basename $0`
PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
@@ -191,8 +193,8 @@ if [ -x /bin/mktemp ]; then
else
tempdiff=`/bin/date '+%H%M%S'`
tempdiff="/tmp/check_log.${tempdiff}"
- /bin/touch $tempdiff
- chmod 600 $tempdiff
+ $TOUCH $tempdiff
+ $CHMOD 600 $tempdiff
fi
$DIFF $logfile $oldlog > $tempdiff
@@ -201,7 +203,7 @@ $DIFF $logfile $oldlog > $tempdiff
count=`$GREP -c "$query" $tempdiff`
# Get the last matching entry in the diff file
-lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1`
+lastentry=`$GREP "$query" $tempdiff | $TAIL -1`
$RM -f $tempdiff
$CAT $logfile > $oldlog