Ref/rrd-Phpdoc专题
rrd_create
Creates rrd database file
说明
bool <span
class="methodname">rrd_create ( <span
class="type">string $filename , <span
class="methodparam">array $options )
Creates the rdd database file.
参数
filename
Filename for newly created rrd file.
options
Options for rrd create - list of strings. See man page of rrd create for
whole list of options.
返回值
成功时返回 true, 或者在失败时返回 false。
rrd_error
Gets latest error message
说明
string <span class="methodname">rrd_error ( <span class="methodparam">void )
Returns latest global rrd error message.
参数
此函数没有参数。
返回值
Latest error message.
rrd_fetch
Fetch the data for graph as array
说明
array <span
class="methodname">rrd_fetch ( <span
class="type">string $filename , <span
class="methodparam">array $options )
Gets data for graph output from RRD database file as array. This function has same result as rrd_graph, but fetched data are returned as array, no image file is created.
参数
filename
RRD database file name.
options
Array of options for resolution specification.
返回值
Returns information about retrieved graph data.
rrd_first
Gets the timestamp of the first sample from rrd file
说明
int rrd_first
( string
$file [, <span
class="type">int $raaindex =
0 ] )
Returns the first data sample from the specified RRA of the RRD file.
参数
file
RRD database file name.
raaindex
The index number of the RRA that is to be examined. Default value is 0.
返回值
Integer number of unix timestamp, false if some error occurs.
rrd_graph
Creates image from a data
说明
array <span
class="methodname">rrd_graph ( <span
class="type">string $filename , <span
class="methodparam">array $options )
Creates image for a particular data from RRD file.
参数
filename
The filename to output the graph to. This will generally end in either
.png, .svg or .eps, depending on the format you want to output.
options
Options for generating image. See man page of rrd graph for all possible
options. All options (data definitions, variable defintions, etc.) are
allowed.
返回值
Array with information about generated image is returned, false
when error occurs.
rrd_info
Gets information about rrd file
说明
array <span
class="methodname">rrd_info ( <span
class="type">string $filename )
Returns information about particular RRD database file.
参数
file
RRD database file name.
返回值
Array with information about requsted RRD file, false when error
occurs.
rrd_last
Gets unix timestamp of the last sample
说明
int rrd_last
( string
$filename )
Returns the UNIX timestamp of the most recent update of the RRD database.
参数
filename
RRD database file name.
返回值
Integer as unix timestamp of the most recent data from the RRD database.
rrd_lastupdate
Gets information about last updated data
说明
array <span
class="methodname">rrd_lastupdate ( <span
class="methodparam">string $filename
)
Gets array of the UNIX timestamp and the values stored for each date in the most recent update of the RRD database file.
参数
file
RRD database file name.
返回值
Array of information about last update, false when error occurs.
rrd_restore
Restores the RRD file from XML dump
说明
bool <span
class="methodname">rrd_restore ( <span
class="type">string $xml_file , <span
class="methodparam">string $rrd_file
[, array
$options ] )
Restores the RRD file from the XML dump.
参数
xml_file
XML filename with the dump of the original RRD database file.
rrd_file
Restored RRD database file name.
options
Array of options for restoring. See man page for rrd restore.
返回值
Returns true on success, false otherwise.
rrd_tune
Tunes some RRD database file header options
说明
bool rrd_tune
( string
$filename , <span
class="type">array $options )
Change some options in the RRD dabase header file. E.g. renames the source for the data etc.
参数
filename
RRD database file name.
options
Options with RRD database file properties which will be changed. See rrd
tune man page for details.
返回值
Returns true on success, false otherwise.
rrd_update
Updates the RRD database
说明
bool <span
class="methodname">rrd_update ( <span
class="type">string $filename , <span
class="methodparam">array $options )
Updates the RRD database file. The input data is time interpolated according to the properties of the RRD database file.
参数
filename
RRD database file name. This database will be updated.
options
Options for updating the RRD database. This is list of strings. See man
page of rrd update for whole list of options.
返回值
Returns true on success, false when error occurs.
rrd_version
Gets information about underlying rrdtool library
说明
string <span class="methodname">rrd_version ( <span class="methodparam">void )
Returns information about underlying rrdtool library.
参数
此函数没有参数。
返回值
String with rrdtool version number e.g. "1.4.3".
rrd_xport
Exports the information about RRD database
说明
array <span
class="methodname">rrd_xport ( <span
class="type">array $options )
Exports the information about RRD database file. This data can be converted to XML file via user space PHP script and then restored back as RRD database file.
参数
options
Array of options for the export, see rrd xport man page.
返回值
Array with information about RRD database file, false when error
occurs.
rrdc_disconnect
Close any outstanding connection to rrd caching daemon
说明
void <span class="methodname">rrdc_disconnect ( <span class="methodparam">void )
Close any outstanding connection to rrd caching daemon.
This function is automatically called when the whole PHP process is terminated. It depends on used SAPI. For example, it's called automatically at the end of command line script.
It's up user whether he wants to call this function at the end of every request or otherwise.
参数
此函数没有参数。
返回值
没有返回值。
目录
- rrd_create — Creates rrd database file
- rrd_error — Gets latest error message
- rrd_fetch — Fetch the data for graph as array
- rrd_first — Gets the timestamp of the first sample from rrd file
- rrd_graph — Creates image from a data
- rrd_info — Gets information about rrd file
- rrd_last — Gets unix timestamp of the last sample
- rrd_lastupdate — Gets information about last updated data
- rrd_restore — Restores the RRD file from XML dump
- rrd_tune — Tunes some RRD database file header options
- rrd_update — Updates the RRD database
- rrd_version — Gets information about underlying rrdtool library
- rrd_xport — Exports the information about RRD database
- rrdc_disconnect — Close any outstanding connection to rrd caching daemon