【问题标题】:RRDTools RRDs::xport module's working exampleRRDTools RRDs::xport 模块的工作示例
【发布时间】:2021-05-19 22:27:50
【问题描述】:

我正在尝试利用 Perl 中 RRDs 模块的 xport 功能从 rrd 文件中提取数据。但是,我没有找到合适的语法来使用它。官网只提供以下解释。 如果有人使用此模块做同样的事情,请提供帮助。

RRDs::xport exposes the rrdxport functionality and returns data with the following structure:

  my ($start,$end,$step,$cols,$names,$data) = RRDs::xport ...
  
  # $start : timestamp
  # $end   : timestamp
  # $step  : seconds
  # $cols  : number of returned columns
  # $names : arrayref with the names of the columns
  # $data  : arrayref of arrayrefs with the data (first index is time, second is column)

【问题讨论】:

    标签: perl cgi rrdtool


    【解决方案1】:

    RRDs 模块中的各种 Perl 函数采用与命令行函数完全相同的参数数组。

    例如,

    @args = qw/--start now-1h --end now DEF:x=file.rrd:ds0:AVERAGE XPORT:x:out_bytes/;
    ($start,$end,$step,$cols,$names,$data) = RRDs::xport(@args);
    

    请记住,您不需要引用包含空格的参数 - 毕竟,它们已经在数组中进行了标记。

    【讨论】:

      猜你喜欢
      • 2019-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-31
      • 1970-01-01
      • 1970-01-01
      • 2011-07-02
      • 1970-01-01
      相关资源
      最近更新 更多