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()
精彩评论