PHP 8.3.4 Released!

rrd_update

(PECL rrd >= 0.9.0)

rrd_update更新 RRD 数据库

说明

rrd_update(string $filename, array $options): bool

更新 RRD 数据库文件。输入数据根据 RRD 数据库文件属性进行时间对齐。

参数

filename

RRD 数据库文件名。要更新的数据库。

options

更新 RRD 数据库的可选项。是一个字符串列表。查看 rrd update 的 man 页面以获取完整的选项列表。

返回值

成功时返回 true, 或者在失败时返回 false

add a note

User Contributed Notes 1 note

up
1
m[dot]reza[dot]hamedany[at]gmail[dot]com
6 years ago
class rrdUpdate {

public function rrdFilesUpdate($id,$value){

$rrdFile ="/path/to/file/".$id.rrd;

$time = time();

$ret = rrd_update($rrdFile, "$time:$value");
return $ret;
if (!$ret) {
echo "<b>update error: </b>" . rrd_error() . "\n";
}
}
}
To Top