[rrd-users] How can I use RRDTool with PHP?

Sepp Wang sepp at ms11.voip.edu.tw
Mon Jun 5 12:20:13 MEST 2006


 |Following is my source code:
It can work, but always return the image's width and heigth.
How can I discard it?
Also, is there a better solution use RRDTool with PHP?
Sepp

<?php
$time=date("Y/m/dH\\\:i\\\:s");

$cmd="/usr/local/bin/rrdtoolgraphtest.png".
"DEF:inoctets=test.rrd:input:AVERAGE".
"DEF:outoctets=test.rrd:output:AVERAGE".
"COMMENT:\"MaxAverageMinNow\\n\"".
"LINE1:inoctets#00FF00:\"Intraffic\"".
"GPRINT:inoctets:MAX:\"%8.0lf\"".
"GPRINT:inoctets:AVERAGE:\"%8.0lf\"".
"GPRINT:inoctets:MIN:\"%8.0lf\"".
"GPRINT:inoctets:LAST:\"%8.0lf\"".
"LINE1:outoctets#0000FF:\"Outtraffic\"".
"GPRINT:outoctets:MAX:\"%8.0lf\"".
"GPRINT:outoctets:AVERAGE:\"%8.0lf\"".
"GPRINT:outoctets:MIN:\"%8.0lf\"".
"GPRINT:outoctets:LAST:\"%8.0lf\"".
"--title\"Traffic\"-v\"Bytespersecond\"COMMENT:\"LastUpdated\:$time\"".
"-s`date-v-1d+%s`--imginfo'<IMGSRC=\"%s\"WIDTH=\"%lu\"HEIGHT=\"%lu\"ALT=\"Demo\">'";

$fp=popen($cmd,"r");
fpassthru($fp);
?>
<html>
<head><title>RRDToolGraphTest</title></head>
<body>
</body>
</html>
|


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list