Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Shell Script to deliver log into email..
IN this particular example bash script will deliver email if log is more than 2 at given time (and ofcourse uniq).

#!/bin/sh
tail -100 /var/log/secure | cut -c 10-15 | sort -n | uniq -c | while read output
do
echo $output
main=$(echo $output | cut -d' ' -f1)
if [ $main -lt 2 ];then
echo "might be critical" "On Time : $output" | mail -s "Alert: could be outage" email@domain.com
echo "***********Delivering Email***********"
fi
done