python 使用wsman控制dell服务器
安装
pip install wsmanyum install -y wsmancli简单实例
from wsman import WSMan
from wsman.provider.remote import Remote
from wsman.transport.process import Subprocess
wsman = WSMan(transport=Subprocess())
remote = Remote(host, user, passwd)
refs = wsman.enumerate_keys("DICIM_ComputerSystem", "root/dcim", remote=remote)
for ref in refs:
resp = wsman.get(ref, "", remote=remote)
print(dict(zip(resp.keys, resp.values)))硬件系统信息
Last updated