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

时间:2010-10-15 14:38:09

标签: rrd

嗨,我是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>

我不确定问题出在哪里,任何建议都会受到赞赏,提前谢谢!

1 个答案:

答案 0 :(得分:1)

神秘解决了,它不喜欢冒号,根据(http://dev.pulsed.net/wp/?p=3),我可以使用\\127.0.0.1\d$,但是,需要两次逃避\并最终获得8 \ } 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");