#!/bin/sh
today=`LANG=c date +"%d/%h/%Y"`
echo $today
cat /var/log/httpd/access_log | awk '{print $7}' > /var/tmp/a-log3
cat /var/log/httpd/access_log | grep $today | awk '{print $1}' | \
sed 's/^/\dig -x /g' > /var/tmp/a-log1
chmod 744 /var/tmp/a-log1
/var/tmp/a-log1 > /var/tmp/a-log2
grep PTR /var/tmp/a-log2 | awk '{print $5}' | grep "." > /var/tmp/a-log4
paste -d: /var/tmp/a-log4 /var/tmp/a-log3 | sed '/^:/d' | sed 's/:/ /g' | \
grep -v localhost
rm -f /var/tmp/a-log*
Comments