NpsAwstats class

NpsAwstats used to generate advanced graphical web statistics with AWStats.

AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. click here to visit AWStats official website.

For smaller websites, we recommended to generate monthly or annual web statistics; For medium and large sites, we recommended to generate daily or hourly web statistics.

1.perl must be installed in NPS server,and can be found in PATH.

2.Config "awstats_include.inc"
If Apache or Lotus Notes/Domino native combined log format are used for your web server config,No need to change anything.
1.Edit the file:{$NPS_HOME}/awstats/conf/awstats_include.inc
set LogFormat to your log format,it must match your web server config。 See AWStats setup instructions in documentation to know how to configure your web server to have the required log format.
2.Delete the file:{$TEMP_ROOTPATH}/awstats/conf/awstats_include.inc

3.Log format configuration for Apache httpd in httpd.conf:
1)combined log format
CustomLog /logs/httpd/www.jwebstar.com_access_log combined
2)common log format
CustomLog /logs/httpd/www.jwebstar.com_access_log common

4.You can also set LogFile in awstats_include.inc(See AWStats setup instructions in documentation).
However,the set will lapse once called AddNpsFile() or AddFile() function.

The sample code will generate all monthly web statistics.

var site = session.GetSite('jwebstar');
var awstats = new NpsAwstats(site,'en');
awstats.AddFile('/weblogs/jwebstar%YY-24%MM-24%DD-24.log');

var today = new Date();
var year = today.getYear();
if (year < 2000) year = year + 1900;
var month = today.getMonth()+1;
awstats.ReportAllByMonth(year,month);

top

Method Summary