1
2SFCAPD(1)                 BSD General Commands Manual                SFCAPD(1)
3

NAME

5     sfcapd — sflow collector for sflow version v2/v4 and v5
6

SYNOPSIS

8     sfcapd -w flowdir [-C config] [-z=<compress>] [-D] [-u userid]
9            [-g groupid] [-S num] [-t interval] [-P pidfile] [-p port]
10            [-d device] [-I ident] [-b bindhost] [-f flowfile] [-4] [-6]
11            [-j mcastgroup] [-R repeater] [-A] [-B buffsize] [-n sourceparam]
12            [-M multiflowdir] [-i metricrate] [-m metricpath] [-e]
13            [-x command] [-E] [-v] [-V]
14

DESCRIPTION

16     sfcapd reads sflow data from the network and stores the records into bi‐
17     nary formatted files. The sflow implementation is based of sflowtool. The
18     packet samples are converted into netflow compatible records.
19
20     If you want to collect netflow data, please have a look at nfcapd which
21     is also part of the nfdump tools.
22
23     Sflow is an industry standard developed by InMon Corporation.  For more
24     information see http://sflow.org.
25
26     sfcapd is the twin of nfcapd and supports the same feature set. See also
27     nfcapd(1) for more details.
28
29     The options are as follows:
30
31     -w flowdir
32             Set the flow directory to store the output files. If a sub hier‐
33             archy is specified with -S the final directory is concatenated to
34             flowdir/subdir.
35
36     -C config
37             Reads additional configuration parameters from config file.
38             sfcapd tries to read the config file from the install default
39             path $prefix/etc/ which may be overwritten by the environment
40             variable NFCONF , which again is overwritten by this option -C.
41             If -C none is specified, then no config file is read, even if
42             found in the search path.
43
44     -p portnum
45             Set the port number to listen. Default port is 9995
46
47     -d interface
48             Reads sflow data from an erspan encoded datalink. All traffic
49             sent to this interface is interpreted as sflow data stream.
50
51     -b bindhost
52             Specifies the hostname/IPv4/IPv6 address to bind for listening.
53             This can be an IP address or a hostname, resolving to a local IP
54             address.
55
56     -4      Forces sfcapd to listen on IPv4 addresses only. Can be used to‐
57             gether with -b if a hostname has IPv4 and IPv6 addresses.
58
59     -6      Forces sfcapd to listen on IPv6 addresses only. Can be used to‐
60             gether with -b if a hostname has IPv4 and IPv6 addresses.
61
62     -J mcastgroup
63             Join the specified IPv4 or IPv6 multicast group for listening.
64
65     -R host[/port]
66             Enables the packet repeater. All incoming packets are sent addi‐
67             tionally to another host and port.  host is either a valid
68             IPv4/IPv6 address, or a symbolic hostname, which resolves to a
69             valid IP address.  port may be omitted and defaults to 9995.
70             Note: As IPv4/IPv6 are accepted the host/port separator is '/'.
71             Up to 8 additional repeaters my be defined. Use this method to
72             daisy chain collectors.
73
74     -A      Sets source address spoofing mode for the repeater. The source
75             address of the repeated packages is set to the original IP ad‐
76             dress. This needs sfcapd to be started with root privileges.
77             Please note, that source spoofing may be blocked by firewalls or
78             routers in your network.
79
80     -I ident
81             Sets ident as identification string for the current source. This
82             string is written into the output file to identify the source.
83             Default is 'none'. If you have multiple sources, see option -n
84             below.
85
86     -n ident,IP,flowdir
87             Configures a netflow source identified by the string ident, IP
88             flowdir If you have multiple sources per collector, add multiple
89             -n options. All exporters send the flows to the same port -p.  Do
90             not mix single source configuration -I with multiple -n options.
91
92     -M flowdir
93             Set the flow directory for dynamic allocated exporters. New ex‐
94             porters are dynamically added when sending data.  All exporters
95             send netflow data to the same port and IP. For each dynamically
96             added source, a new sub directory is created under flowdir with
97             the name of the IP address of the exporter. All '.' and ':" in IP
98             addresses are replaced be '-'.  -D Set daemon mode: fork to back‐
99             ground and detach from terminal.  sfcapd terminates on signal
100             TERM, INT or HUP.
101
102     -P pidfile
103             Writes the running process ID into pidfilw.  Use this option to
104             integrate sfcapd in start/stop files.
105
106     -u userid
107             Drop privileges of running process to user userid.  sfcapd needs
108             to be started as user root.
109
110     -g groupid
111             Drop privileges of running process to group groupid.  sfcapd
112             needs to be started as user root.
113
114     -B bufflen
115             Sets the network socket input buffer to bufflen bytes. For high
116             volume traffic it is recommended to raise this value to typically
117             > 100k, otherwise you risk to lose packets. The default is OS
118             (and kernel) dependent.
119
120     -S num  Adds an additional directory sub hierarchy to store the data
121             files. The default is 0, no sub hierarchy, which means all files
122             go directly into flowdir.  The flowdir is concatenated with the
123             specified sub hierarchy format to create the final data direc‐
124             tory.  The following hierarchies are defined:
125             0 default     no hierarchy levels
126             1 %Y/%m/%d    year/month/day
127             2 %Y/%m/%d/%H year/month/day/hour
128             3 %Y/%W/%u    year/week_of_year/day_of_week
129             4 %Y/%W/%u/%H year/week_of_year/day_of_week/hour
130             5 %Y/%j       year/day-of-year
131             6 %Y/%j/%H    year/day-of-year/hour
132             7 %Y-%m-%d    year-month-day
133             8 %Y-%m-%d/%H year-month-day/hour
134
135     -t interval
136             Sets the time interval in seconds to rotate files. The default
137             value is 300s ( 5min ).  The smallest available interval is 2s.
138
139     -z=lzo  Compress flow files with LZO1X-1 compression. Fastest compres‐
140             sion.
141
142     -z=lz4  Compress flow files with LZ4 compression. Fast and efficient.
143
144     -z=bz2  Compress flow files with bz2 compression. Slow but most effi‐
145             cient. It is not recommended to use bz2 in a real time capturing.
146
147     -e      Sets auto-expire mode. At the end of every rotate interval -t
148             sfcapd runs an expire cycle to delete files according to max
149             lifetime and max filesize as defined by nfexpire(1)
150
151     -x command
152             At the end of every -t interval and after the file rotate has
153             completed, sfcapd runs the command command.  The string for
154             command may contain the following place holders, which are ex‐
155             panded before running:
156             %f   File name of new data file including any sub hierarchy.
157             %d   Top flowdir.  The full path of the new file is: %d/%f
158             %t   Time slot string in ISO format e.g. 201107110845.
159             %u   Time slot string in UNIX time format.
160             %i   Identification string ident string supplied by -I
161
162     -m metricpath
163             Enables the flow metric exporter. Flow metric information is sent
164             to the UNIX socket metricpath at the rate specified by -i This
165             option may by used to export flow metric information to other
166             systems such as InfluxDB or Prometheus.  Please note: The flow
167             metric does not include the full record. Only the flow statistics
168             is sent.
169
170     -i metricrate
171             Sets the interval for the flow metric exporter. This interval may
172             be different from the file rotation interval t and is therefore
173             independent from file rotation.
174
175     -v      Increase verbose level by 1. The verbose level may be increased
176             for debugging purpose up to 3.
177
178     -E      Equal to -v -v -v. Print netflow records in block format to std‐
179             out. Please note, that not all elements are printed, which are
180             available in the flow record. To inspect all elements, use nfdump
181             -o raw This option is for debugging purpose only, to verify if
182             incoming netflow data is processed correctly.
183
184     -V      Print sfcapd version and exit.
185
186     -h      Print help text on stdout with all options and exit.
187

RETURN VALUES

189     sfcapd returns 0 on success and 255 if initialization failed.
190

SEE ALSO

192     http://sflow.org
193
194     https://sflow.org/developers/licensing.php
195
196     https://github.com/sflow/sflowtool
197
198     nfdump(1) nfcapd(1) nfpcapd(1)
199

BUGS

201     No software without bugs! Please report any bugs back to me.
202
203BSD                            December 20, 2023                           BSD
Impressum