The sflow counter-sampling collector command specifies the target sFlow collector that receives counter sampling data.
The undo sflow counter-sampling collector command deletes the target sFlow collector.
By default, no target sFlow collector is specified.
sflow counter-sampling collector { collector-id | all }
undo sflow counter-sampling collector { collector-id | all }
Parameter |
Description |
Value |
---|---|---|
collector-id |
Specifies the ID of the target sFlow collector that receives counter sampling data. |
The value is an integer that can be 1 or 2. NOTE:
The value of collector-id is set using the sflow collector command. |
all |
Indicates all the configured sFlow collectors. |
- |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE interface view, port group view
Usage scenario
Counter sampling is based on time. An sFlow agent periodically obtains traffic statistics on an interface, encapsulates the traffic statistics into sFlow packets, and sends them to an sFlow collector. When multiple sFlow collectors are configured, you can run the sflow counter-sampling collector command to specify the target sFlow collector to receive the counter sampling data. Each interface can send sFlow sampling data to a maximum of two sFlow collectors.
When you run the sflow counter-sampling collector command to specify the first target sFlow collector on an interface, counter sampling is enabled on the interface. When you run the undo sflow counter-sampling collector command to delete the last target sFlow collector on an interface, counter sampling is disabled on the interface.
Prerequisites
An sFlow collector has been created using the sflow collector command.
Precautions
The sflow flow-sampling rate command only applies to Layer 2 physical interfaces, but does not apply to Eth-Trunk or Layer 3 interfaces. However, this command takes effect on the Layer 3 interface which is switched from a Layer 2 interface using the undo portswitch command, and can take effect on Eth-Trunk member interfaces.
# Specify sFlow collector 1 to receive counter sampling data.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] sflow counter-sampling collector 1
# Configure a port group pg1 that has member ports GE0/0/2 and GE0/0/3, and specify sFlow collector 1 to receive counter sampling data for the port group pg1.
[HUAWEI] port-group pg1 [HUAWEI-port-group-pg1] group-member gigabitethernet 0/0/2 [HUAWEI-port-group-pg1] group-member gigabitethernet 0/0/3 [HUAWEI-port-group-pg1] sflow counter-sampling collector 1