[rrd-users] rrdtool 1.3.5 xport has non-xml text at beginning of xml output

Alejandro Galue agalue at sync.com.ve
Tue Feb 3 12:59:25 CET 2009


Hello,

I found the source of the problem. On rrd_xport.c there are 
two printf lines that are the responsible of write non xml 
formatted information.

Try this patch:

--- original/src/rrd_xport.c	2009-02-03 07:25:03.000000000 
-0430
+++ src/rrd_xport.c	2009-01-20 07:02:38.000000000 -0430
@@ -227,7 +227,7 @@
          case GF_XPORT:
              ref_list[xport_counter++] = i;
              *step_list_ptr = im->gdes[im->gdes[i].vidx].step;
- 
printf("%s:%lu\n",im->gdes[i].legend,*step_list_ptr);
+            // 
printf("%s:%lu\n",im->gdes[i].legend,*step_list_ptr);
              *step_list_ptr++;
              /* reserve room for one legend entry */
              /* is FMT_LEG_LEN + 5 the correct size? */
@@ -255,7 +255,7 @@
      *step_list_ptr=0;
      /* find a common step */
      *step = lcd(step_list);
-    printf("step: %lu\n",*step);
+    // printf("step: %lu\n",*step);
      free(step_list);

      *start =  im->start - im->start % (*step);

This was based on rrdtool 1.3.6. That did the trick.

TOBIAS: I think that this lines must be written on debug 
mode only or something; am I right ?

Regards,
Alejandro.

Howie wrote:
> 
> 
> Con Zyor wrote:
>> Using the following xport command in rrdtool 1.3.5 results in non-xml text
>> being inserted at the beginning of the xml, as shown.  This is confusing
>> my
>> xslt parser (which uses an xsl to transform rrdtool xport into csv).  The
>> xslt processor is xsltproc and this is all running on Red Hat Linux 5
>> x86_64.  It wasn't like this in rrdtool 1.2.
> 
> I am seeing this same issue with CentOS 5 and RRDtool 1.2.29 after moving
> from an older FreeBSD system. Did you ever find a solution? Currently I'm
> running the output from rrdtool through sed to chop off the first couple of
> lines in my scripts, but that's not a very nice solution!
> 
> Cheers,
> 
> Howie



More information about the rrd-users mailing list