1
Linux sysinfo gathering:
3
cpuinfo is obtained from parsing /proc/cpuinfo.
4
This can be convoluted at times, especially since every stable
5
kernel release seems to change the format.
7
Thankfully with the advent of the 'cpuinfo' instruction things
10
Some complex parsing goes on to give cleaner output.
12
os_info is obtained using the uname() function.
14
hostname is also obtained using the uname() function
16
memory is obtained by a fstat() on /proc/kcore
18
this sometimes ends up a Megabyte short if ACPI or APM
21
Other methods are available.
23
+ /proc/meminfo tends to always turn up a few megabytes short
24
because it ignores reserved and kernel memory
26
+ the sysinfo() function has similar problems
28
uptime is obtained from /proc/uptime
30
loadaverage is obtained from /proc/loadavg
32
+ this is proc filesystem dependent of course.
33
Maybe I should look into sysinfo()