I'm trying to gather memory information about various linux machines programmatically. I have a client who has several different types of machines, so he really gives my code a workout. In order to get the amount of memory, I am using lshw because it gives the number of memory banks as well. However, it often reports it in slightly different formats on different machines, making my code keep breaking. I'm trying to make it as generic as possible, but never know when a new case will arise that I missed.
How would you accomplish this? Is parsing lshw my best bet? Should I just get the number of banks from lshw, and the amount of memory from /proc/meminfo? Will /proc/meminfo be inaccurate if some of the memory is used by onboard video, or something like that? -- Derek M Davis [EMAIL PROTECTED] ------------------------------------------------------------------- "Man has no choice about his need for self-esteem. He can only choose by what standard to gauge it." /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
