开发者

Python and Server Load

Is there a way, using Python, to check the s开发者_JAVA百科erver load of a Linux machine periodically and inform me of it in some way?


Python has a function to get the system's load average as part of the os module

>>> 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.


os.getloadavg()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