*** nagios-plugins-1.4/plugins-scripts/check_log.sh.orig Thu Feb 3 23:51:35 2005 --- nagios-plugins-1.4/plugins-scripts/check_log.sh Fri Oct 21 10:34:23 2005 *************** *** 61,71 **** PATH="" ECHO="/bin/echo" ! GREP="/bin/grep" DIFF="/bin/diff" TAIL="/bin/tail" CAT="/bin/cat" RM="/bin/rm" PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` --- 61,73 ---- PATH="" ECHO="/bin/echo" ! 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,198 **** else tempdiff=`/bin/date '+%H%M%S'` tempdiff="/tmp/check_log.${tempdiff}" ! /bin/touch $tempdiff ! chmod 600 $tempdiff fi $DIFF $logfile $oldlog > $tempdiff --- 193,200 ---- else tempdiff=`/bin/date '+%H%M%S'` tempdiff="/tmp/check_log.${tempdiff}" ! $TOUCH $tempdiff ! $CHMOD 600 $tempdiff fi $DIFF $logfile $oldlog > $tempdiff *************** *** 201,207 **** count=`$GREP -c "$query" $tempdiff` # Get the last matching entry in the diff file ! lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1` $RM -f $tempdiff $CAT $logfile > $oldlog --- 203,209 ---- count=`$GREP -c "$query" $tempdiff` # Get the last matching entry in the diff file ! lastentry=`$GREP "$query" $tempdiff | $TAIL -1` $RM -f $tempdiff $CAT $logfile > $oldlog