使用python 查看 linux 负载

Published on Aug. 22, 2023, 12:11 p.m.

使用python代码获取linux的系统负载

import os
os.getloadavg ()

(1.1200000000000001, 1.0600000000000001, 0.79000000000000004)

From there, you can do whatever checks you need, and then email you, or similar.