Discussion:
[rrd-users] Using rrdcgi
(too old to reply)
Eugene Prokopiev
2015-10-09 15:50:35 UTC
Permalink
Hi,

What is the right way to use rrdcgi? I have this example.cgi:

#!/usr/bin/rrdcgi
<html>
<head><title>RRDCGI Demo</title></head>
<body>
<RRD::GRAPH packets.png --lazy --title="Packets" DEF:cel=packets.rrd:rx:AVERAGE>
</body>
</html>

I have packets.rrd in the same directory. The result is:

$ curl http://localhost:5000/example.cgi

<html>
<head><title>RRDCGI Demo</title></head>
<body>
<IMG SRC="./packets.png" WIDTH="0" HEIGHT="0">
</body>
</html>

But I have no file packets.png in the same directory after running
example.cgi. How it must be created?
--
WBR,
Eugene Prokopiev
Eugene Prokopiev
2015-10-09 15:57:32 UTC
Permalink
Post by Eugene Prokopiev
Hi,
What is the right way to use rrdcgi?
rrdtool graph do the same:

$ rrdtool graph packets.png --title="Packets" DEF:cel=packets.rrd:rx:AVERAGE
$ file packets.png
packets.png: ERROR: cannot open `packets.png' (No such file or directory)

What is wrong?
--
WBR,
Eugene Prokopiev
Eugene Prokopiev
2015-10-09 16:02:17 UTC
Permalink
Post by Eugene Prokopiev
What is wrong?
File is valid:

$ rrdtool fetch packets.rrd AVERAGE | head -5
rx tx

1444320080: 8,0828571429e+00 8,5000000000e-01
1444320150: 9,8614285714e+00 7,6857142857e-01
1444320220: 1,0824285714e+01 7,8857142857e-01
--
WBR,
Eugene Prokopiev
Steve Shipway
2015-10-10 05:39:09 UTC
Permalink
<RRD::GRAPH packets.png --lazy --title="Packets" DEF:cel=packets.rrd:rx:AVERAGE>

You have not told it what to graph! So, you get no image...

The DEF tells RRDTool about the data source (assuming packets.rrd is in the same directory) but you have no AREA or LINE directive to define a graph, so nothing will be generated.

Add at least one LINE directive...

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
***@auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

Loading...