### Install hsflowd on Debian/Ubuntu Source: https://sflow.net/downloads.php Installs the hsflowd package, enables the service, and starts it. Configuration is typically done in /etc/hsflowd.conf. ```bash sudo dpkg -i hsflowd_.amd64.deb sudo systemctl enable hsflowd sudo vi /etc/hsflowd.conf sudo systemctl start hsflowd ``` -------------------------------- ### Install hsflowd on Red Hat/CentOS/Alma/RockyLinux Source: https://sflow.net/downloads.php Installs the hsflowd package, enables the service, and starts it. Configuration is typically done in /etc/hsflowd.conf. ```bash sudo dnf install hsflowd-.x86_64.rpm sudo systemctl enable hsflowd sudo vi /etc/hsflowd.conf sudo systemctl start hsflowd ``` -------------------------------- ### Configure PSAMPLE Packet Sampling Source: https://sflow.net/host-sflow-linux-config.php Listen for packet samples on PSAMPLE channel 1. This example shows configuration using 'tc' commands. ```bash psample { group=1 } ``` ```bash DEV=eth0 RATE=1000 GROUP=1 tc qdisc add dev $DEV handle ffff: ingress tc filter add dev $DEV parent ffff: matchall \ action sample rate $RATE group $GROUP ``` -------------------------------- ### Install hsflowd on Cumulus Linux Source: https://sflow.net/downloads.php Installs the hsflowd package using apt-get. Further configuration details can be found in the documentation. ```bash apt-get install hsflowd ``` -------------------------------- ### Configure DBUS Agent Source: https://sflow.net/host-sflow-linux-config.php Allows internal hsflowd telemetry counters to be queried via DBUS. Refer to the 'telemetry' script in the repository for examples. ```none dbus { } ``` -------------------------------- ### Configure KVM Hypervisor Integration Source: https://sflow.net/host-sflow-linux-config.php Enables sFlow monitoring for Red Hat KVM Hypervisors by connecting to libvirt libraries to discover and monitor VMs. Can be used with 'ovs {}' or 'pcap { dev=virbr0 }' for traffic monitoring. ```none kvm { } ``` -------------------------------- ### Configure XenServer Integration Source: https://sflow.net/host-sflow-linux-config.php Enables sFlow monitoring on a XenServer DDK domain0 node by connecting to Xen libraries to discover and monitor VMs. Use with 'ovs {}' for Open vSwitch traffic monitoring. ```none xen { } ``` -------------------------------- ### Configure Docker Container Monitoring Source: https://sflow.net/host-sflow-linux-config.php Connects to /var/run/docker.sock to discover and monitor Docker containers. The 'markTraffic=on' setting helps map traffic to containers. Use with 'pcap' for traffic monitoring. ```none docker { markTraffic=on } ``` -------------------------------- ### Configure Containerd Container Monitoring Source: https://sflow.net/host-sflow-linux-config.php Discovers and monitors containers by running a Go program in a child process. Use in conjunction with 'pcap' configurations for traffic monitoring. ```none containerd { markTraffic=on } ``` -------------------------------- ### KVM Hypervisor sFlow with Open vSwitch Source: https://sflow.net/host-sflow-linux-config.php Configure sFlow for KVM hypervisors when using Open vSwitch, including sampling rate. ```shell sflow { sampling = 500 collector { ip = 10.100.12.13 } kvm {} ovs {} } ``` -------------------------------- ### Configure VPP Agent with Packet Sampling and Drop Monitoring Source: https://sflow.net/host-sflow-linux-config.php Accepts counters, packet samples, and packet drops via netlink from the VPP sFlow plugin. The 'osIndex=on' setting maps VPP interfaces to their Linux equivalents. ```none psample { group=1 egress=on } ``` ```none dropmon { start=on limit=50 } ``` ```none vpp { osIndex=on } ``` -------------------------------- ### Host sFlow with DNS-SD Configuration Source: https://sflow.net/host-sflow-linux-config.php Configure Host sFlow to use DNS-SD for discovering collectors. ```shell sflow { dns-sd { domain = .sf.inmon.com } } ``` -------------------------------- ### Configure Open vSwitch Integration Source: https://sflow.net/host-sflow-linux-config.php Enables sharing sFlow sampling, polling, and collector information with the local Open vSwitch virtual switch. ```config ovs { } ``` -------------------------------- ### Configure dent Module for Automatic TC Configuration Source: https://sflow.net/host-sflow-linux-config.php Sets up software sampling and identifies interfaces matching 'enp.*' as switch ports for automatic tc configuration by the dent hsflowd module. ```none dent { sw=on switchport=enp.* } ``` -------------------------------- ### Configure Nvidia NVML GPU Monitoring Source: https://sflow.net/host-sflow-linux-config.php Includes host GPU statistics with the sFlow feed by connecting to the libnvml library. This module requires building from sources as it is not compiled by default. ```none nvml { } ``` -------------------------------- ### Configure PSAMPLE and dent for Egress Sampling Source: https://sflow.net/host-sflow-linux-config.php Enables egress sampling for PSAMPLE channel 1 and configures the dent module for hardware switch sampling, potentially providing transit delay and buffer depth measurements. ```none psample { group=1 egress=on } ``` ```none dent { sw=off switchport=^swp[0-9]+$ } ``` -------------------------------- ### Configure dent Module for Hardware Switch Sampling Source: https://sflow.net/host-sflow-linux-config.php Configures the dent module for a hardware switch with ASIC sampling, identifying switch ports using a regular expression. ```none dent { sw=off switchport=^swp[0-9]+$ } ``` -------------------------------- ### Configure DNS-SD for sFlow Source: https://sflow.net/host-sflow-linux-config.php Uses DNS queries to discover sFlow collectors, sampling rates, and polling settings. Changes in DNS are automatically detected. ```config dns-sd { domain=.mycompany.com } ``` -------------------------------- ### Minimal Host sFlow Configuration Source: https://sflow.net/host-sflow-linux-config.php A basic configuration for Host sFlow, specifying the collector IP address. ```shell sflow { collector { ip = 10.100.12.13 } } ``` -------------------------------- ### Configure Systemd Cgroups Monitoring Source: https://sflow.net/host-sflow-linux-config.php Connects to systemd via DBUS to report on all running services (cgroups). With 'markTraffic=on', packet samples are mapped to their respective services. ```none systemd { markTraffic=on } ``` -------------------------------- ### HPC Host sFlow with Custom Metrics Source: https://sflow.net/host-sflow-linux-config.php Configure sFlow for HPC hosts to include custom metrics, web-server monitoring (Apache mod_sflow), and GPU monitoring (Nvidia NVML). ```shell sflow { sampling.http = 50 # for apache mod_sflow collector { ip = 10.100.12.13 } json { UDPPort = 36343 } # for RTMETRIC nvml {} # Nvidia GPU } ``` -------------------------------- ### Host sFlow with Packet Sampling Source: https://sflow.net/host-sflow-linux-config.php Enable packet sampling on all network interfaces for Host sFlow, along with TCP monitoring. ```shell sflow { collector { ip = 10.100.12.13 } pcap { speed = 1- } tcp {} } ``` -------------------------------- ### Configure JSON Input for Custom Metrics Source: https://sflow.net/host-sflow-linux-config.php Listens for JSON-encoded input on a specified UDP port for custom metrics and transaction samples in sFlow-APPLICATION format. ```config json { udpport=36343 } ``` -------------------------------- ### Build hsflowd for OpenSwitch Source: https://sflow.net/downloads.php Builds the hsflowd package specifically for the OpenSwitch environment using a Docker build command. ```bash ./docker_build_on opx ``` -------------------------------- ### Configure NFLOG Sampling in iptables Source: https://sflow.net/host-sflow-linux-config.php Sets up iptables rules to send packet samples to an NFLOG group with random probability. ```bash MOD_STATISTIC="-m statistic --mode random --probability 0.0025" NFLOG_CONFIG="--nflog-group 5 --nflog-prefix SFLOW" sudo iptables -I INPUT -j NFLOG $MOD_STATISTIC $NFLOG_CONFIG sudo iptables -I OUTPUT -j NFLOG $MOD_STATISTIC $NFLOG_CONFIG ``` -------------------------------- ### KVM Hypervisor sFlow with Linux Bridge Source: https://sflow.net/host-sflow-linux-config.php Configure sFlow for KVM hypervisors when using a Linux bridge, specifying the bridge device. ```shell sflow { collector { ip = 10.100.12.13 } pcap { dev = virbr0 } kvm {} } ``` -------------------------------- ### Configure TCP Performance Monitoring Source: https://sflow.net/host-sflow-linux-config.php Enables TCP performance monitoring, which requires packet-sampling modules like pcap or nflog. It annotates TCP connections with performance metrics extracted from the Linux kernel. ```none tcp { } ``` -------------------------------- ### Docker Host sFlow with Multiple Collectors Source: https://sflow.net/host-sflow-linux-config.php Configure sFlow for a Docker host with multiple collectors, specifying agent CIDR, polling, sampling, and Docker-specific interfaces. ```shell sflow { agent.CIDR = 10.0.0.0/8 polling = 10 sampling = 1000 collector { ip = 10.100.12.13 } collector { ip = 10.122.1.2 } collector { ip = 10.144.1.2 UDPPort=6344 } pcap { dev = docker0 } pcap { dev = docker_gwbridge } docker {} } ``` -------------------------------- ### Run hsflowd Manually with Debugging Source: https://sflow.net/host-sflow-linux-config.php Command to run hsflowd manually with increased debugging output. Stop the service first. ```bash sudo hsflowd -ddd ``` -------------------------------- ### Configure sFlow Collector Source: https://sflow.net/host-sflow-linux-config.php Defines the IP address and UDP port for an sFlow collector. Multiple collectors can be specified. ```config collector { ip=10.1.2.3 udport=6343 } ``` -------------------------------- ### Configure Packet Drop Monitoring Source: https://sflow.net/host-sflow-linux-config.php Enables packet drop monitoring using the DROPMON Netlink channel, requiring Linux kernel 5.0 or later. This exports dropped packets reported by the switch ASIC or kernel via sFlow v5 extension. ```none dropmon { limit=50 } ``` -------------------------------- ### Agent IP Selection: Specific Interface Source: https://sflow.net/host-sflow-linux-config.php Configure the agent to select the IP address associated with a specific network interface. ```shell agent = eth0 ``` -------------------------------- ### Set Sampling Rate by Interface Speed Source: https://sflow.net/host-sflow-linux-config.php Configures the sampling rate (1-in-N) for interfaces with a specific link speed. Overrides the default calculation. ```config sampling.10G=10000 ``` -------------------------------- ### Configure ULOG Packet Sampling Source: https://sflow.net/host-sflow-linux-config.php Listen for packet samples on iptables ULOG channel 2 with a probability of 0.01. This requires configuring iptables with the ULOG module. ```bash ulog { group=2 probability=0.01 } ``` ```bash MOD_STATISTIC="-m statistic --mode random --probability 0.01" ULOG_CONFIG="--ulog-nlgroup 2 --ulog-prefix SFLOW --ulog-qthreshold 1" sudo iptables -I INPUT -j ULOG $MOD_STATISTIC $ULOG_CONFIG sudo iptables -I OUTPUT -j ULOG $MOD_STATISTIC $ULOG_CONFIG ``` -------------------------------- ### Send SIGUSR1 to hsflowd for Stack Backtrace Source: https://sflow.net/host-sflow-linux-config.php Command to send a SIGUSR1 signal to all running hsflowd processes, which forces them to log a stack backtrace. ```bash killall -USR1 hsflowd ``` -------------------------------- ### Configure NFLOG Packet Sampling Source: https://sflow.net/host-sflow-linux-config.php Listens for packet samples on an NFLOG channel with a specified probability, assuming a certain sampling rate. ```config nflog { group=5 probability=0.0025 } ``` -------------------------------- ### Agent IP Selection: Prefer CIDR Range Source: https://sflow.net/host-sflow-linux-config.php Configure the agent to prefer an IP address that falls within the specified CIDR range. ```shell agent.cidr = 10.0.0.0/8 ``` -------------------------------- ### Configure PCAP Packet Sampling on a Device Source: https://sflow.net/host-sflow-linux-config.php Applies packet sampling to a specified network device using PCAP. Supports BPF sampling on newer kernels and can enable promiscuous mode. ```config pcap { dev=docker0 } ``` -------------------------------- ### Build hsflowd for Arista EOS Source: https://sflow.net/downloads.php Builds the hsflowd package for Arista EOS using the make command with specific features enabled. ```bash make rpm FEATURES="EOS" ``` -------------------------------- ### Configure PCAP Packet Sampling per Port Source: https://sflow.net/host-sflow-linux-config.php Sets sampling rates on a per-port basis when using the pcap module. Useful for overriding default sampling behavior. ```config sampling.bps_ratio=0 pcap { dev=eth0 sampling=1000 } pcap { dev=eth1 sampling=2000 } ``` -------------------------------- ### Set Manual Polling Interval Source: https://sflow.net/host-sflow-linux-config.php Schedules counter-polling with a specified interval in seconds. ```config polling=30 ``` -------------------------------- ### Agent IP Selection: Exclude CIDR Range Source: https://sflow.net/host-sflow-linux-config.php Configure the agent to prefer an IP address that does NOT fall within the specified CIDR range. ```shell agent.cidr = !192.168.0.0/16 ``` -------------------------------- ### Set HTTP Sampling Rate Source: https://sflow.net/host-sflow-linux-config.php Configures the sampling rate for httpd traffic. This setting is propagated to web server modules. ```config sampling.http=10 ``` -------------------------------- ### Set Application Transaction Sampling Rate Source: https://sflow.net/host-sflow-linux-config.php Sets the sampling rate for JSON-encoded sFlow-APPLICATION transactions. ```config sampling.app.myapplication=20 ``` -------------------------------- ### Set Default Sampling Rate Source: https://sflow.net/host-sflow-linux-config.php Specifies the default sampling rate (1-in-N) for interfaces or applications without specific sampling settings. ```config sampling=400 ``` -------------------------------- ### Disable Speed/BPS Ratio Calculation Source: https://sflow.net/host-sflow-linux-config.php Disables the automatic calculation of sampling rate based on link speed and sets a fallback default sampling rate. ```config sampling.bps_ratio=0 sampling=1000 ``` -------------------------------- ### Stop hsflowd Service Source: https://sflow.net/host-sflow-linux-config.php Command to stop the hsflowd service on a Linux system. ```bash sudo service hsflowd stop ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.