python library Glances library

Glances is a cross-platform system monitor tool written in Python with a web interface. It can be used to monitor various system information (such as CPU, memory, disk and network) on a local or remote computer and present this information in an easy-to-understand manner.

insert image description here
insert image description here

  • After installing the Glances library, you can run glances from the command line to start the program, and visit http://localhost:61208/ through your browser to view real-time system status.
    In addition, you can also use the Glances library in your code to obtain system performance data and process information. Here is a simple example:
import glances_api

# 创建API客户端对象
client = glances_api.Client()

# 获取CPU利用率百分比
cpu_percent = client

Guess you like

Origin blog.csdn.net/zhangzhechun/article/details/131168187