Nemea framework is the heart of the Nemea system. It contains implementation of common communication interfaces, UniRec data format and useful datastructures and algorithms.
11
stars
24
forks
source link
Feature request: Print a message if module can't connect to input interface #195
If I run a module (e.g. logger) manually from a terminal and don't see any data coming, it's not obvious whether there are actually no data on the input interface, or the module can't connect to it, e.g. because of a wrong interface name used.
I know there are ways to determine the status of each interface, e.g. using -vvv or supcli -x, but none of it is practical for the common case of testing something by running modules from a terminal. An explicit message from the module would be much more user-friendly.
I propose the following:
If the input interface (any of them) fails to establish a connection AND stderr is a tty, print a message to stderr (e.g. "Can't connect to {ifc}, retrying ...").
Ideally also with a reason why it can't connect (e.g. unix-socket with such name doesn't exist, tcp connection refused, incompatible data format) and with a "connected" message when it connects succesfully afterwards.
I think it souldn't break anything, since it will print messaes only to terminal, and it would make testing/debugging much easier.
If I run a module (e.g. logger) manually from a terminal and don't see any data coming, it's not obvious whether there are actually no data on the input interface, or the module can't connect to it, e.g. because of a wrong interface name used.
I know there are ways to determine the status of each interface, e.g. using
-vvv
orsupcli -x
, but none of it is practical for the common case of testing something by running modules from a terminal. An explicit message from the module would be much more user-friendly.I propose the following: If the input interface (any of them) fails to establish a connection AND
stderr
is atty
, print a message tostderr
(e.g. "Can't connect to {ifc}, retrying ...").Ideally also with a reason why it can't connect (e.g. unix-socket with such name doesn't exist, tcp connection refused, incompatible data format) and with a "connected" message when it connects succesfully afterwards.
I think it souldn't break anything, since it will print messaes only to terminal, and it would make testing/debugging much easier.