tags:

views:

14

answers:

1

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!

A: 

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");
Terry
or alternatively$rrdFilePath = "d\\:\\xampp\\htdocs\\Diskusage\\rrdResult\\POPZ.rrd";
Terry