解决awstats跨月分析日志问题及其他改进
2010-07-02 17:51
435 查看
1。生成静态统计页面的脚本,每天执行一次
# more autolog
#!/bin/bash
pl=/usr/lib/cgi-bin/awstats.pl
static=/usr/lib/cgi-bin/awstats_buildstaticpages.pl
datadir=/data/webroot/awstats/
htmldir=/data/webroot/awstats/
datatime=$(date +%Y%m)
firstday=$(date +%d)
lastmonth=$(date +%m --date='1 days ago')
lastmonthyear=$(date +%Y%m --date='1 days ago')
domain1=www.china.com
domain2=cin.china.com
domain3=spo.china.com
echo $firstday
echo $lastmonth
echo $lastmonthyear
#创建当月目录
if [ -d $datadir$datatime ]; then
echo "$datadir$datatime目录存在 ."
else
mkdir $datadir$datatime
fi
#判断是否是月初第一天
if [ $firstday = "01" ]; then
echo "月初第一天 ."
#生成上月的静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -month=$lastmonth -year=2010 -awstatsprog=$pl -dir=$datadir$lastmonthyear
done
else
if [ $firstday = "02" ]; then
echo "月初第二天 ."
#生成当月静态统计页面并且更新web统计页面左侧导航链接
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
echo "<a href=/"$datatime/awstats.w.china.com.html/"target=main><font color=#0000ff>${datatime}wo</font></
a>
<a href=/"$datatime/awstats.cin.china.com.html/"target=main><font color=#0000ff>${datatime}movie</font></a>
<a href=/"$datatime/awstats.spt.china.com.html/"target=main><font color=#0000ff>${datatime}sport</font></a>" >$h
tmldir/tmp.html
cat $htmldir/indexleft.html >> $htmldir/tmp.html
mv $htmldir/tmp.html $htmldir/indexleft.html
else
echo "不是月初前2天 ."
#生成当月静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
fi
fi
2。分析页面使用frameset技术的导航
# more index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
<title></title>
</head>
<!-- <frameset rows="60, *"> -->
<frameset cols="11%, *">
<frame src="indexleft.html" />
<frame name="main" src="201007/awstats.www.china.com.html" />
<noframes>
<body>
</body>
</noframes>
</frameset>
</html>
3。导航页
# more indexleft.html
<a href="201007/awstats.www.china.com.html"target=main><font color=#0000ff>201007wo</font></a>
<a href="201007/awstats.cin.china.com.html"target=main><font color=#0000ff>201007movie</font></a>
<a href="201007/awstats.spt.china.com.html"target=main><font color=#0000ff>201007sport</font></a>
# more autolog
#!/bin/bash
pl=/usr/lib/cgi-bin/awstats.pl
static=/usr/lib/cgi-bin/awstats_buildstaticpages.pl
datadir=/data/webroot/awstats/
htmldir=/data/webroot/awstats/
datatime=$(date +%Y%m)
firstday=$(date +%d)
lastmonth=$(date +%m --date='1 days ago')
lastmonthyear=$(date +%Y%m --date='1 days ago')
domain1=www.china.com
domain2=cin.china.com
domain3=spo.china.com
echo $firstday
echo $lastmonth
echo $lastmonthyear
#创建当月目录
if [ -d $datadir$datatime ]; then
echo "$datadir$datatime目录存在 ."
else
mkdir $datadir$datatime
fi
#判断是否是月初第一天
if [ $firstday = "01" ]; then
echo "月初第一天 ."
#生成上月的静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -month=$lastmonth -year=2010 -awstatsprog=$pl -dir=$datadir$lastmonthyear
done
else
if [ $firstday = "02" ]; then
echo "月初第二天 ."
#生成当月静态统计页面并且更新web统计页面左侧导航链接
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
echo "<a href=/"$datatime/awstats.w.china.com.html/"target=main><font color=#0000ff>${datatime}wo</font></
a>
<a href=/"$datatime/awstats.cin.china.com.html/"target=main><font color=#0000ff>${datatime}movie</font></a>
<a href=/"$datatime/awstats.spt.china.com.html/"target=main><font color=#0000ff>${datatime}sport</font></a>" >$h
tmldir/tmp.html
cat $htmldir/indexleft.html >> $htmldir/tmp.html
mv $htmldir/tmp.html $htmldir/indexleft.html
else
echo "不是月初前2天 ."
#生成当月静态统计页面
for domain in $domain1 $domain2 $domain3;do
$static -config=$domain -update -awstatsprog=$pl -dir=$datadir$datatime
done
fi
fi
2。分析页面使用frameset技术的导航
# more index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
<title></title>
</head>
<!-- <frameset rows="60, *"> -->
<frameset cols="11%, *">
<frame src="indexleft.html" />
<frame name="main" src="201007/awstats.www.china.com.html" />
<noframes>
<body>
</body>
</noframes>
</frameset>
</html>
3。导航页
# more indexleft.html
<a href="201007/awstats.www.china.com.html"target=main><font color=#0000ff>201007wo</font></a>
<a href="201007/awstats.cin.china.com.html"target=main><font color=#0000ff>201007movie</font></a>
<a href="201007/awstats.spt.china.com.html"target=main><font color=#0000ff>201007sport</font></a>
相关文章推荐
- sql server 2005日志文件过大问题解决后分析--针对发布订阅产生的日志问题
- java动态加载指定的类或者jar包反射调用其方法-涉及其他jar中的类就报ClassNotFound问题分析及解决思路
- AWStats 日志分析工具【配置分析其他服务器nginx日志】
- rsyslog center诡异丢日志问题分析解决
- sql server 2005日志文件过大问题解决后分析--针对发布订阅产生的日志问题
- Awstats性能问题及其他工具的对比分析
- 通过分析服务器的日志,得到问题的解决方法
- 跟踪 session 的执行,分析跟踪日志文件,解决问题的好方法
- 改进动态设置query cache导致额外锁开销的问题分析及解决方法-mysql 5.5 以上版本
- Hadoop分析日志实例的详细步骤及出现的问题分析和解决
- java动态加载指定的类或者jar包反射调用其方法-涉及其他jar中的类就报ClassNotFound问题分析及解决思路
- awstats分析nginx日志访问404问题
- Java性能分析及问题解决(二)jvm致命错误导致进程直接挂掉,错误日志分析及解决
- 使用了PYG解密小组的Visual Assist X,就用不了其他的 ,问题分析解决
- Melis系统崩溃问题分析以及解决思路
- Selenium语法、解决frame问题以及速度分析
- 网上邻居文件共享、问题解决层次分析
- 强大的日志分析工具AWStats
- 利用告警日志分析、解决TM-TX锁
- 关于形如--error LNK2005: xxx 已经在 msvcrtd.lib ( MSVCR90D.dll ) 中定义--的问题分析解决