导入华为设备管理模块

from huawei_device import HuaweiDevice

创建一个华为设备对象,需要传入设备的 IP 地址、用户名和密码

device = HuaweiDevice('192.168.1.1', 'admin', 'password')

登录设备

device.login()

执行命令,获取结果

result = device.execute('display cpu')

输出结果

print(result)

退出登录

device.logout()

使用 Python 脚本监控华为设备 CPU 使用率

原文地址: https://www.cveoy.top/t/topic/n36N 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录