Best way to retrieve system and hardware info
I have been poking around the Linux programming manuals for some time now, but there seems to be a lack of function calls that retrieves system information like CPU info, hardware info, memory, hard disk, devices and so on.
I know that some of the information can be retrieved from configuration files, but the problem is that there is no generic location for certain config files in Linux. Also this seems to be a somewhat unsatisfactory solution. What is the best way to retrieve system information in a generic way in Linux?
Thank you. |
Loads, and loads of info can be obtained through /proc
|
Yes. I saw /proc. Is this generic on all systems?
Also how do I retrieve these files from programming. Just open them or pipe them from a shell output? |
As per request, moved to Programming
|
How you retrieve these files depends on your programming language of choice.
This is not generic on all systems, as there is the option to not compile /proc into the linux kernel. However, just about everyone compiles it in because it's just so useful. I know it's definately there by default on a SuSE system. |
I will be using C.
|
All times are GMT -5. The time now is 04:59 AM. |