Part 12 - System Monitoring

04-sFlow Commands

Chapters Download  (41.33 KB)

04-sFlow Commands


sFlow Configuration Commands

sFlow Configuration Commands

display sflow

Syntax

display sflow [ slot slot-number ]

View

Any view

Default Level

2: System level

Parameters

slot slot-number: Displays the sFlow configuration information of the specified IRF member device. The slot-number argument is the member number of the device in the IRF, which you can display with the display irf command. The value range for the slot-number argument depends on the number of members and numbering conditions in the current IRF. If no IRF exists, the slot-number argument is the current device number.

Description

Use the display sflow command to display the sFlow configuration information.

Examples

# Display the sFlow configuration information of Slot 1 .

<Sysname> display sflow slot 1

sFlow Version: 5

sFlow Global Information:

Agent        IP:10.10.10.1

Collector   IP:10.10.10.2  Port:6343

Interval(s): 20

sFlow Port Information:

Interface    Direction        Rate          Mode            Status

GE1/0/1        Out               5000         Random          Active

Table 1-1 display sflow command output description

Field

Description

sFlow Version

Currently, sFlow has the following versions:

l  4: sFlow version 4.

l  5: sFlow version 5.

sFlow Global Information

sFlow global configuration information

Agent

IP address of the sFlow agent

Collector

IP address and port number of each sFlow collector

Interval(s)

Counter sampling interval (sFlow interval)

sFlow Port Information

Information of the ports enabled with sFlow

Interface

sFlow enabled interface

Direction

Packet sampling direction:

l  In: Samples inbound packets.

l  Out: Samples outbound packets.

l  In/Out: Samples inbound and outbound packets.

Rate

Packet sampling rate

Mode

Packet sampling mode:

l  Determine: Samples a fixed number of packets.

l  Random: Samples a random number of packets.

Status

Status of the sFlow enabled port:

l  Suspend: Indicates the port is suspended, and it stops sampling.

l  Active: Indicates the port is active and performs sampling.

 

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-address: IPv4 address of the sFlow agent.

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.

Note that:

l   The sFlow agent and sFlow collector must not have the same IP address, but must be configured with the same version of IP addresses.

l   Currently, a device supports only one sFlow agent.

l   sFlow does not work if the sFlow agent has no IP address configured, or the IP address of the sFlow agent is removed.

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 { ip ip-address | ipv6 ipv6-address } [ port por-number ]

undo sflow collector { ip ip-address | ipv6 ipv6-address }

View

System view

Default Level

2: System level

Parameters

ip-address: IPv4 address of the sFlow collector.

ipv6-address: IPv6 address of the sFlow collector.

port port-number: Specifies the port number of the sFlow collector. The port-number argument is in the range of 1 to 65535. By default, the port number is 6343.

Description

Use the sflow collector command to specify the IP address and port number of an sFlow collector.

Use the undo sflow collector command to remove the IP address of an sFlow collector.

By default, no sFlow collector is specified.

Note that:

l   The sFlow collector and sFlow agent must not have the same IP address, and must be configured with the same version of IP addresses.

l   Currently, you can specify at most two sFlow collectors, with one as the backup sFlow collector.

l   sFlow does not work if no sFlow collector is specified.

l   If only one sFlow collector is specified, sFlow will stop working after you use the undo sflow collector ip command.

Examples

# Specify the IP address and port number of an sFlow collector.

<Sysname> system-view

[Sysname] sflow collector ip 10.10.10.2 port 6343

sflow enable

Syntax

sflow enable { inbound | outbound }

undo sflow enable { inbound | outbound }

View

Interface view

Default Level

2: System level

Parameters

inbound: Samples inbound packets.

outbound: Samples outbound packets.

Description

Use the sflow enable command to enable sFlow and sample inbound or outbound packets on the port.

Use the undo sflow enable command to disable sFlow on the port.

sFlow is disabled by default.

Note that:

This command is supported on physical Ethernet ports only, instead of logical interfaces (VLAN interfaces) and network management interfaces. If you want to enable sFlow on an aggregate interface, you need to enable sFlow on each member port.

Examples

# Enable sFlow and sample outbound packets on GigabitEthernet 1/0/1.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] sflow enable outbound

sflow interval

Syntax

sflow interval interval-time

undo sflow interval

View

System view

Default Level

2: System level

Parameters

interval-time: Counter sampling interval in seconds, in the range 2 to 200.

Description

Use the sflow interval command to set the counter sampling interval at which the sFlow agent collects the statistics of all sFlow enabled ports.

Use the undo sflow interval command to restore the default interval.

By default, the sampling interval is 20 seconds.

Examples

# Configure the counter sampling interval as 50 seconds.

<Sysname> system-view

[Sysname] sflow interval 50

sflow sampling-mode

Syntax

sflow sampling-mode { determine | random }

undo sflow sampling-mode

View

Interface view

Default Level

2: System level

Parameters

determine: Sample a fixed number of packets, which is determined by the sampling rate.

random: Sample packets randomly.

Description

Use the sflow sampling-mode command to specify the packet sampling mode.

Use the undo sflow sampling-mode command to restore the default.

By default, the packet sampling mode is random.

Note that:

This command is supported on physical Ethernet ports only, instead of logical interfaces (VLAN interfaces) and network management interfaces. This command should be used after sFlow is enabled on the current port.

 

Currently, the determine mode is not supported on S5820X&S5800 series Ethernet switches.

 

Examples

# Configure the interface to sample a fixed number of inbound packets.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] sflow enable inbound

[Sysname-GigabitEthernet1/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, in the range of 1000 to 500000.

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 restore the default.

By default, the packet sampling rate is 200000, that is, one out of every 200000 packets is sampled.

Note that this command should be used after sFlow is enabled on the current port.

Note that:

This command is supported on physical Ethernet ports only, instead of logical interfaces (VLAN interfaces) and network management interfaces. This command should be used after sFlow is enabled on the current port.

Examples

# Specify the interface to sample a packet out of 100000 inbound packets.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] sflow enable inbound

[Sysname-GigabitEthernet1/0/1] sflow sampling-rate 100000

H3C reserves the right to modify its collaterals without any prior notice. For the latest information of the collaterals, please consult H3C sales or call 400 hotline.