send_command
Execute commands on network switches via serial console and retrieve the output. Supports Huawei, H3C, and Cisco devices for configuration and troubleshooting.
Instructions
向已连接的交换机发送一条命令,并获取返回结果。
华为交换机常用命令示例:
display version 查看设备版本
display current-configuration 查看当前配置
display interface brief 查看接口概要
display vlan 查看VLAN信息
display mac-address 查看MAC地址表
display arp 查看ARP表
display ip routing-table 查看路由表
display device 查看设备状态
display logbuffer 查看日志缓冲
ping 192.168.1.1 测试网络连通性
system-view 进入系统视图
display cpu-usage 查看CPU使用率
display memory-usage 查看内存使用率
注意:进入 system-view 后提示符会从 变为 [Huawei],此时可执行配置命令。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | 要发送给交换机的命令(不需要带回车,会自动添加) | |
| timeout | No | 等待响应的超时时间(毫秒),默认 5000ms。对于 show running-config 等长输出建议设大一些 |