简介
本文档介绍与StarOS CLI — “show subscribers summary”输出所观察到的差异相关的场景及其建议的语法。
先决条件
要求
Cisco 建议您了解以下主题:
使用的组件
本文档中的信息基于StarOS版本21.23.12-83034和21.23.3-80756。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
要显示与节点中的用户会话相关的信息,可使用StarOS中的CLI — “show subscribers summary”以及一些预定义的过滤器关键字。其中一个此类过滤关键字是“connected-time”,可用于检查用户连接到节点/网络的时间。用于标识网络地址的命令如下:
show subscribers summary apn <apn-name> connected-time [ < | > | greater-than | less-than ] value
Where:
< : Filters output so that only information less than the specified value is displayed.
> : Filters output so that only information greater than the specified value is displayed.
greater-than : Filters output so that only information greater than the specified value is displayed.
less-than : Filters output so that only information less than the specified value is displayed.
value : Used in conjunction with <, >, greater-than, less-than, If no other filtering options are specified only output matching value is displayed. If value is not specified all data is displayed. value must be an integer from 0 through 4294967295.
问题
多次与“connected-time”过滤器关键字配合使用时,发现CLI“show subscribers summary”输出存在差异。CLI的输出与关键字的值和/或序列的变化不匹配。
测试方案
- 当多次使用“connected-time”过滤器关键字时,遇到此问题。
- StarOS管理指南中没有此特定关键字的示例。
- 本实验使用各种StarOS版本对同一场景进行了测试。结果如下:
[local]LTE_All3_ePDG# show subscribers summary | grep -i "Total Subscribers:"
Total Subscribers: 32
- 然后,使用“connected-time”过滤器关键字执行“show subscribers summary”CLI,其中包含各种参数/序列。从这些命令输出中,您可以看到,时间值或时间值顺序发生更改或关键字使用一次时,值会发生变化。
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time < 2000 | grep -i "Total Subscribers:"
Total Subscribers: 30
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time > 1000 | grep -i "Total Subscribers:"
Total Subscribers: 8
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time > 1000 connected-time < 2000 |grep -i "Total Subscribers:"
Total Subscribers: 30
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time < 2000 connected-time > 1000 |grep -i "Total Subscribers:"
Total Subscribers: 10
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time > 1000 < 2000 | grep -i "Total Subscribers:"
Total Subscribers: 8
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time < 2000 > 1000 | grep -i "Total Subscribers:"
Total Subscribers: 8
- 对其他StarOS版本也执行相同的测试,您会获得相同的差异。因此,所有StarOS版本都会观察它。
解决方案
将命令“show subscribers summary”与关键字“connected-time”配合使用的正确语法是,仅将关键字与大于(>)和小于(<)配合使用。
For Example:
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time > 1000 < 2000 | grep -i "Total Subscribers:"
Total Subscribers: 8
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time < 2000 > 1000 | grep -i "Total Subscribers:"
Total Subscribers: 8
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time greater-than 1000 less-than 2000 | grep -i "Total Subscribers:"
Total Subscribers: 8
[local]LTE_All3_ePDG# show subscribers summary apn ipv4.com connected-time less-than 2000 greater-than 1000 | grep -i "Total Subscribers:"
Total Subscribers: 8