Awstats does not show September's stat!

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,188
Location
GMT +7.00
Hi!

Today is October, 1st, and awstats does not show September's stat! Instead it shows empty October's stats.

Need to wait for tomorrow? Or it is a bug?
 
This looks like a new bug introduced in DirectAdmin 1.36.2. I have sent DirectAdmin support a support ticket about this. Hopefully he will have a fix for the next release of DA.

Edit: By the way, the october stats is working, you just have to wait until the next night when the statistic for 1 day of october is generated. But the entire september month is empty, so that is a bug. Older months still show statistic. So it looks like when DA fixed the bug that the last day of month never showed any statistic, it got worse and now the entire last month is not showing any statistic. :)
 
Last edited:
I've checked some boxes here and didn't find any problems. Here AWStats is working perfectly, also for the month September.
 
Last edited:
Solution inside!

Created a simple script to re-build all stats for September:

Code:
# cat /home/rebuild-awstats-092010.sh
Code:
#!/bin/sh
#----------------------------------------------------------------------
# Author: zEitEr (http://www.directadmin.com/forum/showthread.php?p=188477)
# Created at: Oct  02 13:41:41 NOVST 2010
# Updated at: Oct  07 15:33:41 NOVST 2010
#----------------------------------------------------------------------
for username in `ls -1 /usr/local/directadmin/data/users`; do
{
    echo "=> Found ${username}";
    for domain in `ls -1 /home/${username}/domains/`; do
    {
        echo "==> Found ${domain} for ${username}";
        if [ -d "/home/${username}/domains/${domain}/awstats" ]; then
        {
            echo "===> Gonna rebuild Awstats for September 2010 on ${domain}";
            perl /usr/local/awstats/tools/awstats_buildstaticpages.pl \
                -awstatsprog=/usr/local/awstats/wwwroot/cgi-bin/awstats.pl \
                -config=${domain} \
                -year=2010 -month=09 \
                -configdir=/home/${username}/domains/${domain}/awstats/.data \
                -dir=/home/${username}/domains/${domain}/awstats \
                -builddate=$Y$M \
                -diricons=icon 2>&1 1>/dev/null
        }
        fi;
    }
    done;
}
done;
 
Last edited:
I've checked some boxes here and didn't find any problems. Here AWStats is working perfectly, also for the month September.

I am running CentOS 5.5 64bit and DirectAdmin version 1.36.2, and still the entire septemeber month is empty. What OS and version are you running?

Daily stats for october shows fine.
 
Why don't you use my script to re-build all awstats files for September?
 
another thing, that script doesnt work.. and..

on the top of the semptember 2010 stats ive this line

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "it_IT.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").

that line is not present in all old months and on Present stats.

Any glue and/or idea?

Thanks
 
Hello,

The local/lang bit might be related to the LANG part of the environment. Check yours with:
Code:
echo $LANG
Try running
Code:
LANG=en_US.UTF-8
export LANG
to see if that sorts it out (then run the awstats_process.sh)

As for the original issue, I've done some work. Since there was no simple (moreso "effcient") way of dividing the logs so that the first few ours of the current month doesn't bleed over, what I've done is reverted back to the old simpler html method, at the cost of missing the last day of the month stats.

However, since that wasn't a good solution either, I've finally added support the cgi version of awstats.pl as well. So by default, both the html and cgi versions will work. (the cgi version is really only copying some pl files, and other bits, and it uses the data files that area already there)

If you'd like to try the new script (I've done some basic testing, but not a huge amount), run this command:
Code:
cd /usr/local/directadmin/scripts
wget -O awstats_process.sh http://files.directadmin.com/services/all/awstats/awstats_process.sh
then either wait for the next tally to run, or check it now with:
Code:
./awstats_process.sh [b]username domain.com[/b]

The html version still uses the index.html (for DA access), but for the cgi version, it's in the same directory and the file is called awstats.pl, however I've added a DirectoryIndex value in the .htaccess, so when you access /awstats from apache, you'll get the cgi version by default, along with all stats, old months, etc.. (the data was not lost)

Please report any errors with the script to this thread.

John
 
Hi John,

those are the results

>echo $LANG
it_IT@euro


so i tryed to turn into utf as you described then downloaded the script and started it with those "errors"

Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

At the end the script craeted a Main HTML page is 'awstats.DOMAIN.1010.html'. file.. but.. is 1010 not september.. and.. september didnt change


When i activate the /stats link on directadmin the stast are not up2date

Code:
Ultimo Aggiornamento: 	Non aggiornato (Vedi 'Build/Update' sulla pagina awstats_setup.html)

That is the italian lang so, the tranlation is

Last update: Not updated (see build/update on awestats_setup.html)

Honestly i prefer the cgi version for some reason (example the left menu) but this seems to not be updated correctly.

the error
Code:
perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "it_IT.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").

seem to be presend in each page of stats excluding the "Present" one so, is not a big problem.. the big one is september 2010 that seems that some customers need that stats for commercial use.

Hope you got some new test to let me try for fix this issue.

Thanks for your support.
 
Hello,

Use the above awstats_process.sh. I've been using it for a while now without any issues. A full DA update won't be happening today as the binaries still require a pre-release test for their other new features, and this awstats fix is not related to the DA binaries. Just grab the awstats_process.sh script manually.

John
 
Thanks. But it is not clear to me what exactly to do, and what is going to happen when I do it. Is this the only thing I need to do in order to not lose the complete month but only a day?:

Code:
cd /usr/local/directadmin/scripts
wget -O awstats_process.sh http://files.directadmin.com/services/all/awstats/awstats_process.sh

Will I have to create some .htaccess code etc? Is it necessary to do anything else for existing user accounts to be reverted? It is just not clear to me ...
 
Hello,

Correct, just run that wget command in the scripts directory to get the new awstats_process.sh.

The new script will take care of everything for you. It will setup the .htaccess files for you, add the awstats.pl script, etc.. You don't need to do anything other than downloading the new file.

John
 
Back
Top