博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

Ajian的学习天地


简单人生 Simple Life

生存是为了自己。。。。 而生活是为了所有的人。。。。自己快乐就能感染不快乐的人。自己学会快乐也就教会别人快乐。。。。 所以从现在起学会生活,学会快乐。。-----Ajian

  ajian.cublog.cn

关于作者
姓名: Ajian
年龄: 21
职位: 系统工程师
Q Q:  63894624
MSN:  5root@live.cn
mail: 5root@live.cn
   转眼一年过去了,凭着自己的热情和执着,实现了自己不少的愿望,可以慢慢还我欠下的所有的情,其中不枉有很多艰辛也有很多乐趣,新的一年继续加油!A ZA A ZA ^_^
   补充句我的Blog搬家了,新家的地址http://www.AjianZone.cn
|| << >> ||
我的分类


Postfix日志分析脚本
   
#!/bin/sh
# statistic recipient
echo "Part one : - Top 10 Recipient domain "
fgrep to= /var/log/maillog | cut -d\< -f2 | cut -d\> -f1 | cut -d@ -f2 | sort | uniq -c | sort -nr |head

# statistic sender
echo "Part two: - Top 10 Sender domain "
fgrep from= /var/log/maillog | cut -d\< -f2 | cut -d\> -f1 | cut -d@ -f2 | sort | uniq -c | sort -nr | head

# statistic destination mail total count
echo "Part three: Total lines and sizes of log, And total mail sent"
cat /var/log/maillog | fgrep status=sent | wc -l | awk '{ print $1 }'

echo ""; echo "Scanning maillog for rejections:"
cat -fc /var/log/maillog | egrep reject: | cut -d : -f 5- | sort | uniq -c | sort -nr | grep -v '^  *[1-2]  *[^ ]* [^ ]* from [^ ]*: 450 '

echo "Scanning maillog for warnings:"
cat /var/log/maillog | egrep warning: | cut -d : -f 5- | sort | uniq -c

echo "Scanning maillog for trouble:"
cat /var/log/maillog | egrep '(fatal|panic):'

发表于: 2007-11-07,修改于: 2007-11-07 19:43,已浏览536次,有评论0条 推荐 投诉


网友评论
 发表评论