[Nagiosplug-checkins] nagiosplug/plugins-scripts check_log.sh,1.4,1.5
M. Sean Finney
seanius at users.sourceforge.net
Sat Oct 29 08:40:28 CEST 2005
Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7437/plugins-scripts
Modified Files:
check_log.sh
Log Message:
check_log fixes from Ade Rixon
Index: check_log.sh
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_log.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- check_log.sh 3 Feb 2005 23:51:35 -0000 1.4
+++ check_log.sh 29 Oct 2005 15:38:40 -0000 1.5
@@ -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 @@
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 @@
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
More information about the Commits
mailing list