Hi,
I have a problem with my rrd. In /usr/local/www/data/cable/rrd/ I have created rrd's
db10-C.rrd db10.rrd db9-C.rrd db9.rrd db8-C.rrd db8.rrd
In /usr/local/www/data/cable/rrdimages/ I have
db10-C-day.png db10-day.png db9-C-day.png db9-day.png db8-C-day.png db8-day.png
I need to get graphs for one hour, trhree hours, six hours, for week, month and year, but I can not do that.
Olso in /usr/local/www/data-dist/cable/inc/ I have two php files graph.php and graphc.php
graph.php
<?
// Function for graphing
function graph($time, $node) {
include ("inc/colors.php");
include ("inc/time.inc");
$rrdgraph = "/usr/local/bin/rrdtool graph /usr/local/www/data/cable/rrdimages/".$node."-".$time.".png \
--step 60 \
--slope-mode \
--interlaced \
--start " . $backtime . " \
--vertical-label 'Power (dBmV)' \
--width '670' \
--height '220' \
--title 'Statistics for " . $node . "' \
'DEF:A=/usr/local/www/data/cable/rrd/" . $node . ".rrd:max:AVERAGE' \
'DEF:B=/usr/local/www/data/cable/rrd/" . $node . ".rrd:min:AVERAGE' \
'CDEF:down=A' \
'CDEF:up=B' \
'COMMENT:\\n' \
'AREA:down".$dcol.":Power' \
'LINE1:down".$dlcol.":' \
'GPRINT:down:LAST:Last=%6.2lf%s' \
'GPRINT:down:MIN:Min=%6.2lf%s' \
'GPRINT:down:AVERAGE:Average=%6.2lf%s' \
'GPRINT:down:MAX:Max=%6.2lf%s' \
'COMMENT:\\n' \
'LINE1:up".$ucol.":' \
'COMMENT:\\n' \
'COMMENT: " . $grdate . "\\r'";
echo $rrdgraph . "<br>";
exec ($rrdgraph) or die("<br><b><font size='2'>No RRD<p>");
// echo "<fieldset><div align='center'><font face='Verdana' size='2'>" . $node . "-" . $time . "</fieldset>";
echo "<IMG SRC='rrdimages/" . $node . "-" . $time . ".png' alt=" . $node . ">";
......
?>
graphc.php
<?
// Function for graphing
function graphc($time, $node) {
include ("inc/colors.php");
include ("inc/time.inc");
$rrdgraph = "/usr/local/bin/rrdtool graph /usr/local/www/data/cable/rrdimages/".$node."-C-".$time.".png \
--step 60 \
--slope-mode \
--interlaced \
--start " . $backtime . " \
--vertical-label 'Power (dB)' \
--width '670' \
--height '220' \
--title 'Statistics for " . $node . "' \
'DEF:A=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u1:AVERAGE' \
'DEF:B=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u2:AVERAGE' \
'DEF:C=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u3:AVERAGE' \
'DEF
=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u4:AVERAGE' \
'DEF:E=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u5:AVERAGE' \
'DEF:F=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u6:AVERAGE' \
'DEF:G=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u7:AVERAGE' \
'DEF:H=/usr/local/www/data/cable/rrd/" . $node . "-C.rrd:u8:AVERAGE' \
'CDEF:u1=A' \
'CDEF:u2=B' \
'CDEF:u3=C' \
'CDEF:u4=D' \
'CDEF:u5=E' \
'CDEF:u6=F' \
'CDEF:u7=G' \
'CDEF:u8=H' \
'COMMENT:\\n' \
......
?>
How I can get graphs for different periods from one day ago.