[rrd-users] embedding multiple rrdtool SVG into web page on the fly
Reinhard Scheck
Reinhard.Scheck at team-scheck.de
Sat Oct 3 00:03:08 CEST 2009
Hi all,
when using rrdtool graph --imgformat=SVG, the resulting file looks fine and can
be displayed in my browser using rrdtool 1.3.8 (F11, 64 bit, distro package).
Now, when creating a web page in cacti, graph generation is done in parallel by
using
<img ... src='php file to generate rrdtool commands'>
multiple time.
This was changed to
<object ... data='php file to generate rrdtool commands'>
for SVG, but that breaks. Wireshark trace shows, that the plain file is
preceeded and prepended by a number. Here's part of the TCP stream returned by
the server for the output of that php (see the numbers 2000 and 106581?):
>
> HTTP/1.1 200 OK
> Date: Fri, 02 Oct 2009 21:01:38 GMT
> Server: Apache/2.2.13 (Fedora)
> X-Powered-By: PHP/5.2.9
> Expires: Mon, 26 Jul 1997 05:00:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate
> Pragma: no-cache
> Last-Modified: Fri, 02 Oct 2009 21:01:38 GMT
> Cache-Control: post-check=0, pre-check=0
> P3P: CP="CAO PSA OUR"
> Keep-Alive: timeout=15, max=88
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: image/svg+xml; charset=utf-8
>
> 2000
> <?xml version="1.0" encoding="UTF-8"?>
> ....
> </svg>
> 106581
> 0
The same numbers appear when using PNG imgformat, but they don't seem to break
displaying the image. When using
<object class=... data='SVG file generated by manually running rrdtool'>
everything looks fine.
Does that ring a bell?
Reinhard
More information about the rrd-users
mailing list