PHP 致命错误:调用未定义的函数 rrd_xport()



好吧,我正在尝试在我的php代码中使用rrdtool,rrd_xport无法识别,并且rrd_graph的rrd命令完美地遵循代码:

  <?php
  $opts = array( "--start", "-1d", "--vertical-label=B/s",
                 "DEF:inoctets=net1.rrd:input:AVERAGE",
                 "DEF:outoctets=net1.rrd:output:AVERAGE",
                 "AREA:inoctets#00FF00:In traffic",
                 "LINE1:outoctets#0000FF:Out traffic\r",
                 "CDEF:inbits=inoctets,8,*",
                 "CDEF:outbits=outoctets,8,*",
                 "COMMENT:\n",
                 "GPRINT:inbits:AVERAGE:Avg In traffic: %6.2lf %Sbps",
                 "COMMENT:  ",
                 "GPRINT:inbits:MAX:Max In traffic: %6.2lf %Sbps\r",
                 "GPRINT:outbits:AVERAGE:Avg Out traffic: %6.2lf %Sbps",
                 "COMMENT: ",
                 "GPRINT:outbits:MAX:Max Out traffic: %6.2lf %Sbps\r"
               );
   $opts2 = array ("--json","--start", "1378750426", "--end", "N", 
           "DEF:myseepd=net1.rrd:input:AVERAGE",
           "XPORT:myspeed"                  
);  
  $ret = rrd_graph("net_1d.gif", $opts, count($opts));
  $js = rrd_xport($opts2);      
  if( !is_array($ret) )
  {
    $err = rrd_error();
    echo "rrd_graph() ERROR: $errn";
  }
echo $js;
?>

试试这个:

$opts2 = Array(
    "--start", "1378750426",
    "--end", "now",
    "--json",
    "DEF:out=myspeed:net1.rrd:input:AVERAGE",
    "XPORT:out:"myspeed""
);

显然,其他人遇到了问题:

PHP 和 rrd:rrd_xport函数返回错误

相关内容

  • 没有找到相关文章

最新更新