- 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
Title | Size | Download |
---|---|---|
12-sFlow Commands | 116.7 KB |
Contents
|
NOTE: The switch supports two operation modes: standalone (default) and IRF. For more information about IRF mode, see IRF Configuration Guide. |
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 of 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 the display sflow command 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 Description
1 22:2:20::10 6343 N/A 3000 netserver
2 192.168.3.5 6343 500 3000 Office
3 6343 0 1400
4 6343 0 1400
5 6343 0 1400
6 6343 0 1400
7 6343 0 1400
8 6343 0 1400
9 6343 0 1400
10 6343 0 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 Output description
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 |
The rest time for the sFlow collector to survive. If N/A is displayed, the sFlow collector is not aged out. |
Size |
The maximum length of the sFlow data portion in every sFlow packet that is sent out. |
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 |
The maximum 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—Indicates the port is down. · Active—Indicates 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: IPv4 address of the sFlow agent.
ipv6 ipv6-address: IPv6 address of the sFlow agent.
Description
Use the sflow agent command to configure the IP address of the sFlow agent.
Use the undo sflow agent command to remove the configured IP address.
By default, no IP address is configured for the sFlow agent. The device periodically checks the existence of sFlow agent address. If the sFlow agent has no IP address configured, the device automatically selects an interface IP address for the sFlow agent but does not save the selected IP address.
Note the following:
· H3C recommends configuring an IP address manually 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 { { 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: ID of the sFlow collector, ranging from 1 to 10.
ip ip-address: IPv4 address of the sFlow collector.
ipv6 ipv6-address: 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 is in the range of 200 to 3000 bytes and defaults to 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, in 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 the sflow collector command to configure an sFlow collector.
Use the undo sflow collector command 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: Counter sampling interval in seconds, in the range of 2 to 86400.
Description
Use the sflow counter interval command to set the counter sampling interval.
Use the undo sflow counter interval command to disable sFlow counter sampling.
By default, counter sampling is disabled.
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: ID of the sFlow collector.
Description
Use the sflow counter collector command to specify the target collector to receive the counter sampling data.
Use the undo sflow counter collector command to remove the collector for counter sampling.
By default, no collector is specified for counter sampling.
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: ID of the sFlow collector.
Description
Use the sflow flow collector command to specify the target collector to receive the flow sampling data.
Use the undo sflow flow collector command to remove the binding between the flow sampling and the collector.
By default, flow sampling is not bound with any collector.
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: Maximum bytes of data that can be copied from a sampled packet, in the range of 18 to 512.
Description
Use the sflow flow max-header command to set the maximum bytes of data that can be copied from a sampled packet.
Use the undo sflow flow max-header command 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.
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: Sampling mode of fixed packet number. For example, with the packet sampling rate 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: Random sampling mode. After the sampling rate is specified with the sflow sampling-rate command, a device samples zero, one, or multiple packets from each group of sampled packets. Generally, one packet is sampled from each group of sampled packets. For example, with the packet sampling rate set to 4000, the device may sample one packet from the first 4000 packets, two from the next 4000 packets, and none from the third 4000 packets, but generally the device samples one packet from 4000 packets. This keyword is not supported.
Description
Use the sflow sampling-mode command to specify the fixed sampling mode.
Use the undo sflow sampling-mode command to restore the default.
By default, the fixed sampling mode is used.
This command is supported on physical Ethernet interfaces only, instead of logical interfaces (VLAN interfaces) and network management interfaces.
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: Number of packets out of which the interface will sample a packet, in the range of 512 to 1048576.
Description
Use the sflow sampling-rate command to specify the number of packets out of which the interface will sample a packet.
Use the undo sflow sampling-rate command 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 network management interfaces.
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: Source IPv4 address of sent sFlow packets.
ipv6 ipv6-address: Source IPv6 address of sent sFlow packets.
Description
Use the sflow source command to specify the source IP address of sent sFlow packets.
Use the undo sflow source command 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