例如,这对我来说有效
<?php
$result = rrd_fetch( "mydata.rrd", array( "AVERAGE", "--resolution", "60", "--start", "-1d", "--end", "start+1h" ) );
?>
这将获取所有字段。然后您必须使用类似以下内容来获取特定 rrd 字段
<?php
foreach ( $result["data"]["myfield"] as $key => $value )
{
echo "At timestamp $key, the value for myfield is $value.\n";
}
?>