Python and Server Load

Question:

Is there a way, using Python, to check the server load of a Linux machine periodically and inform me of it in some way?

Asked By: Antonis

||

Answers:

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.

Answered By: Mez
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.