I released a new version of ApacheStats with one goal in mind: reduce disk usage.
The previous versions were using only one "Data Template", the results was each graph was using one 733K RRD file with same data inside.
In order to change that, I have updated the php script to filter each graph data, and rebuild the whole templates to use it
The result is 6 small RRD files (24k) to graph one host, it's a total of 350K instead of 5400K!
Warning:
This template will only work with ONE consolidation function (AVERAGE) into your RRA definition.
(Cacti default is using TWO consolidation functions).
To check how many consolidation function your have, go to "Management" -> "Data Sources" -> "RRAs", then edit the 4 archives and see how many lines are selected. You only need the "AVERAGE" line here.
note: you can also create alternate RRA functions with only "AVERAGE" line selected, then link those alternate RRA from ApacheStats08 data template. ("Templates" -> "Data Templates")
Upgrade step
- update to cacti 0.8.7e
- upload / update your file /scripts/ss_apache_stats.php
- Delete all Apache08 CDEF in "Management" -> "Graph Management" -> "CDEFs"
- Delete all Apache08 graph templates in "Templates" -> "Graph Templates"
- Import the XML "cacti_host_template_webserver_-_apache.xml" into your cacti website
- update to cacti 0.8.7e
- upload the "ss_apache_stats.php" file to your cacti/scripts/ directory
- import the XML "cacti_host_template_webserver_-_apache.xml" into your cacti website
- If you don't care about 1min polling system, go into (Data Templates), edit the 5 "ApacheStats08" and remove "Hourly (1 Minute Average)" associated RRA's
- add one device with the "WebServer - Apache" host template, the 7 graphs templates will show up in the (Associated Graph Templates) list
- click (Create Graphs for this Host) and choose all graphs EXCEPT number (D) and (F) (to share common data source later), click create
- choose the last two graphs (D) and (F) and click create
- go to (Graph Management) and edit "<host> ApacheStats08 - D - Bytes / Hit - same data source..."
- - change the data source "<host> ApacheStats08 (apache_total_hits)" to the other "<host> ApacheStats08 (apache_total_hits)"
- - change the data source "<host> ApacheStats08 (apache_total_kbytes)" to the other "<host> ApacheStats08 (apache_total_kbytes)", and save
- go to (Graph Management) and edit "<host> ApacheStats08 - F - Thread Details (%) - same data source..."
- - change the data source "<host> ApacheStats08 (apache_busy_workers)" to the other "<host> ApacheStats08 (apache_busy_workers)"
- - change the data source "<host> ApacheStats08 (apache_idle_workers)" to the other "<host> ApacheStats08 (apache_idle_workers)", and save
- go to (Data Source) and look at (<host> ApacheStats08 - Total Hits), (<host> ApacheStats08 - Total kBytes), (<host> ApacheStats08 - Workers)
- you will have to locate the 3 biggest <ID> and delete them. (look at the second column)
- If you have correctly migrated the date source at step 2,3,5,6, Cacti won't propose you to delete one associated graph.
- if cacti had time to create them, delete the 3 RRD files that have those <ID>, or use the RRDCLEANER plugin to perform the job.
Best regards,
RCK
---------------
Changelog 0.8.2
---------------
- export was done with cacti 0.8.7e
- ss_apache_stats.php: add support for apache 1.x - BusyServers,IdleServers (thanks helzerr)
- ss_apache_stats.php: no more floor() on CPU query to have better values (thanks helzerr)
- fixed the CDEFs function for graph D and F (thanks kilos / spkane)
- fixed some multiple graph comments after import.
---------------
Changelog 0.8.1
---------------
- export was done with cacti 0.8.7b
- CDEF were updated to correctly works with one consolidation function (AVERAGE)
- fixed some graph template that were still using the (MAX) consolidation.
---------------
Changelog 0.8.0
---------------
- data splitted into multiple RRD files to save 87% disk space (708K instead of 5400K)
- no more thread_O useless RRA
- no more redondant RRD data
- fix some useless "Graph Item Inputs"
- cacti 0.8.7 support
- this version of ss_apache_stats.php is compatible with ApacheStats 0.64
previous version credits
- Rolf Poser for apachestats 0.4 - http://forums.cacti.net/viewtopic.php?t=9861
- Mahuani for apachestats 0.6 SS - http://forums.cacti.net/viewtopic.php?t=17995