-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathipfixcol-profilestats-inter.dbk
More file actions
316 lines (299 loc) · 11.3 KB
/
Copy pathipfixcol-profilestats-inter.dbk
File metadata and controls
316 lines (299 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<?xml version="1.0" encoding="utf-8"?>
<refentry
xmlns:db="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xlink http://docbook.org/xml/5.0/xsd/xlink.xsd
http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"
version="5.0" xml:lang="en">
<info>
<copyright>
<year>2017</year>
<holder>CESNET, z.s.p.o.</holder>
</copyright>
<date>29 August 2017</date>
<authorgroup>
<author>
<personname>
<firstname>Michal</firstname>
<surname>Kozubik</surname>
</personname>
<email>kozubik@cesnet.cz</email>
<contrib>developer</contrib>
</author>
<author>
<personname>
<firstname>Lukas</firstname>
<surname>Hutak</surname>
</personname>
<email>lukas.hutak@cesnet.cz</email>
<contrib>developer</contrib>
</author>
</authorgroup>
<orgname>The Liberouter Project</orgname>
</info>
<refmeta>
<refentrytitle>ipfixcol-profilestats-inter</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo otherclass="manual" class="manual">ProfileStats plugin for IPFIXcol.</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ipfixcol-profilestats-inter</refname>
<refpurpose>ProfileStats plugin for IPFIXcol.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<simpara>
The <command>ipfix-profilestats-inter</command> is intermediate plugin for IPFIXcol (IPFIX collector).
</simpara>
<simpara>
The plugin creates and updates RRD statistics per profile and channel. Based on a configuration of profiles maintained by <citerefentry><refentrytitle>ipfixcol-profiler-inter</refentrytitle><manvolnum>1</manvolnum></citerefentry> plugin, corresponding databases are updated every interval. If RRD databases already exist, old ones will be used for updates and a previous content will be preserved. The databases store high quality i.e. short term records (defined by a size of update interval) for last 3 months and low quality i.e. long term records (one record per day) for 5 years. Each RRD consists of following Data Sources:
</simpara>
<para>
<segmentedlist>
<segtitle>Name</segtitle>
<segtitle>Description</segtitle>
<!-- Flows -->
<seglistitem>
<seg>flows</seg>
<seg>Number of all flows per second</seg>
</seglistitem>
<seglistitem>
<seg>flows_tcp</seg>
<seg>Number of TCP flows per second</seg>
</seglistitem>
<seglistitem>
<seg>flows_udp</seg>
<seg>Number of UDP flows per second</seg>
</seglistitem>
<seglistitem>
<seg>flows_icmp</seg>
<seg>Number of ICMP flows per second</seg>
</seglistitem>
<seglistitem>
<seg>flows_other</seg>
<seg>Number of other flows (i.e. not TCP/UDP/ICMP) per second</seg>
</seglistitem>
<seglistitem>
<!-- Blank line -->
</seglistitem>
<!-- Packets -->
<seglistitem>
<seg>packets</seg>
<seg>Number of all packets per second</seg>
</seglistitem>
<seglistitem>
<seg>packets_tcp</seg>
<seg>Number of TCP packets per second</seg>
</seglistitem>
<seglistitem>
<seg>packets_udp</seg>
<seg>Number of UDP packets per second</seg>
</seglistitem>
<seglistitem>
<seg>packets_icmp</seg>
<seg>Number of ICMP packets per second</seg>
</seglistitem>
<seglistitem>
<seg>packets_other</seg>
<seg>Number of other packets (i.e. not TCP/UDP/ICMP) per second</seg>
</seglistitem>
<seglistitem>
<seg>packets_max</seg>
<seg>Maximum packets from one flow per interval</seg>
</seglistitem>
<seglistitem>
<seg>packets_avg</seg>
<seg>Average number of packets per flow and per interval</seg>
</seglistitem>
<seglistitem>
<!-- Blank line -->
</seglistitem>
<!-- Traffic -->
<seglistitem>
<seg>traffic</seg>
<seg>Number of all bytes per second</seg>
</seglistitem>
<seglistitem>
<seg>traffic_tcp</seg>
<seg>Number of TCP bytes per second</seg>
</seglistitem>
<seglistitem>
<seg>traffic_udp</seg>
<seg>Number of UDP bytes per second</seg>
</seglistitem>
<seglistitem>
<seg>traffic_icmp</seg>
<seg>Number of ICMP bytes per second</seg>
</seglistitem>
<seglistitem>
<seg>traffic_other</seg>
<seg>Number of other bytes (i.e. not TCP/UDP/ICMP) per second</seg>
</seglistitem>
<seglistitem>
<seg>traffic_max</seg>
<seg>Maximum bytes from one flow per interval</seg>
</seglistitem>
<seglistitem>
<seg>traffic_avg</seg>
<seg>Average number of bytes per flow and per interval</seg>
</seglistitem>
</segmentedlist>
</para>
<simpara>
Each source have consolidation functions "MAX" and "AVERAGE". Consolidation functions consilidate primary data points (in this case, a record per interval) via an agregation functions. This is necessary, for example, for storing long term statistics, because one long term RRD recond is generated from multiple data points (even several thousands). "AVERAGE" is an average of the data points and "MAX" is the larges of the data points. For short term statistics (for example displaying statistics since last hour) consolidation functions usuallly generate same results.
</simpara>
<simpara>
An RRD database for a profile is created in "/rrd/" subdirectory of a main directory of the profile. For each channel of the profile is created a separated RRD database in "/rrd/channels/" subdirectory. For example, for profile "live" and its channels "ch1" and "ch2", the plugin will create databases: <profile_dir>/rrd/live.rrd, <profile_dir>/rrd/channels/ch1.rrd and <profile_dir>/rrd/channels/ch2.rrd.
</simpara>
</refsect1>
<refsect1>
<title>Configuration</title>
<simpara>The collector must be configured to use ProfileStats plugin in startup.xml configuration. The profiler plugin (<citerefentry><refentrytitle>ipfixcol-profiler-inter</refentrytitle><manvolnum>1</manvolnum></citerefentry>) <emphasis>must</emphasis> be placed before ProfileStats in the IPFIXcol pipeline. Otherwise no profiles description will be available and no databases will be created/updated.
</simpara>
<simpara>
The configuration specifies which plugins are used by the collector to process data and provides configuration for the plugins themselves.
</simpara>
<simpara><filename>startup.xml</filename> profilestats example</simpara>
<programlisting>
<![CDATA[
<profilestats>
<interval>300</interval>
<align>true</align>
<baseDir></baseDir>
</profilestats>
]]>
</programlisting>
<para>
<variablelist>
<varlistentry>
<term><command>interval</command></term>
<listitem>
<simpara>Update interval (in seconds). Size of the interval significantly influence size of databases. [min: 5, max: 3600, default: 300]</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>align</command></term>
<listitem>
<simpara>Align update interval. For example, if interval is 5 min, perform database update at 0, 5, 10, etc. wall clock minutes. [default: true]</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><command>baseDir</command></term>
<listitem>
<simpara>
Expected storage for databases. Profiles with storage directories outside of the path are omitted. This allows you to make sure that files will be stored only into specified location.
This directory must already exist in your system, otherwise all data will be lost. If the directory is not specified or the path is empty, no directory check will be performed.
Path may contain special character sequences, each of which is introduced by a "%" character and terminated by some other character. Each of this sequences is substituted by its value. Currently supported special characters: %h = hostname.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>How to generate a graph (with RRD tools)</title>
<simpara>
For example, let us consider a profile with two channels, "ch1" and "ch2".
The channel "ch1" accepts all records with IPv4 addresses and channel
"ch2" accepts all records with IPv6 address. We want to create a graph of
a number of TCP flows per second since last 2 hours (i.e. -7200 seconds).
</simpara>
<simpara>
First, we have to fetch data from both RRD files (one file per channel).
This function fetch data from an RRD file:
<command>
DEF:<vname>=<file>:<source>:<cf>
</command> ("vname" is variable name of a time series, "file" is path
to an RRD file, "source" is a name of a Data Source in the RRD file
and "cf" is a Consolidation function).
To create the time series called "IP4" with the number of TCP
flows (Data Series "flows_tcp") from the file
"ch1.rrd" use command "DEF:IP4=ch1.rrd:flows_tcp:AVERAGE". Similarly
for the IP6 time series.
</simpara>
<simpara>
Finally, any time series can displayed, for example, as area using the command:
<command>AREA:<vname>:<#color>:<legend></command>
("vname" is variable name of a time series, "color" is an RGB(A) color,
"legend" is a legend of the series).
</simpara>
<simpara>
Example rrdtool command:
</simpara>
<programlisting>
<![CDATA[
rrdtool graph traffic.png \
--full-size-mode -w 640 -h 480 \
--start -7200 --end now \
--title "TCP flows" \
--lower-limit 0 --alt-y-grid \
--vertical-label "flows per second" \
DEF:IP4=ch1.rrd:flows_tcp:AVERAGE \
DEF:IP6=ch2.rrd:flows_tcp:AVERAGE \
AREA:IP4#66CC00:"IPv4" \
AREA:IP6#FF0000:"IPv6":STACK
]]>
</programlisting>
<simpara>
Tip: Say you want to display a traffic speed in bits per seconds (instead of bytes
per seconds as stored in the database). You have to define a calculation on a variable.
<command>CDEF:<vname>=<expression></command>. For example:
</simpara>
<programlisting>
<![CDATA[
...
DEF:bytes=ch1.rrd:traffic:AVERAGE \
CDEF:bits=bytes,8,* \
AREA:bits#FF0000:"bits per second" \
...
]]>
</programlisting>
</refsect1>
<refsect1>
<title>Notes</title>
<simpara>
It is highly recommended to use only one instance of the plugin in the configuration of IPFIXcol, because external RRD library is not very thread-safety.
</simpara>
</refsect1>
<refsect1>
<title>See Also</title>
<para></para>
<para>
<variablelist>
<varlistentry>
<term>
<citerefentry><refentrytitle>ipfixcol</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</term>
<listitem>
<simpara>Man pages</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<link xlink:href="http://www.liberouter.org/technologies/ipfixcol/">http://www.liberouter.org/technologies/ipfixcol/</link>
</term>
<listitem>
<para>IPFIXcol Project Homepage</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<link xlink:href="http://www.liberouter.org">http://www.liberouter.org</link>
</term>
<listitem>
<para>Liberouter web page</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<email>tmc-support@cesnet.cz</email>
</term>
<listitem>
<para>Support mailing list</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>