LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2006, 03:45 PM   #1
ToNNiX
LQ Newbie
 
Registered: Nov 2006
Posts: 6

Rep: Reputation: 0
Linux/Solaris CPU and Memory Info


Hi,

Does anyone know if there is a tool out there that can display (in a shell) the processor speed, number of CPUs, processor type, and amount of RAM installed on the system? I am looking for something that does this in both Linux and Solaris...it doesn't have to be the same tool, but that would obviously be helpful. I'm not looking for anything detailed, just a simple

(2) AMD Athlon(TM) MP 2000+
1253.012 Mhz
896 MB

If there isn't anything like this, any ideas on how I can program it myself? I would prefer not to have to parse through the /proc/cpuinfo and /proc/meminfo files (and their Solaris equivalents). Also, I'd like to do this in either PHP, a shell script, or C++ (but I'll take it in Java if you're awesome enough to code it all for me). Trying to shoot for some platform independance here...
 
Old 12-14-2006, 06:47 PM   #2
cjcox
Member
 
Registered: Jun 2004
Posts: 307

Rep: Reputation: 42
prtconf and psrinfo in Solaris
If you're running SUSE, you can use hwinfo (which tells you more than you ever thought you could know). Or as you pointed out, you can get the info from /proc/cpuinfo and commands like free.

Very difficult to code this up yourself btw. Easier IMHO, to parse the data from the different tools and try to format them uniformly.
 
Old 12-14-2006, 06:49 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,818

Rep: Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558
I think the relevant Perl modules are mentioned at the bottom of this page: http://search.cpan.org/~burak/Sys-In...ib/Sys/Info.pm
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux frontend memory/cpu allocation, is it possible? matticus Linux - Hardware 1 09-19-2006 02:22 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09:43 PM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 04:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration