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
monitor apache webhits with rotated logfiles?
Moderators: Developers, Moderators
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
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
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 ).
I think i must add the hits of the day to a global counter and return this value to cacti...
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 ).
I think i must add the hits of the day to a global counter and return this value to cacti...
Who is online
Users browsing this forum: No registered users and 4 guests