1 --- cacti-0.8.6h/lib/graph_variables.php 2006-01-03 21:08:30.000000000 -0600
2 +++ cacti-fixed/lib/graph_variables.php 2006-01-06 22:40:31.032460462 -0600
5 /* format the output according to args passed to the variable */
6 if ($regexp_match_array[4] == "current") {
7 + if (! empty($nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]})) {
8 $nth = $nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]};
9 $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
10 $nth /= pow(10,intval($regexp_match_array[3]));
12 }elseif ($regexp_match_array[4] == "total") {
13 for ($t=0;($t<count($graph_items));$t++) {
14 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
15 + if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
16 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
17 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
18 $local_nth /= pow(10,intval($regexp_match_array[3]));
25 }elseif ($regexp_match_array[4] == "max") {
26 + if (! empty($nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"])) {
27 $nth = $nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"];
28 $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
29 $nth /= pow(10,intval($regexp_match_array[3]));
31 }elseif ($regexp_match_array[4] == "total_peak") {
32 for ($t=0;($t<count($graph_items));$t++) {
33 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
34 + if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
35 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
36 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
37 $local_nth /= pow(10,intval($regexp_match_array[3]));
43 }elseif ($regexp_match_array[4] == "all_max_current") {
44 for ($t=0;($t<count($graph_items));$t++) {
45 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
46 + if (! empty($ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
47 $local_nth = $ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
48 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
49 $local_nth /= pow(10,intval($regexp_match_array[3]));
55 }elseif ($regexp_match_array[4] == "all_max_peak") {
56 for ($t=0;($t<count($graph_items));$t++) {
57 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
58 + if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
59 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
60 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
61 $local_nth /= pow(10,intval($regexp_match_array[3]));
67 }elseif ($regexp_match_array[4] == "aggregate") {
68 - if (empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
71 + if (! empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
72 $local_nth = $nth_cache{0}["nth_percentile_aggregate_total"];
73 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
74 $local_nth /= pow(10,intval($regexp_match_array[3]));
77 }elseif ($regexp_match_array[4] == "aggregate_max") {
78 - if (empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
81 + if (! empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
82 $local_nth = $nth_cache{0}["nth_percentile_aggregate_max"];
83 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
84 $local_nth /= pow(10,intval($regexp_match_array[3]));
87 }elseif ($regexp_match_array[4] == "aggregate_sum") {
88 - if (empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
91 + if (! empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
92 $local_nth = $nth_cache{0}["nth_percentile_aggregate_sum"];
93 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
94 $local_nth /= pow(10,intval($regexp_match_array[3]));