PDA

View Full Version : Finally took the plunge...


tbonekkt
11-13-03, 04:09 PM
...and installed awstats. It works great from what I can tell so far.... I have my crontab to execute at 1:20am so we'll see tomorrow if the auto-update works.

But of course, I do have a couple questions.

1) I've searched through this forum and found conflicting answers about whether or not the stats auto-update when the option to manually update on the web is enabled. Can someone confirm either way?

2) Why do people have their crontabs scheduled to update stats on every hour? I thought our access logs are updated/rolled once a day at midnight. I could be wrong, but that to me means that our stats are the same for the time between log rotations... What purpose does setting awstats to update every hour serve?

Thanks!

EDIT:
Two more questions ;)

3) I have a few older logs (access_log.2, .3, .4) - how can I get them analyzed? Is it as simple as changing the log path in the conf file?

4) Do I assume that awstats stores the access data somewhere other than the access_logs themselves? So I further assume that data is the awstats112003.www.mydomain.com.txt file, right?

stevel
11-13-03, 05:10 PM
1. Enabling manual update does not disable auto-update - this is how I have mine set.

2. People who update every hour tell awstats to look at the current log, rather than yesterday's final log. I think this is pointless, myself...

3. Yes, or there is a script that comes with awstats that will concatenate them for you. Be sure to process in ascending chronological order.

4. You got it.

tbonekkt
11-13-03, 05:33 PM
Thanks Steve. I just set my crontab to run at :35 past the hour so we'll see if it works. :)

tbonekkt
11-13-03, 05:48 PM
It didn't seem to update... Could be that the system clock is off...

In the meantime, could someone check my crontab for syntax problems?
35 * * * /www/u/username/cgi-bin/awstats/awstats.pl -config=domain.com -updateThe crontab does reflect my actual path and domain. I have three full blank lines after the above code.

Nino
11-13-03, 06:05 PM
Originally posted by tbonekkt
Why do people have their crontabs scheduled to update stats on every hour? I thought our access logs are updated/rolled once a day at midnight. I could be wrong, but that to me means that our stats are the same for the time between log rotations... What purpose does setting awstats to update every hour serve?


I don't think it makes sense to set AWSTATS to update every hour. And naturally, doing so increases the load on the server (if everyone does it!).
I have mine set to update once a day. If I want to look at it sometime during the day, I simply click the link to manually update it at that moment and the data is refreshed.
The auto-update setting is useful because it ensures the stats are refreshed before the logs roll over.

As Stevel says, you can point the script to the previous day's logs and you won't have to worry about the roll-over issue. That will ensure you get all of the hits for that day, whereas if you point the script to the current days log, you will lose the stats for the time period between when the script runs and when the logs roll-over.
However, it's a trade off: pointing the script to the previous day's log means manual refresh does not work (since you will be refreshing from the previous day's logs!).
I was thinking of modifying the code to allow the user the option of pointing the auto-update function and the refresh function each to different log files, but I'm not a perl programmer, and I think this is written in perl (correct me if I'm wrong). However, it still shouldn't be to difficult to modify and I might have a go at it if I find the time.

Nino

RocketJeff
11-13-03, 06:08 PM
Originally posted by tbonekkt
[B]In the meantime, could someone check my crontab for syntax problems?
You have: 35 * * * <command>

There are 5 fields for the time (minute, hour, day, month, weekday), and you only have 4...

Try: 35 * * * * <command>

tbonekkt
11-13-03, 06:26 PM
Originally posted by RocketJeff
Try: 35 * * * * <command> Thanks RocketJeff. I fixed it and will see if it works. :)

tbonekkt
11-13-03, 07:35 PM
Can someone tell me what this means from my cron error log?

Phase 1 : First bypass old records, searching new record...
Direct access after last updated record successfull (after line 3296)
Jumped lines in file: 3296
Found 3296 old records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualifed records.

Will the time on the awstats.pl be updated if the cronjob runs successfully but without any new records?

Nino
11-13-03, 08:01 PM
Originally posted by tbonekkt
Can someone tell me what this means from my cron error log?

Phase 1 : First bypass old records, searching new record...
Direct access after last updated record successfull (after line 3296)
Jumped lines in file: 3296
Found 3296 old records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualifed records.


I believe those are regular execution status/progress messages. They are errors only if you know they're false (although finding 0 old records and finding 3296 old records doesn't sound right, this is probably because more than one function is reporting it's output).
I sometimes do the same thing with PHP scripts when I'm debugging.



Originally posted by tbonekkt

Will the time on the awstats.pl be updated if the cronjob runs successfully but without any new records?

Yes, when I run it the time updates even if there are no new records.

tbonekkt
11-13-03, 08:04 PM
hmmm...so what do you think my problem could be? I wouldn't think it would have to do with me adding the 'awstats' folder...do you?

Nino
11-13-03, 08:18 PM
Originally posted by tbonekkt
hmmm...so what do you think my problem could be? I wouldn't think it would have to do with me adding the 'awstats' folder...do you?

I doubt it because I also added that folder.
I can tell you that there have been times when my AWSTATS did not run for 2 or 3 days and then starting running again without any intervention from me. This has happenned a handful of times and I chalk it up to the price of shared hosting. :(
I'm forced to believe many of the problems that occur with AWSTATS (once you have it auto-updating the first time) has to do with the cron running on the server and/or things that are done to the server without our knowledge (and without notification!).
This means the hard part is to get it working the first time, because you have to wonder if you did something wrong or if you are experiencing one of those periods when the server is acting funny.
These kind of problems is one of the reasons why I run a second Stats application that does not rely on cron: PPHLogger.
It uses PHP and MySQL. So if cron isn't working and MYSql is ok, then I still have stats, and the reverse is also true. They also differ in a couple of features.

Nino

jimnyc
11-13-03, 10:27 PM
Originally posted by tbonekkt
hmmm...so what do you think my problem could be? I wouldn't think it would have to do with me adding the 'awstats' folder...do you?

Does it work if you run it manually?

If so, the problem would be with your crontab. I've tried every way imaginable and always got mixed results.

The only sure fire way I found is with "UltraEdit32". A great text editor. I add the code and then hit enter JUST ONCE and save the file as "crontab". Uploaded in ASCII and never had issues. I've changed often and never had it not work doing it this way.

If you want to take a look at it, here's a link:
http://www.ultraedit.com/downloads/index.html

tbonekkt
11-13-03, 10:55 PM
Originally posted by jimnyc
Does it work if you run it manually?

If so, the problem would be with your crontab. I've tried every way imaginable and always got mixed results. Yes - it works when I run it manually. So I also made the assumption the problem was the crontab.

Originally posted by jimnyc
The only sure fire way I found is with "UltraEdit32". A great text editor. I add the code and then hit enter JUST ONCE and save the file as "crontab". Uploaded in ASCII and never had issues. I've changed often and never had it not work doing it this way.

If you want to take a look at it, here's a link:
http://www.ultraedit.com/downloads/index.html I used Notepad...didn't think it could get more basic than that...

tbonekkt
11-14-03, 02:27 PM
Let's just say I must have been smoking some of paulselhi's weed yesterday... ;)

So I look at my crontab and notice that I misspelled a word. I fixed it and BAM! Auto-updating works.

Thanks to everyone who helped! :)

stevel
11-14-03, 02:47 PM
Yeah, I had a similar problem when I started out. Looked over the command line so carefully, several times, and didn't notice THREE separate errors I had made! Once I got those straightened out, it worked fine and hasn't missed a beat in almost two months.

tbonekkt
11-14-03, 02:48 PM
My coworkers heard the Homer "D'Oh!" this morning when I saw my problem. :D