dis cu | in xxx 时的正常提示,原因和应对如下:display current-configuration 在 SR8808X 这种机框式路由器上配置通常非常大(几千~几万行)。
| include 过滤,系统要先把整份运行配置生成出来再做正则匹配,CPU 和输出量都大。
Info: It will take a long time if the content you search is too much or the string you input is too long, you can press CTRL_C to break.
--- More ---)在等翻页;
in 0 / in .*),命中行极多,刷屏慢。
--- More ---:
screen-length disable
dis cu | in xxxxno-more:
dis cu | in xxxx | no-moredis cu:
dis cu interface GigabitEthernet0/0/1
dis cu | in ospf / dis cu | in bgp
dis cu | in 192.168.1.
section 看整段而不是全量匹配:
dis cu | section interface GigabitEthernet0/0/1dis cu > flash:/cu.txt
tftp/xftp/sftp 拉回本地看dis cu | in xxxx > flash:/match.txt
Ctrl+C 中断就行,对设备和当前配置没有任何副作用,重新敲命令即可。
dis cpu-usage 看一眼,确认不是 CPU 被打满;SR8808X 在业务高峰时 dis cu 确实会让主用板 CPU 短暂升高,属正常。
screen-length disable → 用更精确的 | in / | section / 指定视图 dis cu interface xx → 实在大就 > flash: 导出。
dis cu | in .* 这种宽匹配,纯属占 CPU。
SR8808X R8530P23 执行 display cu | in xxxx 提示 Info: It will take a long time...
提示信息直译:如果输出内容过大或者输入的字符串正则表达式过于复杂,查询将会耗费很长时间,可以按 CTRL+C 终止。
⚠️这条不是报错,只是系统预警提示,命令本身没有故障;SR8808X 大规格设备配置量巨大,display current‑configuration完整遍历全部运行配置做行过滤会消耗 CPU、耗时久,系统弹出友好告警。
产生该提示的 2 个主要诱因
配置文件体量巨大:SR8808X 核心路由器,大量接口、BGP/OSPF、ACL、策略、VPN 实例,display current‑configuration完整输出几万行,管道| include要逐行全量扫描,CPU 开销高。
过滤字符串是复杂正则表达式:包含特殊元字符[] . * + ()等,正则解析计算开销变大,更容易触发该提示。
敲完回车后等待,不按 Ctrl‑C,命令依然可以正常出结果,只是等待时间长;但大配置下会短暂抬高 CPU。
优化解决方法(优先使用前 3 种,避免全量扫描整个 current‑configuration)
方案 1:使用display current‑configuration feature按特性过滤(官方推荐,SR88 系列支持)
不要全量遍历全部配置,直接指定特性模块,只加载该模块配置,CPU 消耗极低,不会弹出慢查询提示。
shell
#示例,只看ospf相关配置
display current‑configuration feature ospf
#看bgp配置
display current‑configuration feature bgp
#看acl
display current‑configuration feature acl
支持 feature:interface、ospf、bgp、isis、acl、vpn‑instance、routing‑policy 等等。
方案 2:进入对应视图,执行display this
如果查询对象是接口、策略模板、VPN 实例,进入视图内部display this,只输出本视图配置,不需要扫描全机配置。
shell
system‑view
interface Ten‑GigabitEthernet1/0/1
display this
ip‑vpn‑instance test
display this
方案 3:导出完整配置到终端本地,本地文本工具搜索(最适合一次性批量检索)
终端软件(SecureCRT/Xshell 开启日志记录 log),执行display current‑configuration完整把全部配置输出保存到本地文本;
在电脑本地记事本 / Notepad++ 搜索关键字,不在设备上做管道 include 过滤,完全不占用设备 CPU。
方案 4:仍然坚持用| include查询的优化技巧
尽量使用简单普通字符串,不要写复杂正则,避免. * [ ] ( )等元字符;
如果提示出来,不要反复多次重复执行该命令,防止多进程同时扫描大配置导致 CPU 冲高;
等待输出,不要直接 ctrl‑c 频繁中断。
方案 5:统计匹配行数,加| count
shell
display current‑configuration | include "xxx" | count
排查确认
shell
#查看当前CPU,执行过滤前后观察CPU利用率
display cpu‑usage
执行display cu | include xxx瞬间 CPU 短时冲高属于正常现象,业务高峰期尽量避免频繁执行该全量过滤命令。
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论