Skip to content

Commit 869707e

Browse files
committed
README: improve configuration doc
1 parent 6c85a4b commit 869707e

File tree

1 file changed

+101
-40
lines changed

1 file changed

+101
-40
lines changed

doc/sphinx/configuration.rst

Lines changed: 101 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,46 @@ Collector configuration
66
:align: right
77

88
IPFIXcol is designed to be easily extensible by input, intermediate and output plugins.
9-
Therefore, the startup configuration of the collector consists of 3 parts, each for one type of
9+
Therefore, the startup configuration of the collector consists of three parts, each for one type of
1010
plugins, as illustrated below. The collector typically receives data from exporters and stores
1111
them on local drive or forward them to another destination. Hence, every startup configuration
12-
contains description of at least one instance of an input plugin and one instance of an output
13-
plugin. The intermediate section can be omitted, if not required.
12+
contains a description of at least one instance of an input plugin and one instance of an output
13+
plugin. The intermediate section can be omitted if not required.
1414

1515
.. code-block:: xml
1616
1717
<ipfixcol2>
1818
<inputPlugins>
19-
...
19+
... <!-- one or more <input> -->
2020
</inputPlugins>
2121
2222
<intermediatePlugins>
23-
...
23+
... <!-- zero or more <intermediate> -->
2424
</intermediatePlugins>
2525
2626
<outputPlugins>
27-
...
27+
... <!-- one or more <output> -->
2828
</outputPlugins>
2929
</ipfixcol2>
3030
31-
A plugin documentation always provides description of parameters and configuration snippet
31+
A plugin documentation always provides a description of parameters and a configuration snippet
3232
that can be easily copied into your configuration. However, keep in mind that some parameters
3333
should be modified, for example, a storage directory of an output plugin, etc.
3434

35+
The fundamental objective of the collector is an emphasis on high performance. To reach this
36+
goal, each instance is executed by its own thread. This makes possible to run simultaneously
37+
multiple input, intermediate and output instances and at the same effectively use system resources.
38+
Just like everywhere else your collector is as fast as the slowest instance in the configuration.
39+
40+
Even multiple instances of the same plugin can run concurrently. However, instances must have
41+
slightly different configurations. For example, instances of output plugins should not write to
42+
the same directory, instances of input plugins cannot listen on the same port and interface, etc.
43+
3544
Input plugins
3645
-------------
3746

3847
The main purpose of the collector is to process flow data. To receive and process them,
39-
input plugins are essential. Thus, one or more instances of input plugins must defined within
48+
input plugins are essential. Thus, one or more instances of input plugins must be defined within
4049
``<inputPlugins>`` section. First, let's look at what is composed of:
4150

4251
.. code-block:: xml
@@ -86,14 +95,15 @@ Let's look at what the definition of an intermediate instance is composed of:
8695

8796
.. code-block:: xml
8897
89-
<intermediatePlugins>
98+
<intermediate>
9099
<name>...</name>
91100
<plugin>...</plugin>
92101
<params>...</params>
93-
</intermediatePlugins>
102+
</intermediate>
94103
95-
As you can see, the structure of configuration is almost equivalent to the structure of
96-
input instances. They differ only in the element name, but parameter meaning is still the same.
104+
As you can see, the configuration structure is almost equivalent to the structure of
105+
input instances. They differ only in the element name, but meaning of the parameters is still
106+
the same.
97107

98108
Output plugins
99109
--------------
@@ -111,10 +121,10 @@ Again, the structure of an instance definition looks pretty similar like before.
111121
<params>...</params>
112122
</output>
113123
114-
By default, an instance processes all records that are received by input plugins. Howerever, each
124+
By default, an instance processes all records that are received by input plugins. However, each
115125
output instance also supports *optional* Observation Domain ID (ODID) filter.
116126
What does it mean for you? Let's say you have multiple exporters monitoring your network.
117-
These exporters typically allows you to set an ODID associated to exported flow records so
127+
These exporters typically allow you to set an ODID associated to exported flow records so
118128
you can easily distinguish their origin. On the collector side, the ODID filter of an output
119129
instance allows you to select a range of ODIDs that should be processed by the particular instance.
120130
Flows from other sources are ignored.
@@ -123,7 +133,7 @@ How can you use it? One of many common use-cases is that if you want to store fl
123133
from different exporters to different output directories you can create multiple instances
124134
of the same output plugin with similar configurations and different ODID filters.
125135
Another use-case that is also worth mentioning is load-balancing. For example, when
126-
conversion of flow to JSON is not fast enough, you can try to split flows into multiple
136+
flow conversion to JSON is not fast enough, you can try to split flows into multiple
127137
groups based on their ODID and process each group by an independent instance of the plugin.
128138

129139
To enable the optional ODID filter, use one of the following parameter that takes a filter
@@ -154,47 +164,98 @@ ODIDs are unique per exporter. Note: In case of NetFlow devices, ODID is often r
154164
Example configuration files
155165
---------------------------
156166

