CESNET / ipfixcol2

High-performance NetFlow v5/v9 and IPFIX collector (RFC7011)
Other
123 stars 36 forks source link

Test xml configuration and exit #64

Open crossto opened 2 years ago

crossto commented 2 years ago

Is there a way to validate xml configuration file other than ipfixcol2 -c <FILE>? I'm running timeout 1s ipfixcol2 -c <FILE> and catching RC 124 but that seems inelegant and prone to errors (slow read due to hdd spin up comes to mind).

Lukas955 commented 2 years ago

Hi,

I took a quick peek at the code, but I couldn't think of a more elegant way. Unfortunately, this is not even easy to implement, because the part when plugins process their configuration is an integral part of their initialization, during which they perform other activities (e.g. creating sockets, etc.).

Therefore, even your proposed solution fails when the plugin that is part of the configuration needs to use some exclusive resource. For example, if you are running a collector that listens on TCP port 4739, and you want to test the new configuration with the same port at the same time, even the correct configuration will end up failing because the required port is already busy.

Lukas