错误:“无法解析 DS”当尝试使用 RRDs::graph 绘制图表时

发布于 2024-09-28 00:31:38 字数 1402 浏览 4 评论 0原文

您好,我是 RRD 新手,并用它绘制图表。我正在尝试用以下内容绘制图表

RRDs::graph ($wwwDir."graphs\\2mtotal$rrdname.png", "-l 0", "-w 500", "-h 200", "-v Size", "-s now-5184000"
        , "--base", "1024", "-x", "DAY:1:WEEK:1:WEEK:1:0:%d/%m", "-e now", "--title=$rrdheading"
        , "DEF:DriveCap=D\:\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd:$rrdCap:AVERAGE"
        , "DEF:DriveSize=D\:\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd:$rrdSize:AVERAGE"
        , "CDEF:DriveSizeGB=DriveSize,1073741824,/"
        , "LINE3:DriveSize#33FF33:Total Used"
        , "LINE3:DriveCap#cc0033:Capacity"
        , "GPRINT:DriveSizeGB:LAST:Total Used Space\\: %2.0lf Gb\\j"
        , "COMMENT:Created\\: $hour\\:$min $mday/$mon/$year\\r");

但是,我遇到了一个错误:

ERROR while updating monthly total graph PopZ.rrd: Cannot parse DS in 'DEF:DriveCap=D:\xampp\htdocs\Diskusage\rrdResult\
POPZ.rrd:POPZCapacity:AVERAGE'

我的 RRD 定义是

 <ds>
  <name> POPZCapacity </name>
  <type> GAUGE </type>
  <minimal_heartbeat> 200000 </minimal_heartbeat>
  <min> 0.0000000000e+000 </min>
  <max> NaN </max>
  <!-- PDP Status -->
  <last_ds> UNKN </last_ds>
  <value> 3.7080673019e+016 </value>
  <unknown_sec> 0 </unknown_sec>
 </ds>

我不确定问题出在哪里,任何建议将不胜感激,提前致谢!

Hi I am new to RRD and plotting graph with it. I am trying to plot a graph with following

RRDs::graph ($wwwDir."graphs\\2mtotal$rrdname.png", "-l 0", "-w 500", "-h 200", "-v Size", "-s now-5184000"
        , "--base", "1024", "-x", "DAY:1:WEEK:1:WEEK:1:0:%d/%m", "-e now", "--title=$rrdheading"
        , "DEF:DriveCap=D\:\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd:$rrdCap:AVERAGE"
        , "DEF:DriveSize=D\:\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd:$rrdSize:AVERAGE"
        , "CDEF:DriveSizeGB=DriveSize,1073741824,/"
        , "LINE3:DriveSize#33FF33:Total Used"
        , "LINE3:DriveCap#cc0033:Capacity"
        , "GPRINT:DriveSizeGB:LAST:Total Used Space\\: %2.0lf Gb\\j"
        , "COMMENT:Created\\: $hour\\:$min $mday/$mon/$year\\r");

However, I have got an error:

ERROR while updating monthly total graph PopZ.rrd: Cannot parse DS in 'DEF:DriveCap=D:\xampp\htdocs\Diskusage\rrdResult\
POPZ.rrd:POPZCapacity:AVERAGE'

My RRD definition is

 <ds>
  <name> POPZCapacity </name>
  <type> GAUGE </type>
  <minimal_heartbeat> 200000 </minimal_heartbeat>
  <min> 0.0000000000e+000 </min>
  <max> NaN </max>
  <!-- PDP Status -->
  <last_ds> UNKN </last_ds>
  <value> 3.7080673019e+016 </value>
  <unknown_sec> 0 </unknown_sec>
 </ds>

I am not sure where is the problem, any advice will be appreciated, thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

林空鹿饮溪 2024-10-05 00:31:38

谜团解决了,它不喜欢冒号,根据(http://dev.pulsed.net/wp/?p=3),我可以使用\\127.0.0.1\d然而,$ 需要转义 \ 两次,并以 8 个 \ 结尾,以表示双 \

$rrdFilePath = "\ \\\\\\\127.0.0.1\\d\$\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd";

    #die $rrdFilePath;

    #create monthly total graphs (2 lines - Drive Capacity & Total Usage)
    RRDs::graph ($wwwDir."graphs\\2mtotal$rrdname.png", "-l 0", "-w 500", "-h 200", "-v Size", "-s now-5184000"
                            , "--base", "1024", "-x", "DAY:1:WEEK:1:WEEK:1:0:%d/%m", "-e now", "--title=$rrdheading"
                            , "DEF:$rrdCap=$rrdFilePath:$rrdCap:AVERAGE"
                            , "DEF:$rrdSize=$rrdFilePath:$rrdSize:AVERAGE"
                            , "CDEF:DriveSizeGB=$rrdSize,1073741824,/"
                            , "LINE3:$rrdSize#33FF33:Total Used"
                            , "LINE3:$rrdCap#cc0033:Capacity"
                            , "GPRINT:DriveSizeGB:LAST:Total Used Space\\: %2.0lf Gb\\j"
                            , "COMMENT:Created\\: $hour\\:$min $mday/$mon/$year\\r");

Mystery solved, it does not like colon and according to (http://dev.pulsed.net/wp/?p=3), I could use \\127.0.0.1\d$, however, need to escape \ twice and end up eight \ for double \

$rrdFilePath = "\\\\\\\\127.0.0.1\\d\$\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd";

    #die $rrdFilePath;

    #create monthly total graphs (2 lines - Drive Capacity & Total Usage)
    RRDs::graph ($wwwDir."graphs\\2mtotal$rrdname.png", "-l 0", "-w 500", "-h 200", "-v Size", "-s now-5184000"
                            , "--base", "1024", "-x", "DAY:1:WEEK:1:WEEK:1:0:%d/%m", "-e now", "--title=$rrdheading"
                            , "DEF:$rrdCap=$rrdFilePath:$rrdCap:AVERAGE"
                            , "DEF:$rrdSize=$rrdFilePath:$rrdSize:AVERAGE"
                            , "CDEF:DriveSizeGB=$rrdSize,1073741824,/"
                            , "LINE3:$rrdSize#33FF33:Total Used"
                            , "LINE3:$rrdCap#cc0033:Capacity"
                            , "GPRINT:DriveSizeGB:LAST:Total Used Space\\: %2.0lf Gb\\j"
                            , "COMMENT:Created\\: $hour\\:$min $mday/$mon/$year\\r");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文