sflow / host-sflow

host-sflow agent
http://sflow.net
Other
153 stars 55 forks source link

Ability to use tunnel interfaces like GRE for sFlow #65

Closed sever-sever closed 8 months ago

sever-sever commented 8 months ago

Currently, tunnel interfaces (like GRE) do not seem supported. Checked on VyOS 1.5-rolling-202403250019

Simple to reproduce:

set interfaces ethernet eth1 address 192.0.2.1/30
set interfaces tunnel tun0 address '203.0.113.1/27'
set interfaces tunnel tun0 encapsulation 'gre'
set interfaces tunnel tun0 remote '192.0.2.2'
set interfaces tunnel tun0 source-address '192.0.2.1'

set system sflow agent-interface 'tun0'
set system sflow interface 'tun0'
set system sflow sampling-rate '1000'
set system sflow server 192.0.2.254

Generated configuration:

vyos@r4# cat /run/sflow/hsflowd.conf 
# Genereated by /usr/libexec/vyos/conf_mode/system_sflow.py
# Parameters http://sflow.net/host-sflow-linux-config.php

sflow {
  polling=30
  sampling=1000
  sampling.bps_ratio=0
  agent=tun0
  collector { ip = 192.0.2.254 udpport = 6343 }
  pcap { dev=tun0 }
  dbus { }
}

Logs:

Mar 29 12:45:27 r4 systemd[1]: hsflowd.service: Scheduled restart job, restart counter is at 4.
Mar 29 12:45:27 r4 systemd[1]: Stopped hsflowd.service - Host sFlow.
Mar 29 12:45:27 r4 systemd[1]: Started hsflowd.service - Host sFlow.
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(log_backtrace+0x2e)[0x56016e5f2cce]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x11ed9)[0x56016e5f2ed9]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7f85bdcdc050]
Mar 29 12:45:27 r4 hsflowd[11295]: /etc/hsflowd/modules/mod_pcap.so(+0x1954)[0x7f85bde84954]
Mar 29 12:45:27 r4 hsflowd[11295]: /etc/hsflowd/modules/mod_pcap.so(+0x1d3f)[0x7f85bde84d3f]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(EVEventTx+0xf7)[0x56016e5f3bb7]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x12d59)[0x56016e5f3d59]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x1316a)[0x56016e5f416a]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x13340)[0x56016e5f4340]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x89134)[0x7f85bdd29134]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x1097dc)[0x7f85bdda97dc]
Mar 29 12:45:27 r4 hsflowd[11295]: SIGSEGV, faulty address is (nil)
Mar 29 12:45:27 r4 hsflowd[11295]: current bus: packet
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(log_backtrace+0x2e)[0x56016e5f2cce]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x11eeb)[0x56016e5f2eeb]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x3c050)[0x7f85bdcdc050]
Mar 29 12:45:27 r4 hsflowd[11295]: /etc/hsflowd/modules/mod_pcap.so(+0x1954)[0x7f85bde84954]
Mar 29 12:45:27 r4 hsflowd[11295]: /etc/hsflowd/modules/mod_pcap.so(+0x1d3f)[0x7f85bde84d3f]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(EVEventTx+0xf7)[0x56016e5f3bb7]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x12d59)[0x56016e5f3d59]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x1316a)[0x56016e5f416a]
Mar 29 12:45:27 r4 hsflowd[11295]: /usr/sbin/hsflowd(+0x13340)[0x56016e5f4340]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x89134)[0x7f85bdd29134]
Mar 29 12:45:27 r4 hsflowd[11295]: /lib/x86_64-linux-gnu/libc.so.6(+0x1097dc)[0x7f85bdda97dc]
Mar 29 12:45:27 r4 hsflowd[11295]: PCAP: tun0 has no supported datalink encapsulaton
Mar 29 12:45:27 r4 hsflowd[11295]: Received signal 11
Mar 29 12:45:27 r4 hsflowd[11295]: SIGSEGV, faulty address is (nil)
Mar 29 12:45:27 r4 hsflowd[11295]: current bus: packet
Mar 29 12:45:27 r4 systemd[1]: hsflowd.service: Main process exited, code=exited, status=11/n/a
Mar 29 12:45:27 r4 systemd[1]: hsflowd.service: Failed with result 'exit-code'.

Version:

vyos@r4# run show version all | match hsflo
ii  hsflowd                              2.0.52-1                         all          sFlow(R) monitoring agent

An additional report https://vyos.dev/T6033

sever-sever commented 8 months ago

Update, with the version v2.0.55-1, the daemon starts correctly Will check

sever-sever commented 8 months ago

It is working with v2.0.55-1 Thanks!