An input is the data stream a policy analyses. Each input is declared once on the
agent as a tap, under orb.backends.pktvisor.taps, and a policy then selects a
tap by name or by tag.
Active probes against a list of targets: ICMP, TCP, HTTP and DNS over HTTPS.
sflow is also accepted as an input type and is handled by the same module as
flow. A mock input exists for testing and is not documented here.
A tap declares the input type and its configuration; the policy that uses it may
override parts of that configuration. See Input in a policy below and
the policy structure for how the two fit together.
A policy's input section names the data stream it analyses. It selects a tap,
declares what type that tap is, and may narrow or adjust it.
Required
input_type - the type of input. It is validated against the type of the tap
selected by tap or tap_selector; if they disagree, the policy fails.
tap - the name of a tap declared under orb.backends.pktvisor.taps, or
tap_selector - tags to match against the declared taps. Exactly one of the two
must be set. A selector uses either any or all, not both, and a selector that
matches no tap is an error.
Optional
filter - what data to include from the input.
config - how the input is used. These keys are the same ones the tap accepts,
documented per input type below.
A tap's configuration and the policy input's configuration are merged, with the
policy input's values taking precedence for any key set in both.
A selector that matches more than one tap attaches the policy to each of them,
which generates a separate set of metrics per tap. See
merge_like_handlers for scraping them together.
A tap abstracts away host level details, such as the ethernet interface or the
dnstap socket location, so that a policy can apply to a broad set of agents
without naming them. Taps are declared under orb.backends.pktvisor.taps, and a
single agent can declare as many as it needs.
A tap accepts input_type, config and tags only. It has no filter key, and
one written there is ignored without an error: filters belong to the policy's
input. A pcap tap can still carry a bpf expression in
its config, which is where the example below puts it.
A pcap tap can only analyse what reaches its interface. For an agent that is
not itself in the traffic path, that usually means mirroring the traffic of
interest to the interface it listens on, or putting that interface into
promiscuous mode. An agent with no visibility of the traffic produces an empty
policy rather than an error.
The following configurations are available for pcap inputs. bpf is both a
config key and a filter, so a tap can carry it in its config where a tap
cannot carry a filter.
One option of using pktvisor is for reading existing network data files. In this case, the path to the file must be passed. This variable is dominant, so if a file is passed, pktvisor will do the entire process based on the file.
The host_spec setting is useful to determine the direction of observed packets, once knowing the host ip, it is possible to determine the data flow direction, ie if they are being sent by the observed host (from host) or received (to host).
flow_type must match what the exporters send, and the port is whatever they are
configured to send to. The conventional ports differ by format:
Datagram format
flow_type
Conventional port
sFlow
sflow
6343
Netflow
netflow
9996
IPFIX
ipfix
4739
ipfix and netflow select the same parser, so either value works for an IPFIX
exporter.
bind is the local address to receive on, and both it and port must be set
together. Nothing about the port is enforced, so an exporter sending to a
different one simply needs that number here.
The following configs are available for flow inputs. A flow input reads either
from a capture file or from a UDP socket: set pcap_file, or set both port and
bind. An input that sets neither fails to start.
The 3 existing DNSTAP configurations (dnstap_file, socket and tcp) are mutually exclusive, that is, only one can be used in each input and one of them must exist. They are arranged in order of priority.
One option of using pktvisor is for reading existing network data files. In this case, the path to the file must be passed. This variable is dominant, so if a file is passed, pktvisor will do the entire process based on the file.
The other way to inform the ip and port to be monitored is through the 'tcp' configuration. Usage syntax is a string with ip:port (only ipv4 is supported for now).
only_hosts filters data to the given hosts. It is read as a list, so a bare
string is rejected. Like every filter it is set on the policy's input.filter,
not on the tap.
The netprobe input actively probes a list of targets rather than observing
traffic, and it has enough settings of its own, differing by test type, to carry
its own page.