Greets all... Whipped up something personal which has something else eluding me...
grep -i denied /var/log/access.log |awk '{print $1,$2,$3,$4,$5,$6}' >> /tmp/`date +%b%d`.denied
hour=`date|awk '{print $4}'|sed 's/:/ /g'|awk '{print $1":"}'`
day=`date|awk '{print "2005.9."$3}'`
grep $day /tmp/*.denied|grep $hour
Simple lame script to check for anything denied in a log file which then sends it to /tmp which later emails me from cron. However... When the file is null (usually under 4k) it's still sending me mail... I thought of something like:
size=`ls -la /tmp/*denied |awk '{print $5}'`; if [ $size -gt "4000000" ]; then do something ; else echo die ; fi
Just tired, bored, and out of caffeine.
grep -i denied /var/log/access.log |awk '{print $1,$2,$3,$4,$5,$6}' >> /tmp/`date +%b%d`.denied
hour=`date|awk '{print $4}'|sed 's/:/ /g'|awk '{print $1":"}'`
day=`date|awk '{print "2005.9."$3}'`
grep $day /tmp/*.denied|grep $hour
Simple lame script to check for anything denied in a log file which then sends it to /tmp which later emails me from cron. However... When the file is null (usually under 4k) it's still sending me mail... I thought of something like:
size=`ls -la /tmp/*denied |awk '{print $5}'`; if [ $size -gt "4000000" ]; then do something ; else echo die ; fi
Just tired, bored, and out of caffeine.