Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Windows98/ME > 从DOMINO的输出文本中统计Internet邮件量
【标  题】:从DOMINO的输出文本中统计Internet邮件量
【关键字】:DOMINO,Internet
【来  源】:http://www.cublog.cn/u/21216/showart.php?id=161768

从DOMINO的输出文本中统计Internet邮件量

Your Ad Here
对于运行在UNIX OS上的DOMINO邮件系统,通常都会设置一个启动SHELL脚本来启动DOMINO服务器。下面就是一个AIX OS上的DOMINO服务器启动脚本示例:
 
# more Start_Server

!/bin/ksh -x
# Domino Server Start Script
# (注释部分省略)
NOTES_USER=notes                # AIX userid for this server
NOTES_PATH=/notesdata           # Path for server data directory
NOTES_SERVER=mailsrv1              # Name of Domino Server
OUTPUT_LOG=/tmp/$NOTES_SERVER.log # Output file for server console
INPUT_FILE=$NOTES_PATH/$NOTES_USER.input # 主要目的是存放服务器ID文件口令
PATH=$NOTES_PATH:/opt/lotus/bin:$HOME/bin:$PATH

# Script Logic
if ((`id -u` == 0))
then
print "Run the Domino Server as the $NOTES_USER user "
exit
fi
#
# if you are using /etc/hosts for tcpip name resolution rather than a name
# server or NIS, then uncomment the following line:
#export NSORDER=local,bind,nis
#
if [ ! -x /opt/lotus/bin/server ] ; then
echo "Cannot access server command - exiting"
exit 1
fi
if [ ! -d $NOTES_PATH ] ; then
echo "Cannot access notes data directory - exiting"
exit 1
fi
cd $NOTES_PATH
#
# Clean up if the Domino Server terminated abnormally
#
# rm -f ~notes.lck
# mems=`ipcs | grep $NOTES_USER | awk '{ print $1 $2 }' | awk -F"m" '{ print $2 }' | awk '{ print $1 }'`
# sems=`ipcs | grep $NOTES_USER | awk '{ print $1 $2 }' | awk -F"s" '{ print $2 }' | awk '{ print $1 }'`
# for j in $mems;do if [ -n "$j" ] ; then ipcrm -m $j;fi;done
# for j in $sems;do if [ -n "$j" ] ; then ipcrm -s $j;fi;done
#
# Notesbench environment variables
#
# export DEBUGSIGCHILD=1
# export DEBUG_SHOW_TIMEOUT=1
#
# export Notes_SHARED_DPOOLSIZE=230686720
#
# For running debug versions of executables
# export LIBPATH=/lib:/usr/lib:/opt/lotus/notes/latest/ibmpow
#
echo "password" > $INPUT_FILE
#
cp -p $OUTPUT_LOG $OUTPUT_LOG.`date +"%m%d%y_%H%M"`
print "Starting Domino for AIX ($NOTES_SERVER)"
server < $INPUT_FILE > $OUTPUT_LOG 2>&1 &
 
从上面的脚本示例中,可以看出:Domino服务器在运行期间将其产生的所有输出全部重订向到/tmp/mailsrv1.log文件中,其中包括与Internet的邮件交换简要信息。
 
接下来,我们来了解SMTP连接的日志记录,参见下面日志记录项。很明显的,只需能够统计出“1 message[s] received”中数据和,也就达到了目的。
 
2006-08-14 07:13:06 PM  SMTP Server: 101.133.109.131 connected
2006-08-14 07:13:06 PM  SMTP Server: Message 003D9FE7 received
2006-08-14 07:13:06 PM  SMTP Server: 101.133.109.131 disconnected. 1 message[s] received
 
于是,我们就可以利用awk工具分离出需要的项目,累加即可。下面脚本演示了当日Internet邮件交换总量的统计过程。
 
!/bin/ksh
strToday=`date +"%y-%m-%d"`
echo $strToday > /tmp/strToday
cat /tmp/mailsrv1.log | grep -f /tmp/strToday |  \
    grep disconnected | \
    awk 'BEGIN {summary=0} {summary += $8}  \
    END {print "今日的Internet邮件总量:",summary}'
 
 
 
[精彩] 转 鸟哥學習 Shell Scripts:【上一篇】
Apache服务器高级设置指南:【下一篇】
【相关文章】
  • How To Study Over the Internet?
  • Internet Explorer 7 开发完成!
  • Internet Explorer 7 Beta 3 For Windows XP SP2 更新!
  • Internet Explorer 7 Beta 2 卸载工具包
  • Kaspersky Anti-Virus & Internet Security v6.0.1.366 Beta
  • Kaspersky Anti-Virus & Internet Security 6.0.1.365 Beta
  • 文件系统不支持大文件致使Domino数据库损坏
  • connect to internet from a virtual LAN
  • 什么是INTERNET2
  • HOWTO: Connect to a Running Instance of Internet Explorer
  • 【随机文章】
  • Visual C++/MFC入门教程
  • 十天学会ASP之第二天
  • Java 访问数据库的速度瓶颈问题的分析及解决(1)
  • 完美解决一个事件激活多个函数
  • 今天开始embedding...
  • 用匈牙利算法求二分图的最大匹配
  • 大内存的新用途--用内存空间建虚拟盘
  • linux下通过eclipse使用SVN
  • J2EE和SunONE软件构架
  • shawl.qiu ASP 正则调试器 v1.0
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.