167+
In this section you can see various example configuration files that demonstrate possibilities
168+
of IPFIXcol. Always keep in mind that you should modify a configuration to fit you needs.
169+
170+
:`udp2json <TODO>`_:
171+
Receive flow data over UDP, convert them into JSON and provide them as a server on local port.
172+
:`tcp2anon2json <TODO>`_:
173+
Receive flow data over TCP, anonymize them and store in JSON format on a local drive.
174+
:`tcpUdp2lnf <TODO>`_:
175+
Receive flow data simultaneously over TCP and UDP and store them on a local drive in
176+
a nfdump compatible format (multiple instances of the same input plugin).
177+
:`odidFilter <TODO>`_:
178+
Receive flow data over TCP and store flows from different ODIDs to different locations
179+
(multiple instances of the same output plugin).
180+
:`multiOutput <TODO>`_:
181+
Receive flow data over TCP and store them in a nfdump compatible format on a local drive
182+
and simultaneously send to a remote host as JSON.
157183

158-
Multiple instance of different input plugins
159-
Multiple instances of the same plugin processing different ODID range (load balancing)
184+
Try your configuration
185+
----------------------
160186

187+
When your configuration is ready, start of the collector is the next step. It is quite
188+
easy, just call:
161189

190+
.. code-block:: bash
162191
192+
ipfixcol2 -c <config_file>
163193
194+
If all plugin instances are successfully initialized, no message on output are written and
195+
the collector is running. Be default, only error messages are shown on output. It is recommended
196+
increasing verbosity level to see also warning messages (parameter "``-v``") during the first start.
164197

165-
Try your configuration
166-
----------------------
198+
Note: Receiving flow data from an exporter *over UDP transport
199+
protocol* may lead due to IPFIX protocol structure to a situation when the collector
200+
is unable to interpret data immediately after start.
201+
For more information, see documentation of `UDP <TODO>`_ plugin.
167202

168-
TOOD: how to start collector with a configuraton
169-
- just call ``ipfixcol2 -c <config_file>``.
203+
We prepared a file with few anonymized IPFIX flows, so you can try your configurations,
204+
even without running a flow exporter. Just download the `file <TODO>`_ and use ``ipfixsend2`` tool
205+
(distributed and installed together with IPFIXcol). For example, to send flow records over UDP
206+
protocol with real-time simulation use:
170207

171-
TODO: if your configuration is ready to use, you can also store to the default path
172-
where the collector looks for it... often it is /etc/ipfixcol/startup.xml
173-
however based on your OS and build configuration of the collector path can vary.
174-
Use ``ipfixcol2 -h`` to see default paths on your system. Then you can start collector
175-
by calling only ``ipfixcol2`` (without parameters)
208+
.. code-block:: bash
176209
210+
ipfixsend2 -d 127.0.0.1 -p 4739 -t UDP -i <ipfix_file> -n 1 -R 1.0
177211
212+
where:
178213

214+
================ =================================================
215+
``-d 127.0.0.1`` Destination IP address of the collector
216+
``-p 4739`` Destination port
217+
``-t UDP`` Transmission protocol (supported types: UDP/TCP)
218+
``-i <file>`` Input file with IPFIX Messages
219+
``-n 1`` How many times the file should be send
220+
``-R 1.0`` Real-time sending mode (speed 1.0x)
221+
================ =================================================
179222

223+
When all records are sent, the ``ipfixsend2`` terminates. In this case, the problem with UDP
224+
does not apply because the tool sends templates immediately after the start.
180225

181-
Verbosity
182-
---------
226+
Optionally, you can save the configuration file to the default path where IPFIXcol
227+
expects it. In that case, you can always run collector without specifying the file as a parameter.
228+
The default path can be obtained from help of the collector, see ``ipfixcol2 -h``
183229

230+
Verbosity levels
231+
----------------
184232

233+
If you run IPFIXcol without changing a verbosity configuration, only error messages are shown
234+
on output. By default, all instances inherits verbosity level from the collector settings.
235+
Therefore, increasing verbosity of the collector, e.g. "``ipfixcol2 -v``", also increase verbosity
236+
level of all plugin instances.
185237

186-
TODO: order of input/output plugin doesn't depend... order of intermediate plugins is significant
187-
TODO: verbosity level
188-
TODO: odid filter
189-
TODO: multiple instances of the same plugin can be used... for example TCP, UDP, etc..
190-
TODO: where the collector search for plugins??
238+
Sometimes it is quite useful to increase verbosity level of only certain instances or hide
239+
its messages on the console output. To achieve this, it is possible to overwrite verbosity level
240+
of individual instances using optional parameter ``<verbosity>`` supported by all types
241+
of instances. In that case, the selected level is used regardless of the global collector
242+
settings.
191243

192-
The fundamental objective of the collector is an emphasis on high performance. To reach this
193-
goal, each instance is executed by its own thread. This makes possible to run simultaneously
194-
multiple input, intermediate and output instances and at the same effectively use system resources.
244+
For example, to overwrite verbosity level of an output instance just add the new parameter as
245+
shown below. The same approach applies to other types of instances too.
246+
247+
.. code-block:: xml
248+
249+
<output>
250+
...
251+
<verbosity>debug</verbosity>
252+
...
253+
</output>
195254
196-
Even instances of the same plugin can run concurrently. However, instances must have slightly
197-
different configurations. For example, instances of output plugins should not write to the same
198-
directory, instances of input plugins cannot listen on the same port and interface, etc.
255+
Available verbosity levels:
199256

200-
Just like everywhere else your collector is as fast as the slowest plugin in the configuration.
257+
:none: Hide all messages
258+
:error: Show only error messages (i.e. something went really wrong)
259+
:warning: Show error and warning messages (i.e. something is not right, but an action can continue)
260+
:info: Show all previous types of messages and informational (status) messages
261+
:debug: Show all types of messages (i.e. include messages interesting only for developers)

0 commit comments

Comments
 (0)