NgxRRDGraph
Contents |
[edit] mod_rrd_graph
Note: this module is not distributed with the Nginx source. Installation instructions are below .
RRDtool stores and graphs time-series data. mod_rrd_graph
provides an HTTP interface to RRDtool's graphing facilities. By linking RRDtool directly into Nginx, ngx_rrd_graph is faster than scripts and CGIs with similar purposes.
[edit] Directives
[edit] rrd_graph
syntax: rrd_graph
default: n/a
context: location
ngx_rrd_graph can be enabled at a particular location with the "rrd_graph" directive, like so:
location /rrdtool { rrd_graph; }
RRDtool graphing commands can then be appended to that location in request URLs. The syntax is just the same as the arguments to the "rrdtool graph" command, omitting the filename. (Refer to rrdgraph(1) .) These commands should be URL-encoded, so that this command-line invocation:
rrdtool graph --start now-300s \ --end now \ DEF:ds0=test.rrd:reading:AVERAGE \ LINE1:ds0#00FF00
becomes:
The module supports all the features of your copy of RRDtool. It can output PNG, PDF, SVG, and EPS graphics (see the --imgformat option of rrdgraph(1)).
[edit] rrd_graph_root
syntax: rrd_graph_root /path/to/rrds
default: ""
context: location
If you'd prefer not to provide absolute paths to files referenced in DEF commands, you may supply a root directory with the "rrd_graph_root" directive. Files mentioned in DEF commands will be automatically prefixed with the value of rrd_graph_root.
[edit] Installation
ngx_rrd_graph requires RRDtool 1.3 or later.
After installing RRDtool, download the mod_rrd_graph module here: ( File:Mod rrd graph-0.2.0.tar.gz )
Extract the archive and add the following option to your Nginx ./configure command:
--add-module=/path/to/mod_rrd_graph
Then "make" and "make install" as usual.
[edit] Bugs
Please report bugs to Evan Miller.