nfacctd: print plugin crashes silently if plugin_pipe_zmq is enabled instead of plugin_pipe_size #842
Description
Hi Paolo!
Our nfacctd 1.7.10-git is running on CentOS 6.10.
We previously used the "home-grown circular queue implemetation" (plugin_pipe_size: 262144000).
But "Missing data detected" messages started to appear in logs, so we decided to try ZeroMQ.
Unfortunately if plugin_pipe_zmq is on (plugin_pipe_zmq_profile: large) then our print plugin dies silently soon after process startup.
No debug/error messages logged, even in debug mode with debug_internal_msg enabled :(
-- nfacctd.log
INFO ( default/core ): NetFlow Accounting Daemon, nfacctd 1.7.10-git (20241121-0 (f8ee66b))
INFO ( default/core ): '--enable-zmq=yes' '--enable-l2' '--enable-traffic-bins' '--enable-bgp-bins' '--enable-bmp-bins' '--enable-st-bins'
INFO ( default/core ): Reading configuration file '/home/ap/netflow/CKAT/nfacctd.conf'.
INFO ( default/core ): nfacctd_pipe_size: obtained=268435456 target=134217728.
INFO ( default/core ): [/home/ap/netflow/CKAT/ext-fields.lst] (re)loading map.
INFO ( default/core ): [/home/ap/netflow/CKAT/ext-fields.lst] map successfully (re)loaded.
DEBUG ( default/core ): Custom primitive 'login': type=ffff000000000001 len=vlen
DEBUG ( default/core ): Custom primitive 'vchannel': type=ffff000000000004 off=0 len=2
DEBUG ( default/core ): Custom primitive 'dpi_protocol': type=ffff000000000002 off=2 len=2
DEBUG ( csv/print ): p_zmq_send_setup() addr=tcp://127.0.0.1:35808 username=sivXJXyGgJs2ZMmqK1KU49McJ...
INFO ( default/core ): [/home/ap/netflow/CKAT/pretag.map] (re)loading map.
INFO ( csv/print ): cache entries=114877 base cache memory=394257864 bytes
INFO ( default/core ): [/home/ap/netflow/CKAT/pretag.map] map successfully (re)loaded.
INFO ( default/core ): [/home/ap/netflow/CKAT/pretag.map] (re)loading map.
INFO ( default/core ): [/home/ap/netflow/CKAT/pretag.map] map successfully (re)loaded.
DEBUG ( default/core ): [/home/ap/netflow/CKAT/networks.lst] IPv4 Networks Cache successfully created: 99991 entries.
INFO ( default/core ): [/home/ap/netflow/CKAT/networks.lst] map successfully (re)loaded.
DEBUG ( default/core ): [/home/ap/netflow/CKAT/networks.lst] IPv6 Networks Cache successfully created: 32771 entries.
INFO ( default/core ): waiting for NetFlow/IPFIX data on interface=all ip=:: port=3440/udp
DEBUG ( csv/print ): p_zmq_recv_setup() addr=tcp://127.0.0.1:35808 username=sivXJXyGgJs2ZMmqK1KU49McJ...
DEBUG ( default/core ): Received NetFlow/IPFIX packet from [x.y] version [10] seqno [2463994985]
DEBUG ( default/core ): Processing NetFlow/IPFIX flowset [2] from [x.y] seqno [2463994985]
DEBUG ( default/core ): NfV10 template type : flow
DEBUG ( default/core ): NfV10 template ID : 256
DEBUG ( default/core ): Netflow V9/IPFIX record size : tbd
DEBUG ( default/core ): Received NetFlow/IPFIX packet from [...] version [10] seqno [2463994994]
DEBUG ( default/core ): Processing NetFlow/IPFIX flowset [256] from [...] seqno [2463994994]
DEBUG ( csv/print ): buffer released len=999884 seq=1 num_entries=3376 off=0
DEBUG ( csv/print ): buffer received len=999884 seq=1 num_entries=3376
DEBUG ( default/core ): Received NetFlow/IPFIX packet from [...] version [10] seqno [2463999619]
DEBUG ( default/core ): Processing NetFlow/IPFIX flowset [256] from [...] seqno [2463999619]
WARN ( default/core ): connection lost to 'csv-print'; closing connection.
WARN ( default/core ): no more plugins active. Shutting down.
-- nfacctd version:
./nfacctd -V
NetFlow Accounting Daemon, nfacctd 1.7.10-git [20241121-0 (f8ee66b)]
Arguments:
'--enable-zmq=yes' '--enable-l2' '--enable-traffic-bins' '--enable-bgp-bins' '--enable-bmp-bins' '--enable-st-bins'
Libs:
cdada 0.6.0
libpcap version 1.4.0
ZeroMQ 4.3.5
Plugins:
memory
print
nfprobe
sfprobe
tee
System:
Linux 2.6.32-754.18.2.el6.x86_64 #1 SMP Wed Aug 14 16:26:59 UTC 2019 x86_64
Compiler:
gcc 4.4.7
-- nfacctd.conf
debug: true
debug_internal_msg: true
daemonize: true
logfile: /home/ap/netflow/CKAT/nfacctd.log
!
nfacctd_port: 3440
nfacctd_pipe_size: 134217728
!
aggregate_primitives: /home/ap/netflow/CKAT/ext-fields.lst
pre_tag_map: /home/ap/netflow/CKAT/pretag.map
networks_file: /home/ap/netflow/CKAT/networks.lst
nfacctd_time_new: true
nfacctd_stitching: true
plugin_pipe_zmq: true
plugin_pipe_zmq_profile: large
!
!
plugins: print[csv]
!
print_cache_entries[csv]: 114877
aggregate[csv]: login, label, tag, vchannel, dpi_protocol
print_refresh_time[csv]: 1200
print_history[csv]: 1200s
print_output_file[csv]: /home/ap/netflow/CKAT/csv/nf_%Y%m%d-%H%M%S.csv
print_output[csv]: csv