[rrd-users] Re: can rrdcgi generate just a image? (no html)

Simon Hobson linux at thehobsons.co.uk
Wed Jul 19 10:51:23 MEST 2006


Jo Rhett wrote:

>Okay, so I need to have an external web site reference an image created by
>RRD.  But just the image.  In short
>	<img src="http://my.rrd.server/path/show-me.cgi
>
>Based on my reading of the manpage, I want the output to standard out.
>This actually works properly like so:
>
>#!/usr/local/bin/rrdcgi
><RRD::GRAPH -
>--start -8h --end -1
>--lower-limit 0 --height 80 --width 100 --no-legend
>-c SHADEA#ffffff -c SHADEB#ffffff
>DEF:ds0=/rrd/show-me.rrd:ds0:AVERAGE
>AREA:ds0#00ff00:""
>>
>
>So what's the problem?  No headers.  It outputs PNG format immediately, and
>the web server barfs:

How about using something else (Perl, Shell, whatever) as your CGI ? 
I'm looking at doing something in shell (Bash) because the stock 
RRDCGI doesn't give enough flexibility for what I want (particularly 
I want to do dns lookups and include hostname(s) in the graphs).

Perhaps something like :

#!/bin/bash

echo "Content-Type: img/png_or_whatever_it_should_be
Last-Modified: `date --rfc-2822`
Expires: `date --rfc-2822 -d '+2 minutes'`"

echo "some rrdgraphing stuff here" \
   | rrdcgi --filter



Simon

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



More information about the rrd-users mailing list