|P is for Practical|
How to Monitor System Resourcesby barns (Acolyte)
|on Oct 25, 2008 at 22:01 UTC||Need Help??|
barns has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to integrate simple system resource logging into a fairly complex application I am currently writing. I have already investigated Linux CPU usage monitor, but it doesn't achieve what I am after. If anyone can assist, it will be appreciated.
I wish to monitor cpu usage (I'm really interested in the percentage usage, but the format from the linked node is ok.), memory usage and network throughput. Similar to tools like top, the Gnome System Monitor, the Windows Task Manager, etc.
The biggest problem is that solutions such as parsing /proc/stat are Linux specific. My code will be deployed to Linux and FreeBSD machines, and possibly Windows in the future.
Can anyone suggest where I can get this information from within my perl script?