[rrd-users] Problem with rrdcgi

Juergen Braendle jb at macbest.de
Fri Aug 18 17:12:12 MEST 2000


Hi there,

I've a problem with the rrdcgi script.

I just figured out how to create some graphs via rrdtool.
So I wanted them to be created via cgi.
I took the manual from the rrdcgi script and wrote a little example
to check the function of it.
But I can't get it to work.
Following are the two examples which I created to test the rrdtool graph
functionality. 

Maybe I've done only a little mistake I can't figure out but I've read the
manual line by line.

Any help welcome.

Jürgen Brändle
MediaNet GmbH
Netzwerk- und Applikations-Service
Lörracherstr. 5a
79115 Freiburg
Germany
braendle at medianet.freinet.de

------------------------------------------------------------
The following code entered in the command line
creates exactly the GIF I expected.
------------------------------------------------------------

/usr/local/Rrdtool/bin/rrdtool graph
/usr/local/apache/htdocs/MRTG/GRAPHS/loadas01-04.gif \
--vertical-label 'Prozessor LOAD' \
--title 'Daily load usroas01-04' \
'DEF:A=/usr/local/Mrtg/LOG/uxroas01.load.rrd:ds0:AVERAGE' \
'DEF:B=/usr/local/Mrtg/LOG/uxroas02.load.rrd:ds0:AVERAGE' \
'DEF:C=/usr/local/Mrtg/LOG/uxroas03.load.rrd:ds0:AVERAGE' \
'DEF:D=/usr/local/Mrtg/LOG/uxroas04.load.rrd:ds0:AVERAGE' \
'CDEF:loadA=A,100,/' \
'CDEF:loadB=B,100,/' \
'CDEF:loadC=C,100,/' \
'CDEF:loadD=D,100,/' \
'LINE1:loadA#0000FF:uxroas01' \
'GPRINT:A:MIN:(min=%.0lf' \
'GPRINT:A:AVERAGE:ave=%.0lf' \
'GPRINT:A:MAX:max=%.0lf)' \
'COMMENT:\n' \
'LINE1:B#00FF00:uxroas02' \
'GPRINT:B:MIN:(min=%.0lf' \
'GPRINT:B:AVERAGE:ave=%.0lf' \
'GPRINT:B:MAX:max=%.0lf)' \
'COMMENT:\n' \
'LINE1:C#FFA500:uxroas03' \
'GPRINT:C:MIN:(min=%.0lf' \
'GPRINT:C:AVERAGE:ave=%.0lf' \
'GPRINT:C:MAX:max=%.0lf)' \
'COMMENT:\n' \
'LINE1:D#FF0000:uxroas04' \
'GPRINT:D:MIN:(min=%.0lf' \
'GPRINT:D:AVERAGE:ave=%.0lf' \
'GPRINT:D:MAX:max=%.0lf)' \
'COMMENT:\n'
------------------------------------------------------------

------------------------------------------------------------
If I call the following cgi I get no graph at all
Only a Page displaying "rrdtest.cgi example page"
an "END"
If I check the source code it look like it was not parsed
at all from the rrdcgi script.
------------------------------------------------------------


#!/usr/local/Rrdtool/bin/rrdcgi
<HTML>
<HEAD><TITLE>RRDCGI Demo</TITLE></HEAD>
<BODY>
<H1>rrdtest.cgi example page</H1>
<P>
<RRD::GRAPH
/usr/local/apache/htdocs/MRTG/GRAPHS/loadas01-04.gif
--imginfo '<IMG SRC=/MRTG/GRAPHS/%s WIDTH=%lu HEIGHT=%lu>'
--vertical-label 'Prozessor LOAD'
--title 'Daily load usroas01-04'
DEF:A=/usr/local/Mrtg/LOG/uxroas01.load.rrd:ds0:AVERAGE
DEF:B=/usr/local/Mrtg/LOG/uxroas02.load.rrd:ds0:AVERAGE
DEF:C=/usr/local/Mrtg/LOG/uxroas03.load.rrd:ds0:AVERAGE
DEF:D=/usr/local/Mrtg/LOG/uxroas04.load.rrd:ds0:AVERAGE
CDEF:loadA=A,100,/
CDEF:loadB=B,100,/
CDEF:loadC=C,100,/
CDEF:loadD=D,100,/
LINE1:loadA#0000FF:uxroas01
GPRINT:A:MIN:(min=%.0lf
GPRINT:A:AVERAGE:ave=%.0lf
GPRINT:A:MAX:max=%.0lf)
LINE1:B#00FF00:uxroas02
GPRINT:B:MIN:(min=%.0lf
GPRINT:B:AVERAGE:ave=%.0lf
GPRINT:B:MAX:max=%.0lf)
LINE1:C#FFA500:uxroas03
GPRINT:C:MIN:(min=%.0lf
GPRINT:C:AVERAGE:ave=%.0lf
GPRINT:C:MAX:max=%.0lf)
LINE1:D#FF0000:uxroas04
GPRINT:D:MIN:(min=%.0lf
GPRINT:D:AVERAGE:ave=%.0lf
GPRINT:D:MAX:max=%.0lf)
>

</P>
<H2>END</H2>
</BODY>
</HTML>

-- 



--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list