monitor apache webhits with rotated logfiles?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
moojoo
Posts: 6
Joined: Fri Apr 11, 2003 1:06 am
Location: Germany

monitor apache webhits with rotated logfiles?

Post by moojoo »

Hi there,

since i'm using cacti for a few days i have a question about monitoring webhits with rotated logfiles. I am using cronolog to rotate my logfiles for each virtual host daily. Every month the logfiles are being archived automatically so i can only get webhits of the actual month.

Is there any way to monitor webhits in this situation? I can write a script which puts out the webhits of all logfiles, but what about the past months? Or should i save the hit-value in a file and add the new hits every time my script runs?

Thanks a lot for any suggestions.

moojoo
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

I assume you are refering to default webhits data source and included to cacti distribution webhits.pl script. For cacti it is not important to know total number of hits. It uses a difference between previous poll and the current one. This means you don't have to keep a history in any additional file.
You may have problem when the logfile is rotated - a high peak may appear on your graph (this is because rrdtool thinks that monitored counter overflowed). You can avoid this by setting reasonable maximum value in your data source configuration.

- bulek
moojoo
Posts: 6
Joined: Fri Apr 11, 2003 1:06 am
Location: Germany

Post by moojoo »

Hi bulek,

no i'm not going to use the standard webhits.pl script. I want to write an own script which prints out the hits of the actual day (because the logfiles are rotated). This means at 0.00am the hit-counter will jump to zero (0) and has its highest value at 11.59pm. But i want keep track of the webhits over months (and propaply years :wink: ).

I think i must add the hits of the day to a global counter and return this value to cacti...
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests