Configuring sFlow Agents on the Network


You must configure and enable sFlow on each switch that you want to use for monitoring the network traffic.

To configure or enable sFlow agent on the network, use the command:


CLI (network-admin@switch) >  sflow-create name name-string [type ingress|egress] [sample-type raw|cooked] ports port-list [sample-rate sample-rate-number] [sample-interval sample-interval-number] [trunc-length trunc-length-number] [vlan 0..4095] [agent-id ip-address]


name name-string

Specify a name for the sFlow.

[type ingress|egress]

Specify whether the sFlow type is for ingress or egress traffic.

[sample-type raw|cooked]

Specify the sFlow sample type, recommended sample type is raw.

ports port-list

Specify the sFlow ports.

[sample-rate sample-rate-number]

Specify the sFlow sample rate. The default value is 4096.

[sample-interval sample-interval-number]      

Specify the sampling interval in seconds ( 1 sample in N seconds). The default value is 60 seconds.

[trunc-length trunc-length-number]

Specify the truncated length of the sFlow sample (sample packet size).

[vlan 0..4095]

Specify the VLAN ID. The VLAN option is configurable only on some hardware platforms. An error message is displayed if the platform does not support VLAN configuration for sFlow (see example below).

[agent-id ip-address]

Specify the local IP address.


Below is an example configuration on each switch for enabling the sFlow agent, net-monitor, on ingress ports 57-59, sample type raw, sample-rate 4096, sample interval 5 seconds (1 sample in 5 seconds), trunc-length 160 bytes:


CLI (network-admin@switch) >  sflow-create name net-monitor type ingress sample-type raw ports 57-59 sample-rate 4096 sample-interval 5 trunc-length 160 vlan 10


Note: Some platforms do not support VLAN configuration for sFlow. An error message is displayed when you configure an sFlow with VLAN configuration. For example:


CLI (network-admin@switch) >  sflow-create name net-monitor type ingress ports 10 vlan 10

sflow-create: This hardware platform does not support vlan specification for sflow


To delete an existing sFlow agent, use the command:


CLI (network-admin@switch) >  sflow-delete name name-string


To view the sFlow agent details, use the command:


CLI (network-admin@switch) >  sflow-show


Specify one or more of the options:


name name-string

Displays the name for the sFlow.

[type ingress|egress]

Displays whether the sFlow type is for ingress or egress traffic.

[sample-type raw|cooked]

Displays the sFlow sample type.

ports port-list

Displays the sFlow ports.

[sample-rate sample-rate-number]

Displays the sFlow sample rate.

[sample-interval sample-interval-number]      

Displays the sampling interval

[trunc-length trunc-length-number]

Displays the truncated length of the sFlow sample.

[vnet vnet-name]

Displays the VNET name for the VLAN.

[bd bridge-domain name]

Displays  the sFlow bridge domain name

[vlan 0..4095]

Displays the VLAN ID.

[agent-id ip-address]

Displays the local IP address.


For example, to view the details of a previously configured sFlow agent by using the command,


CLI (network-admin@switch) > sflow-show layout vertical


name:        net-monitor

type:        ingress

sample-type:        raw        

ports:        57-59

sample-rate:        4096

sample-interval:        5

trunc-length:        160

vnet:        

bd:        

vlan:        

agent id:        10.1.1.243

sample-pkt-cnt:        2845

sample-drops:        0