Statistics Application Commands
Use these M4500 CLI commands to configure statistics groups and flow-based statistics for port utilization and packet reception, and display statistics.
The statistics application lets you query port utilization statistics, flow-based statistics, and packet reception statistics on programmable time slots. The statistics application collects the statistics at a configurable time range. You can specify the port number(s) or a range of ports for statistics to be displayed. The configured time range applies to all ports. Detailed statistics are collected between a specified time range in date and time format. You can define the time range as an absolute time entry, a periodic time, or both. For example, you can specify the statistics to be collected and displayed between 9:00 12 NOV 2011 (START) and 21:00 12 NOV 2012 (END) or schedule it on every Mon, Wed, and Fri 9:00 (START) to 21:00 (END).
You can receive the statistics in the following ways:
- User requests through the CLI for a set of counters.
- Configuring the device to display statistics using syslog or email alert. The syslog or email alert messages are sent by the statistics application at END time.
You can configure the device to display statistics on the console. The collected statistics are presented on the console at END time.
stats group (Global Config)
This command creates a new group with the specified id or name and configures the time range and the reporting mechanism for that group.
| Format | stats group group {id | name} tierange time <range name> reporing list of reporting methods no stats group group {id | name} |
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| Group ID, name | Name of the group of statistics or its identifier to apply on the interface. The range is: 1. received 2. received-errors 3. transmitted 4. transmitted-errors 5. received- transmitted 6. port-utilization 7. congestion The default is none. |
| Time range name | Name of the time range for the group or the flow-based rule. The range is from 1 to 31 alphanumeric characters. The default is none. |
| List of reporting methods | Report the statistics to the configured method. The range is: 0. none 1. console 2. syslog 3. e-mail The default is none. |
Example: The following shows examples of the command.
(Routing) (Config)# stats group received timerange test reporting console email
syslog (Routing) (Config)# stats group received-errors timerange test reporting
email syslog
(Routing) (Config)# stats group received-transmitted timerange test reporting none
(Routing) (Config)# no stats group received
(Routing) (Config)# no stats group received-errors
(Routing) (Config)# no stats group received-transmitted
stats flow-based (Global Config)
This command configures flow based statistics rules for the given parameters over the specified time range. Only an IPv4 address is allowed as source and destination IP address.
| Format |
|
| Mode | Global Config |
| Parameter | Definition |
|---|---|
| Rule ID | The flow-base rule ID. The range is 1 to 16. The default is None. |
| Time range name | Name of the time range for the group or the flow-based rule. The range is from 1 to 31 alphanumeric characters. The default is None. |
| Srcip ip-address | Configure the source IP address of the rule. |
| Dstip ip-address | Configure the destination IP address of the rule. |
| Srcmac mac-address | Configure the source MAC address of the rule. |
| Dstmac mac-address | Configure the destination MAC address of the rule. |
| Srctcpport portid | Configure the source TCP port for the rule. The range is 1 to 65535. |
| Dsttcpport portid | Configure the destination TCP port for the rule. The range is 1 to 65535. |
| Srcudpport portid | Configure the source UDP port for the rule. The range is 1 to 65535. |
| Dstudpport portid | Configure the destination UDP port for the rule. The range is 1 to 65535. |
Example:s The following shows examples of the command.
(Routing) (Config)# stats flow-based 1 timerange test srcip 1.1.1.1 dstip 2.2.2.2
srcmac 1234 dstmac 1234 srctcpport 123 dsttcpport 123 srcudpport 123 dstudpport 123
(Routing) (Config)#stats flow-based 2 timerange test srcip 1.1.1.1 dstip 2.2.2.2
srctcpport 123 dsttcpport 123 srcudpport 123 dstudpport 123
(Routing) (Config)# no stats flow-based 1
(Routing) (Config)# no stats flow-based 2
stats flow-based reporting
This command configures the reporting mechanism for all the flow-based rules configured on the system. There is no per flow-based rule reporting mechanism. Setting the reporting method as none resets all the reporting methods.
| Format | stats flow-based reporting list of reporting methods |
| Mode | Global Config |
Example: The following shows examples of the command.
(Routing) (Config)# stats flow-based reporting console email syslog
(Routing) (Config)# stats flow-based reporting email syslog
(Routing) (Config)# stats flow-based reporting none
stats group (Interface Config)
This command applies the group specified on an interface or interface-range.
| Format |
|
| Mode | Interface Config |
| Parameter | Definition |
|---|---|
| Group ID, name | Name of the group of statistics or its identifier to apply on the interface. The range is: 1. received 2. received-errors 3. transmitted 4. transmitted-errors 5. received- transmitted 6. port-utilization 7. congestion The default is none. |
Example: The following shows examples of the command.
(Routing) (Interface 0/1-0/10)# stats group 1
(Routing) (Interface 0/1-0/10)# stats group 2
(Routing) (Interface 0/1-0/10)# no stats group 1
(Routing) (Interface 0/1-0/10)# no stats group 2
stats flow-based (Interface Config)
This command applies the flow-based rule specified by the id on an interface or interface-range.
| Format |
|
| Mode | Interface Config |
| Parameter | Definition |
|---|---|
| Rule ID | The flow-base rule ID. The range is 1 to 16. The default is None. |
Example: The following shows examples of the command.
(Routing) (Interface 0/1-0/10)# stats flow-based 1
(Routing) (Interface 0/1-0/10)# stats flow-based 2
show stats group
This command displays the configured time range and the interface list for the group specified and shows collected statistics for the specified time-range name on the interface list after the time-range expiry.
| Format | show stats group {group-id | name} |
| Mode | Privileged EXEC |
| Parameter | Definition |
|---|---|
| Group ID, name | Specify the ID or name of the group. The ID and name associations are as follows: 1. received 2. received-errors 3. transmitted 4. transmitted-errors 5. received- transmitted 6. port-utilization 7. congestion The default is none. |
Example: The following shows examples of the command.
(Routing) #show stats group received
Group: received Time Range: test Interface List
-----------------
0/2, 0/4, lag 1
Counter ID Interface Counter Value
------------ ------------------------
Rx Total 0/2 951600
Rx Total 0/4 304512
Rx Total lag 1 0
Rx 64 0/2 0
Rx 64 0/4 4758
Rx 64 lag 1 0
Rx 65to128 0/2 0
Rx 65to128 0/4 0
Rx 65to128 lag 1 0
Rx 128to255 0/2 4758
Rx 128to255 0/4 0
Rx 128to255 lag 1 0
Rx 256to511 0/2 0
(Routing) #show stats group port-utilization
Group: port-utilization Time Range: test Interface List
--------------
0/2, 0/4, lag 1
Interface Utilization (%)
--------- ---------------
0/2 0
0/4 0
lag 1 0
show stats flow-based
This command displays the configured time range, flow-based rule parameters and the interface list for the flow specified.
| Format | show stats flow-based {rule-id | all} |
| Mode | Privileged EXEC |
| Parameter | Definition |
|---|---|
| Rule ID | The flow-base rule ID. The range is 1 to 16. The default is None. |
Example: The following shows examples of the command.
(Routing) #show stats flow-based all
Flow based rule Id............................. 1
Time Range..................................... test
Source IP...................................... 1.1.1.1
Source MAC..................................... 1234
Source TCP Port................................ 123
Source UDP Port................................ 123
Destination IP................................. 2.2.2.2
Destination MAC................................ 1234
Destination TCP Port........................... 123
Destination UDP Port........................... 123
Interface List
--------------
0/1 - 0/2
Interface Hit Count
--------- ---------
0/1 100
0/2 0
Flow based rule Id............................. 2
Time Range..................................... test
Source IP...................................... 1.1.1.1
Source TCP Port................................ 123
Source UDP Port................................ 123
Destination IP................................. 2.2.2.2
Destination TCP Port........................... 123
Destination UDP Port........................... 123
Interface List
--------------
0/1 - 0/2
Interface Hit Count
--------- ---------
0/1 100
0/2 0
(Routing) #show stats flow-based 2
Flow based rule Id............................. 2
Time Range..................................... test
Source IP...................................... 1.1.1.1
Source TCP Port................................ 123
Source UDP Port................................ 123
Destination IP................................. 2.2.2.2
Destination TCP Port........................... 123
Destination UDP Port........................... 123
Interface List
--------------
0/1 - 0/2
Interface Hit Count
--------- ---------
0/1 100
0/2 0