rerun webalizer & DA utilization stats

donco

Verified User
Joined
Feb 5, 2004
Messages
45
It looks like our apache logs were incomplete for the last several days. We have the complete apache logs, but I need to verify how to rerun the webalizer stats & generate new DA utilization statistics.

Just to be abundantly clear, the webalizer stats have already successfully run, but the apache logs used by DA/webalizer to create their statistics were incomplete.

How would we regenerate the daily usage metrics?

My stab in the dark is to:
1. Reset everything to zero by running:
Code:
echo 'action=reset&value=all' >> /usr/local/directadmin/data/task.queue
2. Move the day's logs to parse in place for all web domains (thankfully only 4 of them) and run the following:
Code:
echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
Manually rotate the logs out of the way (if necessary), and repeat step 2 above for each day of the month to present.

Will this allow us to successfully re-parse all the days in the month of December to present?

Thanks for your attention,
-the donco
 
I just quickly read over it and that would be my guess, however youd don't need to reset unless you are really trying to resel all usage halfway through the month.
 
Wouldn't that be necessary if one was wanting to retally each day of the month?

DA seems to keep usage info in a simple flat file (bandwidth.tally) with no date encoding (simply one bandwidth usage tally for a day per line) and of course the month to date tally (user.usage). It would seem that I would need to clear the contents of the bandwidth tallies before recomputing them to avoid double usage charging! :eek:

UPDATE: I just noticed that the bandwidth.tally file format has changed. Now a datestamp does exist (standard unix epoch format). I suppose that could be handled by simply saving the original file, and then manually updating the epoch stamp back to it's original value between each parsing.

I'll give this a try, but heaven (or DA support staff :D) help me if I make things worse. :(

Regards,
-the donco
 
The calculated usage each day is simply added to the value stored in the file and resaved. At least that's how it used to work.

You don't need to reset every day unless that's what your really trying to do. If you only want it to reset on the 1st of each month, leave it alone.
 
Greetings jmstacey,

I'm not entirely sure you understand my problem.

The apache logs used by DirectAdmin for computing bandwidth utilization & webalizer for December 1st thru December 11th are invalid. We have the correct files, but they were being output to the wrong directory. This has been fixed.

So, now I've got DirectAdmin & webalizer reporting a small fraction of their actual usage for this month. How do I update DirectAdmin & webalizer with the correct apache logs?

My guess is to try step 1, then repeat step 2 for each day that requires reparsing. By your response it seems like you interpreted the above to mean that I want to reset stats daily (step 1), which is purely ludicrous.

Regards,
-the donco
 
I apologize, I did misunderstand and was thinking you were going to run the reset command every day.

Your method should work. Depending on how many logs you have it might also be worth writing a small shell script to do them automatically and save some man hours.
 
You might want to send DA an email and ask if the timestamp affects anything and find out if resetting is even necassary.

Personally, I'd be tempted to try it without reseting and just see if DirectAdmin would handle it.

I think the bandwidth.tally file is just temporary for the last tally, since the bandwidth usage is also stored in user.usage
 
Back
Top