I am trying to collect system stats using python. Mostly looking for a libery or github project that does this already. I am looking to be able to collect/log the following things.
- CPU Usage and or Load average
- Disk Free space
- Disk IO thoughput
- Ram usage (Free, Active, Cached)
- Network IO
- Bandwidth Usaged
- Uptime
- Anything else useful in server monitoring.
Edit:
I am mostly looking for support in Linux systems I will move on to windows systems later.
Try using the psutil module here, take a look at the example shown. However, for
DISK IOyou might have to use thewmiand thepywin32modules.For example, for
DISK QUEUE LENGTHwith windows use this:It uses the counters of the perfmon app on windows. For linux, there are multiple tools for DISK IO.
For linux
DISK IOcheck outiotophereAlso, example of Linux diskstats use this, it periodically parses
/proc/diskstatsI hope this helps. 🙂