[rrd-users] on-the-fly graph generation

Simon Hobson linux at thehobsons.co.uk
Thu Jul 17 16:37:32 CEST 2008


I wrote:

>At the moment, my cgi scripts (all in Bash) call rrdtool graph to
>create static image files as the html is generated - these are stored
>in an images directory and only generated if an existing file is out
>of date (using --lazy option). I'd like to re-write at least some of
>this so that the html is static, and the images themselves are
>generated on-the-fly as they are accessed - in part because
>management is now wanting to incorporate individual graphs in other
>pages that I don't have anything to do with.
>
>Can anyone point me to some examples, or give some hints, on good
>ways to do this ? Could I, for example, have '.png' as a cgi (only
>for a specific folder on the server) and have a png file which is
>actually a bash script that generates the graph image and then pipes
>it out on stout ?


I've had a number of replies (on and off list) thanks. I've now 
twigged that all I need to do is adapt my existing scripts a bit, and 
change the set the Content-type header to suit.

So all I need to do is have a script like :

   build graph image file
   send headers
   cat image file



More information about the rrd-users mailing list