.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RRDCGI 1" .TH RRDCGI 1 2024-03-17 1.7.2 rrdtool .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME rrdcgi \- Create web pages containing RRD graphs based on templates .SH SYNOPSIS .IX Header "SYNOPSIS" \&\f(CW\*(C`#!/path/to/\*(C'\fR\fBrrdcgi\fR [\fB\-\-filter\fR|\fB\-f\fR] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBrrdcgi\fR is a sort of very limited script interpreter. Its purpose is to run as a cgi-program and parse a web page template containing special .Ve .Sp might give you the name of the remote user given you are using some sort of access control on the directory. .IP "RRD::GOODFOR \fIseconds\fR" 8 .IX Item "RRD::GOODFOR seconds" Specify the number of seconds this page should remain valid. This will prompt the rrdcgi to output a Last-Modified, an Expire and if the number of seconds is \fInegative\fR a Refresh header. .IP "RRD::INCLUDE \fIfilename\fR" 8 .IX Item "RRD::INCLUDE filename" Include the contents of the specified file into the page returned from the cgi. .IP "RRD::SETENV \fIvariable\fR \fIvalue\fR" 8 .IX Item "RRD::SETENV variable value" If you want to present your graphs in another time zone than your own, you could use .Sp .Vb 1 \& .Ve .Sp to make sure everything is presented in Universal Time. Note that the values permitted to TZ depend on your OS. .IP "RRD::SETVAR \fIvariable\fR \fIvalue\fR" 8 .IX Item "RRD::SETVAR variable value" Analog to SETENV but for local variables. .IP "RRD::GETVAR \fIvariable\fR" 8 .IX Item "RRD::GETVAR variable" Analog to GETENV but for local variables. .IP "RRD::TIME::LAST \fIrrd-file\fR \fIstrftime-format\fR" 8 .IX Item "RRD::TIME::LAST rrd-file strftime-format" This gets replaced by the last modification time of the selected RRD. The time is \fIstrftime\fR\-formatted with the string specified in the second argument. .IP "RRD::TIME::NOW \fIstrftime-format\fR" 8 .IX Item "RRD::TIME::NOW strftime-format" This gets replaced by the current time of day. The time is \&\fIstrftime\fR\-formatted with the string specified in the argument. .Sp Note that if you return : (colons) from your strftime format you may have to escape them using \e if the time is to be used as an argument to a GRAPH command. .IP "RRD::TIME::STRFTIME \fISTART|END\fR \fIstart-spec\fR \fIend-spec\fR \fIstrftime-format\fR" 8 .IX Item "RRD::TIME::STRFTIME START|END start-spec end-spec strftime-format" This gets replaced by a strftime-formatted time using the format \&\fIstrftime-format\fR on either \fIstart-spec\fR or \fIend-spec\fR depending on whether \fISTART\fR or \fIEND\fR is specified. Both \fIstart-spec\fR and \fIend-spec\fR must be supplied as either could be relative to the other. This is intended to allow pretty titles on graphs with times that are easier for non RRDtool folks to figure out than "\-2weeks". .Sp Note that again, if you return : (colon) from your strftime format, you may have to escape them using \e if the time is to be used as an argument to a GRAPH command. .IP "RRD::GRAPH \fIrrdgraph arguments\fR" 8 .IX Item "RRD::GRAPH rrdgraph arguments" This tag creates the RRD graph defined by its argument and then is replaced by an appropriate tag referring to the graph. The \fB\-\-lazy\fR option in RRD graph can be used to make sure that graphs are only regenerated when they are out of date. The arguments to the \fBRRD::GRAPH\fR tag work as described in the \fBrrdgraph\fR manual page. .Sp Use the \fB\-\-lazy\fR option in your RRD::GRAPH tags, to reduce the load on your server. This option makes sure that graphs are only regenerated when the old ones are out of date. .Sp If you do not specify your own \fB\-\-imginfo\fR format, the following will be used: .Sp .Vb 1 \& .Ve .Sp Note that \f(CW%s\fR stands for the filename part of the graph generated, all directories given in the PNG file argument will get dropped. .IP "RRD::PRINT \fInumber\fR" 8 .IX Item "RRD::PRINT number" If the preceding \fBRRD::GRAPH\fR tag contained any \fBPRINT\fR arguments, then you can access their output with this tag. The \fInumber\fR argument refers to the number of the \fBPRINT\fR argument. The first \fBPRINT\fR has \fInumber\fR 0. .IP "RRD::INTERNAL " 8 .IX Item "RRD::INTERNAL " This tag gets replaced by an internal var. Currently these vars are known: VERSION, COMPILETIME. These vars represent the compiled-in values. .SH "EXAMPLE 1" .IX Header "EXAMPLE 1" The example below creates a web page with a single RRD graph. .PP .Vb 9 \& #!/usr/local/bin/rrdcgi \& \& RRDCGI Demo \& \&

RRDCGI Example Page

\&

\& \& \&

\& \& .Ve .SH "EXAMPLE 2" .IX Header "EXAMPLE 2" This script is slightly more elaborate, it allows you to run it from a form which sets RRD_NAME. RRD_NAME is then used to select which RRD you want to use as source for your graph. .PP .Vb 10 \& #!/usr/local/bin/rrdcgi \& \& RRDCGI Demo \& \&

RRDCGI Example Page for

\&

Selection

\&
Room A, \& Room B. \&
\&

Graph

\&

\& .png \-\-lazy \& \-\-title "Temperatures for " \& DEF:cel=.rrd:exhaust:AVERAGE \& LINE2:cel#00a000:"D. Celsius"> \& \&

\& \& .Ve .SH "EXAMPLE 3" .IX Header "EXAMPLE 3" This example shows how to handle the case where the RRD, graphs and cgi-bins are separate directories .PP .Vb 10 \& #!/.../bin/rrdcgi \& \& RRDCGI Demo \& \&

RRDCGI test Page

\& \*(Aq \& \-\-lazy \-\-start \-1d \-\-end now \& DEF:http_src=/.../rrds/test.rrd:http_src:AVERAGE \& AREA:http_src#00ff00:http_src \& > \& \& .Ve .PP Note 1: Replace /.../ with the relevant directories .PP Note 2: The SRC=/.../pngs should be paths from the view of the webserver/browser .SH AUTHOR .IX Header "AUTHOR" Tobias Oetiker