Server+Daily+Report

Daily script to run on Mac OS X Server to provide admins with a daily report.
PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH
 * 1) !/bin/sh

echo "From: Server Daily Report " > /tmp/Daily.txt echo "To: you@domain.edu" >> /tmp/Daily.txt echo "Subject: Daily Report" >> /tmp/Daily.txt echo "DAILY NEWS" >> /tmp/Daily.txt echo `date` >> /tmp/Daily.txt echo " " >> /tmp/Daily.txt echo "UPTIME" >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt echo `uptime` >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt echo " " >> /tmp/Daily.txt echo "BAD PASSWORD" >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt grep -i "response doesn't match" /var/log/system.log >> /tmp/Daily.txt grep -i "Authentication failure" /var/log/system.log >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt echo " " >> /tmp/Daily.txt echo "ILLEGAL SUDO ATTEMPT" >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt grep -i "NOT in sudoers" /var/log/system.log >> /tmp/Daily.txt echo "--" >> /tmp/Daily.tx techo " " >> /tmp/Daily.txt echo "FREE SPACE" >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt df -klh >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt echo " " >> /tmp/Daily.txt echo "CURRENTLY ESTABLISHED CONNECTIONS" >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt netstat -an | grep ESTABLISHED | grep IP_OF_YOUR_SERVER >> /tmp/Daily.txt echo "--" >> /tmp/Daily.txt

cat /tmp/Daily.txt | sendmail -f you@domain.edu -t
 * 1) cat /tmp/Daily.txt | mail -s "Daily Report" root@localhost