rrd_graph.php
来自「监控软件rrdtools」· PHP 代码 · 共 44 行
PHP
44 行
<? dl("/tmp/php3_rrdtool.so"); ## ## demonstration of the rrd_graph() command ## $opts = array( "--start", "-4d", "DEF:in=/dir/router-port2.rrd:input:AVERAGE", "DEF:out=/dir/router-port2.rrd:output:AVERAGE", "LINE2:in#0000ff:Incoming Traffic Avg.", "PRINT:in:AVERAGE:incoming\: %1.2lf b/s", "PRINT:in:AVERAGE:incoming2\: %1.2lf b/s" ); $ret = rrd_graph("/some-dir/router-port2.gif", $opts, count($opts)); ## ## if $ret is an array, then rrd_graph was successful ## if ( is_array($ret) ) { echo "Image size: $ret[xsize] x $ret[ysize]\n"; ## ## all results from any PRINT commands will be ## in the array $ret[calcpr][..] ## echo "rrd_graph1 print results: \n"; for ($i = 0; $i < count($ret[calcpr]); $i++) echo $ret[calcpr][$i] . "\n"; } else { $err = rrd_error(); echo "rrd_graph() ERROR: $err\n"; }?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?