In order to show any percentile of the traffic graph, not only the 95th percentile, I have made some changes to a pair of the php Cacti files which are located in /lib folder.
I am working with Cacti 0.8.6c. The changes were as follows:
1. In file rrd.php locate the label /* 95th percentile */
2. Replace the "95" in the regular expression pattern with [0-9]{2}
3. Add this line just after foreach sentence:
Code: Select all
$percent = substr($match[0],1,2);
5. In the file graph_variables.php locate the function declaration for variable_ninety_fifth_percentile.
6. Include $percent as a new variable of this function.
7. Look into variable_ninety_fifth_percentile for both of the ninety_fifth_percentile function calls and add $percent as the last variable in both of them.
8. Locate the function declaration for ninety_fifth_percentile.
9. Add $percent as the last variable in the function.
10. Replace the line
Code: Select all
$target = ((count($values_array) + 1) * 0.05);
Code: Select all
$target = ((count($values_array) + 1) * (1-$percent/100));
Note that the percentil N value must be a 2-digit number.