I'm writing a distributed, embedded, multi master / slave application for my college coursework and as a part of that I need a way to determine the CPU Speed, CPU usage and available Memory of each system in realtime without a lot of memory respectively cpu consumption, in order to automatically adjust the configuration of the network and the devices.
Triggering system calls periodically or reading out files (open-read-close ....) does not really pose a resource friendly option. I'm sure there must be some POSIX compliant solution to this?
The systems will all be using Linux as an OS and I'm supposed to exclusively use LGPL or BSD libraries for the release.
So far I haven't found any solutions that would fit the criteria.
Any ideas?
Here are few tips that can lead you to a solution :
1- kernel infos
2- You can get that information in
/proc/cpuinfo. Google for 'Proc Filesystems'.3- extract system infos
4- Another StackOverflow subject that might help here
From that i think you can lead yourself to the solution.