Is there any library popular in Python to monitor Linux/Unix system?
In erlang, thare is a os_mon module responsible for monitoring system, but I haven't found the library like that for python,is there any? thank you very much开发者_如何学Go!
Two ways of doing this:
- Use
subprocess
to call another process that can get this information for you. - Use PyMeter. Does what you want easily.
Like Sukhbir suggested earlier, you can look beyond python by using subprocess to invoke another tool that can do this for you. Look at Dstat. It returns a very large number of metrics in easily digestible format, and might just suit your needs.
The Dtat homepage - http://dag.wieers.com/home-made/dstat/
精彩评论