gpt4 book ai didi

linux - Linux 服务器的 CPU 使用百分比

转载 作者:太空宇宙 更新时间:2023-11-04 04:33:08 25 4
gpt4 key购买 nike

我想从 Linux 服务器获取 CPU 使用率百分比,我使用 python 与我的 Linux 服务器连接

shell = spur.SshShell(hostname="ip", username="root", password="password", missing_host_key=spur.ssh.MissingHostKey.accept)

我现在不知道该怎么办,有人可以帮忙吗?谢谢!

最佳答案

您可以使用psutil用于获取 CPU 使用率等系统信息的库。

关于linux - Linux 服务器的 CPU 使用百分比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45076729/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com