TiRexx Guest
|
Posted: Tue Sep 02, 2003 9:35 am Post subject: |
|
|
Hello Rax, cacti - great work... with ever version beter and beter...
So, I use time range and step feature in cacti 0.6.7
to do this i self modify source
sorry my bad php...
graph.php.diff
| Code: |
57c57
< $sql_id = mysql_query("select id from rrd_graph where id=$graphid",$cnn_id);
---
> $sql_id = mysql_query("select * from rrd_graph where id=$graphid",$cnn_id);
65c65,66
<
---
>
> if (mysql_result($sql_id, 0, "step") == 0) {
69a71,74
> }
> } else {?>
> <div align="center"><img src="graph_image.php?graphid=<?print $graphid;?>&rraid=<?print mysql_result($sql_id_rra, $i_rra, "id");?>&
> <?
70a76,77
>
>
|
graph_image.php.diff
| Code: |
37a38,52
>
> $sql_id = mysql_query("select * from rrd_graph where id=$graphid",$cnn_id);
> if (mysql_num_rows($sql_id) == 0) {
> print "<strong><font size=\"+1\" color=\"FF0000\">GRAPH DOES NOT EXIST</font></strong>"; exit;
> }
>
> if (mysql_result($sql_id, 0, "step") != 0) {
> $graph_data_array["use2"] = true;
> $graph_data_array["graph_start"] = mysql_result($sql_id, 0, "graphstart");
> $graph_data_array["graph_end"] = mysql_result($sql_id, 0, "graphend");
> $graph_data_array["graph_step"] = mysql_result($sql_id, 0, "step");
> $graph_data_array["graph_height"] = $graph_height;
> $graph_data_array["graph_width"] = $graph_width;
> }
>
|
graphs.php.diff
| Code: |
58c58
< basevalue,grouping,export) values ($id,$imageformatid,\"$title\",$height,$width,
---
> basevalue,grouping,export,step,graphstart,graphend) values ($id,$imageformatid,\"$title\",$height,$width,
60c60
< $autoscaleopts,\"$rigid\",$basevalue,\"$grouping\",\"$export\")",$cnn_id);
---
> $autoscaleopts,\"$rigid\",$basevalue,\"$grouping\",\"$export\",$step,\"$graphstart\",\"$graphend\")",$cnn_id);
87c87
<
---
>
98a99
>
136a138,146
>
> DrawFormItem("Step","Step.");
> DrawFormItemTextBox("step",$sql_id,"0","");
>
> DrawFormItem("Start","Start.");
> DrawFormItemTextBox("graphstart",$sql_id,"","");
>
> DrawFormItem("End","End.");
> DrawFormItemTextBox("graphend",$sql_id,"","");
|
for me this is useful to viev everage trafic/per hour , month in one graph
with rrd ranges e-1w : midnight (week) , Jan 1 : Jan 1 +12month (year)
only 3 mysql fields + some not big coding = great feature
anyway big senks fo great cacti |
|