- Table of Contents
-
- 13-Network Management and Monitoring Command Reference
- 00-Preface
- 01-System Maintenance and Debugging Commands
- 02-NQA Commands
- 03-NTP Commands
- 04-Clock Monitoring Commands
- 05-IPC Commands
- 06-SNMP Commands
- 07-RMON Commands
- 08-CWMP Commands
- 09-Sampler Commands
- 10-Mirroring Commands
- 11-Protocol Packet Statistics Commands
- 12-sFlow Commands
- 13-Information Center Commands
- 14-Packet Capture Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
12-sFlow Commands | 90.75 KB |
Contents
display sflow
Syntax
Standalone mode:
display sflow [ slot slot-number ] [ | { begin | exclude | include } regular-expression ]
IRF mode:
display sflow [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
slot slot-number: Displays the sFlow configuration and operation information for the interface card specified by the slot number. (Standalone mode.)
chassis chassis-number slot slot-number: Displays the sFlow configuration and operation information for a card on an IRF member switch. The chassis-number argument refers to the ID of the IRF member switch. The slot-number argument refers to the number of the slot where the card resides. (IRF mode.)
|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Description
Use display sflow to display the sFlow configuration and operation information.
Examples
# Display the sFlow configuration and operation information.
<Sysname> display sflow slot 2
sFlow Version: 5
sFlow Global Information:
Agent IP:10.10.10.1 (Auto)
Collector Information
ID IP Port Aging Size VPN-instance Description
1 22:2:20::10 6343 N/A 1400 aaa CLI Collector
2 192.168.3.5 6343 N/A 1400 netserver
3 6343 N/A 1400
4 6343 N/A 1400
5 6343 N/A 1400
6 6343 N/A 1400
7 6343 N/A 1400
8 6343 N/A 1400
9 6343 N/A 1400
10 6343 N/A 1400
sFlow Port Information:
Interface CID Interval(s) FID MaxHLen Rate Mode Status
GE3/0/1 1 100 1 128 1000 Determine Active
GE3/0/2 2 100 2 128 1000 Determine Active
Table 1 Command output
Field |
Description |
sFlow Version |
sFlow has the following versions: · 4—sFlow version 4. · 5—sFlow version 5. |
sFlow Global Information |
sFlow global configuration information. |
Agent |
IP address of the sFlow agent: · CLI—Manually configured IP address. · Auto—Automatically obtained IP address. |
Source Address |
Source IP address of sent sFlow packets. |
Collector Information |
sFlow collector information. |
ID |
sFlow collector ID. |
IP |
IP address of the sFlow collector that receives sFlow packets. |
Port |
Number of the port receiving sFlow packets on the sFlow collector. |
Aging |
Remaining lifetime of the sFlow collector. If N/A is displayed, the sFlow collector is not aged out. |
Size |
Maximum length of the sFlow data portion in every sFlow packet that is sent out. |
VPN-instance |
Name of the VPN bound with the sFlow collector. |
Description |
Description of the sFlow collector. |
sFlow Port Information |
Information of the ports enabled with sFlow. |
Interface |
sFlow enabled interface. |
CID |
ID of the target collector for receiving the counter sampling data. |
Interval(s) |
Counter sampling interval, in seconds. |
FID |
ID of the target collector for receiving the flow sampling data. |
MaxHLen |
Maximum number of bytes of data copied from the original packet during header analysis. |
Rate |
Packet sampling rate. |
Mode |
Packet sampling mode: · Determine—Samples a fixed number of packets. · Random—Samples a random number of packets. |
Status |
Status of the sFlow enabled port: · Suspend—The port is down. · Active—The port is up. |
sflow agent
Syntax
sflow agent { ip ip-address | ipv6 ipv6-address }
undo sflow agent { ip | ipv6 }
View
System view
Default level
2: System level
Parameters
ip ip-address: Specifies the IPv4 address of the sFlow agent.
ipv6 ipv6-address: Specifies the IPv6 address of the sFlow agent.
Description
Use sflow agent to configure the IP address of the sFlow agent.
Use undo sflow agent to remove the configured IP address.
By default, no IP address is configured for the sFlow agent. The device periodically checks whether the sFlow agent has an IP address. If not, the device automatically selects an IPv4 address for the sFlow agent but does not save the IPv4 address in the configuration file.
Note the following:
· H3C recommends manually configuring an IP address for the sFlow agent.
· Only one IP address can be specified for the sFlow agent on the switch.
Examples
# Configure the IP address of the sFlow agent.
<Sysname> system-view
[Sysname] sflow agent ip 10.10.10.1
sflow collector
Syntax
sflow collector collector-id { [ vpn-instance vpn-instance-name ] { ip ip-address | ipv6 ipv6-address } | datagram-size size | description text | port port-number | timeout seconds } *
undo sflow collector collector-id
View
System view
Default level
2: System level
Parameters
collector-id: Specifies the ID of the sFlow collector, in the range of 1 to 10.
vpn-instance vpn-instance-name: Specifies the VPN instance of the sFlow collector by name, a case-sensitive string of 1 to 31 characters that cannot contain spaces. By default, the sFlow collector belongs to the public network.
ip ip-address: Specifies the IPv4 address of the sFlow collector.
ipv6 ipv6-address: Specifies the IPv6 address of the sFlow collector.
description text: Specifies 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 every sFlow packet that is sent out. The value range for the size argument is 200 to 3000 bytes, and the default is 1400 bytes.
port port-number: Specifies the port number of the sFlow collector, in the range of 1 to 65535. The default port number is 6343.
timeout seconds: Specifies the aging time of the sFlow collector, in the range of 60 to 2147483647 seconds. By default, the sFlow collector is not aged out. When the aging time expires, all fields of the collector restore the default. The system does not save the configuration of collectors with the aging time specified.
Description
Use sflow collector to configure an sFlow collector.
Use undo sflow collector to remove a specified sFlow collector.
By default, the switch presets some empty collectors.
To display the information of the preset sFlow collectors, use the display sflow command.
Examples
# Specify collector 2's destination IP address as 3.3.3.1, port number as default, description as netserver, aging time as 1200 seconds, and maximum length of the sFlow data portion as 1000 bytes.
<Sysname> system-view
[Sysname] sflow collector 2 ip 3.3.3.1 description netserver timeout 1200 datagram-size 1000
sflow counter interval
Syntax
sflow counter interval interval-time
undo sflow counter interval
View
Interface view
Default level
2: System level
Parameters
interval-time: Specifies the counter sampling interval in the range of 2 to 86400 seconds.
Description
Use sflow counter interval to set the counter sampling interval.
Use undo sflow counter interval to disable sFlow counter sampling.
By default, counter sampling is disabled.
This command is supported on Ethernet interfaces only, instead of logical interfaces (such as VLAN interfaces and Layer 3 aggregate interfaces) and network management ports.
Examples
# Set the counter sampling interval to 120 seconds on GigabitEthernet 3/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow counter interval 120
sflow counter collector
Syntax
sflow counter collector collector-id
undo sflow counter collector
View
Interface view
Default level
2: System level
Parameters
collector-id: Specifies the ID of the sFlow collector.
Description
Use sflow counter collector to specify the target collector to receive the counter sampling data.
Use undo sflow counter collector to remove the collector for counter sampling.
By default, no collector is specified for counter sampling.
This command is supported on Ethernet interfaces only, instead of logical interfaces (such as VLAN interfaces and Layer 3 aggregate interfaces) and network management ports.
Examples
# Specify sFlow collector 2 on GigabitEthernet 3/0/1 for counter sampling.
<Sysname> system-view
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow counter collector 2
sflow flow collector
Syntax
sflow flow collector collector-id
undo sflow flow collector
View
Interface view
Default level
2: System level
Parameters
collector-id: Specifies the ID of the sFlow collector.
Description
Use sflow flow collector to specify the target collector to receive the flow sampling data.
Use undo sflow flow collector to remove the binding between the flow sampling and the collector.
By default, flow sampling is not bound with any collector.
This command is available only on Ethernet interfaces. You cannot use it on VLAN interfaces, Layer 3 aggregate interfaces, and the management Ethernet interface.
Examples
# Specify sFlow collector 2 on GigabitEthernet 3/0/1 for flow sampling.
<Sysname> system-view
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow flow collector 2
sflow flow max-header
Syntax
sflow flow max-header length
undo sflow flow max-header
View
Interface view
Default level
2: System level
Parameters
Length: Specifies the maximum bytes of data that can be copied from a sampled packet. The value range is 18 to 512.
Description
Use sflow flow max-header to set the maximum bytes of data that can be copied from a sampled packet.
Use undo sflow flow max-header to restore the default.
By default, up to 128 bytes of data starting from the original packet header can be copied from a sampled packet. H3C recommends using the default setting.
This command is supported on Ethernet interfaces only, instead of logical interfaces (such as VLAN interfaces and Layer 3 aggregate interfaces) and network management ports.
Examples
# Set the maximum bytes of data that can be copied form a sampled packet to 60.
<Sysname> system-view
[Sysname] interface GigabitEthernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow flow max-header 60
sflow sampling-mode
Syntax
sflow sampling-mode { determine | random }
undo sflow sampling-mode
View
Interface view
Default level
2: System level
Parameters
determine: Specifies the fixed sampling mode. For example, if the flow sampling interval is set to 4000 (by using the sflow sampling-rate command), the switch 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 device might sample one packet from the first 4000 packets, multiple packets from the next 4000 packets, and none from the third 4000 packets, randomly. But generally the device samples one packet from 4000 packets on the average. The random sampling mode is not supported in the current software. This keyword is reserved for future support.
Description
Use sflow sampling-mode to specify the fixed sampling mode.
Use undo sflow sampling-mode to restore the default.
By default, the fixed sampling mode is used.
This command is supported on Ethernet interfaces only, instead of logical interfaces (such as VLAN interfaces and Layer 3 aggregate interfaces) and network management ports.
Related commands: sflow sampling-rate.
Examples
# Configure the interface to sample a fixed number of packets.
<Sysname> system-view
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow sampling-mode determine
sflow sampling-rate
Syntax
sflow sampling-rate rate
undo sflow sampling-rate
View
Interface view
Default level
2: System level
Parameters
rate: Specifies the number of packets out of which the interface will sample a packet. The value range is 512 to 1048576.
Description
Use sflow sampling-rate to specify the number of packets out of which the interface will sample a packet.
Use undo sflow sampling-rate to disable sampling.
By default, flow sampling is disabled.
This command is supported on Ethernet interfaces only, instead of logical interfaces (such as VLAN interfaces and Layer 3 aggregate interfaces) and network management ports.
Related commands: sflow sampling-mode.
Examples
# Set the flow sampling rate to 4000 on GigabitEthernet 3/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 3/0/1
[Sysname-GigabitEthernet3/0/1] sflow sampling-rate 4000
sflow source
Syntax
sflow source { ip ip-address | ipv6 ipv6-address } *
undo sflow source { ip | ipv6 } *
View
System view
Default level
2: System level
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.
Description
Use sflow source to specify the source IP address of sent sFlow packets.
Use undo sflow source to remove the specified source IP address.
By default, no source IP address is specified for 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