.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "RRDXPORT 1" .TH RRDXPORT 1 "2022-03-14" "1.8.0" "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" rrdxport \- Export data in XML format based on data from one or several RRD .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBrrdtool\fR \fBxport\fR [\fB\-s\fR|\fB\-\-start\fR\ \fIseconds\fR] [\fB\-e\fR|\fB\-\-end\fR\ \fIseconds\fR] [\fB\-m\fR|\fB\-\-maxrows\fR\ \fIrows\fR] [\fB\-\-step\fR\ \fIvalue\fR] [\fB\-\-json\fR] [\fB\-t\fR|\fB\-\-showtime\fR] [\fB\-\-enumds\fR] [\fB\-\-daemon\fR|\fB\-d\fR\ \fIaddress\fR] [\fB\s-1DEF:\s0\fR\fIvname\fR\fB=\fR\fIrrd\fR\fB:\fR\fIds-name\fR\fB:\fR\fI\s-1CF\s0\fR] [\fB\s-1CDEF:\s0\fR\fIvname\fR\fB=\fR\fIrpn-expression\fR] [\fB\s-1XPORT\s0\fR\fB:\fR\fIvname\fR[\fB:\fR\fIlegend\fR]] .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fBxport\fR function's main purpose is to write an \s-1XML\s0 formatted representation of the data stored in one or several \fB\s-1RRD\s0\fRs. It can also extract numerical reports. .PP If no \fI\s-1XPORT\s0\fR statements are found, there will be no output. .IP "\fB\-s\fR|\fB\-\-start\fR \fIseconds\fR (default end\-1day)" 4 .IX Item "-s|--start seconds (default end-1day)" The time when the exported range should begin. Time in seconds since epoch (1970\-01\-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be printed. See also \*(L"AT-STYLE \s-1TIME SPECIFICATION\*(R"\s0 in rrdfetch for a detailed explanation on how to specify time. .Sp See \*(L"\s-1OUTPUT FORMAT\*(R"\s0 below for details on how this affects the output. .IP "\fB\-e\fR|\fB\-\-end\fR \fIseconds\fR (default now)" 4 .IX Item "-e|--end seconds (default now)" The time when the exported range should end. Time in seconds since epoch. See also \*(L"AT-STYLE \s-1TIME SPECIFICATION\*(R"\s0 in rrdfetch for a detailed explanation on how to specify time. .Sp See \*(L"\s-1OUTPUT FORMAT\*(R"\s0 below for details on how this affects the output. .IP "\fB\-m\fR|\fB\-\-maxrows\fR \fIrows\fR (default 400 rows)" 4 .IX Item "-m|--maxrows rows (default 400 rows)" This works like the \fB\-w\fR|\fB\-\-width\fR parameter of \fIrrdgraph\fR. In fact it is exactly the same, but the parameter was renamed to describe its purpose in this module. See \fIrrdgraph\fR documentation for details. .IP "\fB\-\-step\fR \fIvalue\fR (default automatic)" 4 .IX Item "--step value (default automatic)" See rrdgraph documentation. .IP "\fB\-\-daemon\fR|\fB\-d\fR \fIaddress\fR" 4 .IX Item "--daemon|-d address" Address of the rrdcached daemon. If specified, a \f(CW\*(C`flush\*(C'\fR command is sent to the server before reading the \s-1RRD\s0 files. This allows \fBrrdtool\fR to return fresh data even if the daemon is configured to cache values for a long time. For a list of accepted formats, see the \fB\-l\fR option in the rrdcached manual. .Sp .Vb 1 \& rrdtool xport \-\-daemon unix:/var/run/rrdcached.sock ... .Ve .IP "\fB\-t\fR|\fB\-\-showtime\fR" 4 .IX Item "-t|--showtime" include the time into each data row. .IP "\fB\-\-json\fR" 4 .IX Item "--json" produce json formatted output (instead of xml) .IP "\fB\-\-enumds\fR" 4 .IX Item "--enumds" The generated xml should contain the data values in enumerated tags. .Sp .Vb 1 \& valval .Ve .IP "\fB\s-1DEF:\s0\fR\fIvname\fR\fB=\fR\fIrrd\fR\fB:\fR\fIds-name\fR\fB:\fR\fI\s-1CF\s0\fR" 4 .IX Item "DEF:vname=rrd:ds-name:CF" See \fIrrdgraph\fR documentation. .IP "\fB\s-1CDEF:\s0\fR\fIvname\fR\fB=\fR\fIrpn-expression\fR" 4 .IX Item "CDEF:vname=rpn-expression" See \fIrrdgraph\fR documentation. .IP "\fB\s-1XPORT:\s0\fR\fIvname\fR[\fB:\fR\fIlegend\fR]" 4 .IX Item "XPORT:vname[:legend]" At least one \fI\s-1XPORT\s0\fR statement should be present. The values referenced by \fIvname\fR are printed. Optionally add a legend. .SH "OUTPUT FORMAT" .IX Header "OUTPUT FORMAT" The output is enclosed in an \fBxport\fR element and contains two blocks. The first block is enclosed by a \fBmeta\fR element and contains some meta data. The second block is enclosed by a \&\fBdata\fR element and contains the data rows. .PP Let's assume that the \fIxport\fR command looks like this: .PP .Vb 7 \& rrdtool xport \e \& \-\-start now\-1h \-\-end now \e \& DEF:xx=host\-inout.lo.rrd:output:AVERAGE \e \& DEF:yy=host\-inout.lo.rrd:input:AVERAGE \e \& CDEF:aa=xx,yy,+,8,* \e \& XPORT:xx:"out bytes" \e \& XPORT:aa:"in and out bits" .Ve .PP The resulting meta data section is (the values will depend on the \&\s-1RRD\s0 characteristics): .PP .Vb 11 \& \& 1020611700 \& 300 \& 1020615600 \& 14 \& 2 \& \& out bytes \& in and out bits \& \& .Ve .PP The resulting data section is: .PP .Vb 10 \& \& 10206117003.4000000000e+005.4400000000e+01 \& 10206120003.4000000000e+005.4400000000e+01 \& 10206123003.4000000000e+005.4400000000e+01 \& 10206126003.4113333333e+005.4581333333e+01 \& 10206129003.4000000000e+005.4400000000e+01 \& 10206132003.4000000000e+005.4400000000e+01 \& 10206135003.4000000000e+005.4400000000e+01 \& 10206138003.4000000000e+005.4400000000e+01 \& 10206141003.4000000000e+005.4400000000e+01 \& 10206144003.4000000000e+005.4400000000e+01 \& 10206147003.7333333333e+005.9733333333e+01 \& 10206150003.4000000000e+005.4400000000e+01 \& 10206153003.4000000000e+005.4400000000e+01 \& 1020615600NaNNaN \& .Ve .PP All the statistics in the output will use the same step. The first sample will be the first sample starting immediately after \fB\-\-start\fR. The last sample will be the one ending at or immediately after \fB\-\-end\fR. .PP Each sample has a timestamp and one or more values. The timestamps associated with a value in RRDtool \s-1ALWAYS\s0 represent the time the sample was taken. Since any value you sample will represent some sort of past state your sampling apparatus has gathered, the timestamp will always be at the end of the sampling period. .PP RRDtool does not store the actual samples, but does internal resampling of the values presented to it. Nevertheless when a data value is presented with a single timestamp the timestamp is at the end of the period the value represents. Note that the timestamp itself is outside the period the sample is valid for. For more details about this, see \s-1PDP\s0 calculation explanation. .PP So the time range for a sample with a timestamp is actually from \f(CW\*(C`timestamp \- step\*(C'\fR inclusive to \f(CW\*(C`timestamp\*(C'\fR exclusive. .PP The first line of the sample output: .PP .Vb 1 \& 10206117003.4000000000e+005.4400000000e+01 .Ve .PP therefore means that the values for the interval 1020611400 to 1020611699 were 3.4 and 54.4 for \*(L"out bytes\*(R" and \*(L"in and out bits\*(R" respectively, because the value was taken at 1020611700. .SH "EXAMPLE 1" .IX Header "EXAMPLE 1" .Vb 3 \& rrdtool xport \e \& DEF:out=if1\-inouts.rrd:outoctets:AVERAGE \e \& XPORT:out:"out bytes" .Ve .SH "EXAMPLE 2" .IX Header "EXAMPLE 2" .Vb 7 \& rrdtool xport \e \& DEF:out1=if1\-inouts.rrd:outoctets:AVERAGE \e \& DEF:out2=if2\-inouts.rrd:outoctets:AVERAGE \e \& CDEF:sum=out1,out2,+ \e \& XPORT:out1:"if1 out bytes" \e \& XPORT:out2:"if2 out bytes" \e \& XPORT:sum:"output sum" .Ve .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" The following environment variables may be used to change the behavior of \&\f(CW\*(C`rrdtool\ xport\*(C'\fR: .IP "\fB\s-1RRDCACHED_ADDRESS\s0\fR" 4 .IX Item "RRDCACHED_ADDRESS" If this environment variable is set it will have the same effect as specifying the \f(CW\*(C`\-\-daemon\*(C'\fR option on the command line. If both are present, the command line argument takes precedence. .SH "AUTHOR" .IX Header "AUTHOR" Tobias Oetiker