[rrd-developers] rrd_graph : Error Can't Parse DEF

Vamsi Mohan Harish reacharish at yahoo.com
Tue Sep 16 11:01:34 MEST 2003


Hi,
 
I am trying to create graph using rrd_graph function. The code is given below.
 
RRDDIR = D:\InetPub\WWWRoot\MRTG\
 
 int XSize = 100;
 int YSize = 400;
 int i = 0;
 char **PRData;
 PRData = (char **) malloc(sizeof(char*) * MAX_ARGS);
 for(i = 0; i < MAX_ARGS; i++)
 {
  PRData[i] = (char *) malloc(sizeof(char) * 128);
  memset(PRData[i], 0, 128);
 }
 strcpy(Args[0],"graph");
 sprintf(Args[1],"%s\\%s.png", RRDDIR, ImgFileName);
 strcpy(Args[2],"-s");
 strcpy(Args[3],STime);
 strcpy(Args[4],"-e");
 strcpy(Args[5],ETime);
 strcpy(Args[6],"-t");
 strcpy(Args[7],"Usage");
 strcpy(Args[8],"-v");
 strcpy(Args[9],"Subscriber Usage");
 strcpy(Args[10],"-a");
 strcpy(Args[11],"PNG");
 strcpy(Args[12],"-w");
 strcpy(Args[13],"400");
 strcpy(Args[14],"-h");
 strcpy(Args[15],"100");
 sprintf(Args[16],"DEF:MUSG=%s\\Testing.RRD:Usage:MAX", RRDDIR);
 sprintf(Args[17],"DEF:AUSG=%s\\Testing.RRD:Usage:AVERAGE", RRDDIR);
 strcpy(Args[18],"CDEF:CMUSG=MUSG,UN,0,MUSG,IF");
 strcpy(Args[19],"CDEF:CAUSG=AUSG,UN,0,AUSG,IF");
 strcpy(Args[20],"AREA:CAUSG#00eb0c:\"AVG USAGE\"");
 strcpy(Args[21],"LINE2:CMUSG#0000ff:\"MAX USAGE\"\n");
 strcpy(Args[22],"HRULE:70#ff00ff:\"Threshold value\"\n");
 strcpy(Args[23],"GPRINT:CAUSG:AVERAGE:\"The Average value Avg\:%1.2lf\n");
 strcpy(Args[24],"GPRINT:CMUSG:MAX:\"The Maximum value Max\:%1.2lf %s\n");
 strcpy(Args[25],"COMMENT:\"Graph for period\n");
 NoArgs = 26;
 rrd_clear_error();
 
 //Linker Errors when the graph function is included - Check it
 //LIBCD.lib(crt0init.obj) : warning LNK4098: defaultlib "libcmt.lib" conflicts 
 //with use of other libs; use /NODEFAULTLIB:library
 rrd_graph(NoArgs, Args, &PRData, &XSize, &YSize);
 if(PRData)
 {
  for(i = 0; i < MAX_ARGS; i++)
  {
   if(PRData[i])
   {
    free(PRData[i]);
    PRData[i] = NULL;
   }
  }
  free(PRData);
 }
 if(rrd_test_error())
 {
  printf("Error! %s\n", rrd_get_error());
  return -2;
 }
 return 0;
 
The error I am getting is
Can't parse DEF 'MUSG=D:\InetPub\WWWRoot\MRTG\Testing.RRD:Usage:MAX' -2
 
Can any one help me out.
 
Thanks
Harish

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list