- Table of Contents
-
- 12-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System maintenance and debugging commands
- 02-NQA commands
- 03-NTP commands
- 04-PoE commands
- 05-SNMP commands
- 06-RMON commands
- 07-NETCONF commands
- 08-EAA commands
- 09-Process monitoring and maintenance commands
- 10-Mirroring commands
- 11-NetStream commands
- 12-IPv6 NetStream commands
- 13-sFlow commands
- 14-Information center commands
- 15-GOLD commands
- 16-Packet capture commands
- Related Documents
-
Title | Size | Download |
---|---|---|
13-sFlow commands | 56.67 KB |
sFlow commands
display sflow
Use display sflow to display sFlow configuration and operation information.
Syntax
display sflow
Views
Any view
Predefined user roles
network-admin
network-operator
mdc-admin
mdc-operator
Examples
# Display sFlow configuration and operation information.
<Sysname> display sflow
sFlow datagram version: 5
Global information:
Agent IP: 10.10.10.1(CLI)
Source address: 10.0.0.1 2001::1
Collector information:
ID IP Port Aging Size VPN-instance Description
1 22:2:20::10 6535 N/A 1400 vpn1 netserver
2 192.168.3.5 6543 500 1400 Office
Port information:
Interface CID Interval(s) FID MaxHLen Rate Mode Status
GE1/0/1 1 100 1 128 1000 Random Active
GE1/0/2 2 100 2 128 1000 Random Active
Table 1 Command output
Field |
Description |
sFlow datagram version |
sFlow version, which can only take the value of 5. |
Global information |
Global sFlow information. |
Agent IP |
IP address of the sFlow agent: · CLI—Manually configured IP address. · Auto—Automatically configured IP address. |
Source address |
Source IP address of sFlow packets. |
Collector information |
sFlow collector information. |
ID |
sFlow collector ID. |
IP |
sFlow collector IP address. |
Port |
sFlow collector port. |
Aging |
Remaining lifetime of the sFlow collector. If this field displays N/A, the sFlow collector never ages out. |
Size |
Maximum length of the sFlow data portion in an sFlow packet. |
VPN-instance |
Name of the VPN bound with the sFlow collector. |
Description |
Description of the sFlow collector. |
Port information |
Information about interfaces configured with sFlow. |
Interface |
Interface configured with sFlow. |
CID |
ID of the sFlow collector, for receiving counter sampled packets. If no sFlow collector ID is specified, this field displays 0. |
Interval(s) |
Counter sampling interval, in seconds. |
FID |
ID of the sFlow collector for receiving flow sampled packets. If no sFlow collector ID is specified, this field displays 0. |
MaxHLen |
Maximum number of bytes that can be copied in a sampled packet (starting from the packet header). |
Rate |
Number of packets out of which the interface samples a packet by using flow sampling. |
Mode |
Flow sampling mode: · Determine—Samples a fixed number of packets. · Random—Samples a random number of packets. |
Status |
sFlow status of the port: · Suspended—The sFlow feature is suspended because the port is down. · Active—The sFlow feature is active because the port is up. |
sflow agent
Use sflow agent to configure an IP address for the sFlow agent.
Use undo sflow agent to restore the default.
Syntax
sflow agent { ip ip-address | ipv6 ipv6-address }
undo sflow agent { ip | ipv6 }
Default
No IP address is configured for the sFlow agent. The switch periodically identifies whether the sFlow agent has an IP address. If it does not, the switch automatically selects an IPv4 address for the sFlow agent. It does not save the IPv4 address in the configuration file.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
ip ip-address: Specifies an IPv4 address for the sFlow agent.
ipv6 ipv6-address: Specifies an IPv6 address for the sFlow agent.
Usage guidelines
As a best practice, manually configure an IP address for the sFlow agent.
Only one IP address can be specified for the sFlow agent on the switch. A newly configured IP address overwrites the existing one.
Examples
# Specify IP address 10.10.10.1 for the sFlow agent.
<Sysname> system-view
[Sysname] sflow agent ip 10.10.10.1
sflow collector
Use sflow collector to configure parameters for an sFlow collector.
Use undo sflow collector to remove an sFlow collector.
Syntax
sflow collector collector-id [ vpn-instance vpn-instance-name ] { ip ip-address | ipv6 ipv6-address } [ port port-number ] [ datagram-size size ] [ time-out seconds ] [ description text ]
undo sflow collector collector-id
Default
No sFlow collector information is configured.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
collector-id: Specifies an sFlow collector by its ID in the range of 1 to 10.
vpn-instance vpn-instance-name: Specifies a VPN instance by its name for the sFlow collector. A VPN instance name is a case-sensitive string of 1 to 31 characters and cannot contain spaces. By default, the sFlow collector belongs to the public network.
ip ip-address: Specifies an IPv4 address for the sFlow collector.
ipv6 ipv6-address: Specifies an IPv6 address for the sFlow collector.
description text: Configures a description for the sFlow collector. The default description is "CLI Collector."
datagram-size size: Specifies the maximum length of the sFlow data portion in an sFlow packet. The value range for the size argument is 200 to 3000 bytes and the default is 1400 bytes.
port port-number: Specifies the UDP port number of the sFlow collector, in the range of 1 to 65535. The default is 6343.
time-out seconds: Specifies the aging timer of the sFlow collector, in the range of 1 to 2147483647 seconds. When the aging timer expires, the sFlow collector settings are deleted. The sFlow collector settings do not age out by default.
Examples
# Configure the following parameters for sFlow collector 2:
· VPN name—vpn1.
· IP address—3.3.3.1.
· Port number—Default.
· Description—netserver.
· Aging timer—1200 seconds.
· Maximum length of the sFlow data portion in the sFlow packet—1000 bytes.
<Sysname> system-view
[Sysname] sflow collector 2 vpn-instance vpn1 ip 3.3.3.1 description netserver time-out 1200 datagram-size 1000
sflow counter interval
Use sflow counter interval to enable counter sampling and set a counter sampling interval.
Use undo sflow counter interval to restore the default.
Syntax
sflow counter interval interval-time
undo sflow counter interval
Default
Counter sampling is disabled.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
interval-time: Specifies the counter sampling interval in the range of 2 to 86400 seconds.
Examples
# Enable counter sampling and set the counter sampling interval to 120 seconds on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow counter interval 120
sflow counter collector
Use sflow counter collector to specify an sFlow collector for counter sampling.
Use undo sflow counter collector to restore the default.
Syntax
sflow counter collector collector-id
undo sflow counter collector
Default
No sFlow collector is specified for counter sampling.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
collector-id: Specifies an sFlow collector by its ID in the range of 1 to 10.
Examples
# Specify sFlow collector 2 on GigabitEthernet 1/0/1 for counter sampling.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow counter collector 2
sflow flow collector
Use sflow flow collector to specify an sFlow collector for flow sampling.
Use undo sflow flow collector to restore the default.
Syntax
sflow flow collector collector-id
undo sflow flow collector
Default
No sFlow collector is specified for flow sampling.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
collector-id: Specifies an sFlow collector by its ID in the range of 1 to 10.
Examples
# Specify sFlow collector 2 on GigabitEthernet 1/0/1 for flow sampling.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow flow collector 2
sflow flow max-header
Use sflow flow max-header to set the maximum number of bytes (starting from the packet header) that flow sampling can copy per packet.
Use undo sflow flow max-header to restore the default.
Syntax
sflow flow max-header length
undo sflow flow max-header
Default
Flow sampling can copy up to 128 bytes of a packet.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
length: Specifies the maximum number of bytes that can be copied, in the range of 18 to 512. As a best practice, use the default.
Examples
# Set the maximum number of bytes that can be copied to 60 on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow flow max-header 60
sflow sampling-mode
Use sflow sampling-mode to specify a flow sampling mode.
Use undo sflow sampling-mode to restore the default.
Syntax
sflow sampling-mode { determine | random }
undo sflow sampling-mode
Default
Random sampling is used.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
determine: Specifies the fixed sampling mode. This keyword is not supported in the current software version. This keyword is reserved for future support. For example, if the flow sampling interval is set to 4000 (by using the sflow sampling-rate command), the switch samples packets as follows:
· The device randomly samples a packet, like the tenth packet, from the first 4000 packets.
· The next time the switch samples the 4010th packet, and so on.
random: Specifies the random sampling mode. For example, if the packet sampling interval is set to 4000, the switch samples packets randomly as follows:
· The switch might sample one packet from the first 4000 packets.
· The switch might sample multiple packets from the next 4000 packets.
· The switch might sample no packets from the third 4000 packets.
However, the switch samples one packet from 4000 packets on average.
Examples
# Specify the random flow sampling mode on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow sampling-mode random
Related commands
sflow sampling-rate
sflow sampling-rate
Use sflow sampling-rate to enable flow sampling and specify the number of packets out of which flow sampling will sample a packet on an interface.
Use undo sflow sampling-rate to restore the default.
Syntax
sflow sampling-rate rate
undo sflow sampling-rate
Default
Flow sampling is disabled.
Views
Layer 2 Ethernet interface view, Layer 3 Ethernet interface view
Predefined user roles
network-admin
mdc-admin
Parameters
rate: Specifies the number of packets out of which flow sampling will sample a packet on the interface. The value range for this argument is 1000 to 500000.
Examples
# Enable flow sampling to sample a packet out of 4000 packets on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] sflow sampling-rate 4000
Related commands
sflow sampling-mode
sflow source
Use sflow source to specify the source IP address of sent sFlow packets.
Use undo sflow source to restore the default.
Syntax
sflow source { ip ip-address | ipv6 ipv6-address } *
undo sflow source { ip | ipv6 } *
Default
The source IP address of sent sFlow packets is determined by routing.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
ip ip-address: Specifies the source IPv4 address of sent sFlow packets.
ipv6 ipv6-address: Specifies the source IPv6 address of sent sFlow packets.
Examples
# Specify the source IPv4 address of sent sFlow packets as 10.0.0.1.
<Sysname> system-view
[Sysname] sflow source ip 10.0.0.1