Solved

retrieve cpu and memeory information

Posted on 2001-08-07
9
538 Views
Last Modified: 2010-04-22
Hi all
can someone please tell me how to get the folowing information on Linux and SunOS using shell command (if it's possible):

services (deamons) - name , type and status
Memory - memory type , total size
CPU - cpu type and cpu family

for example : for Linux using "free -o| tail +2| awk '{print $2}'| head -n 1" will retrieve the total size of memeory.
    Thanks
0
Comment
Question by:dannynt
9 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 40 total points
ID: 6359941
>services (deamons) - name , type and status
Linux% ps ax
Solaris% ps -ef

>Memory - memory type , total size
Linux% free | awk '/^Mem:/{print $2}'
Solaris% prtconf | awk '/^Memory size:/{print $3 * 1024}'

>CPU - cpu type and cpu family
Linux% uname -m
Solaris% uname -im

is this what you mean?
0
 

Author Comment

by:dannynt
ID: 6362760
hi ahoffmann

>Memory
I want to know if it's possible to get the type for example: if the memory is DRAM,SRAM,VDRAM...
and about the size , yes thats what I need.

>CPU
I need to know the type of processor (Centeral processor,Math processor,...)
about family I need to know if it is Pentuim II , petuim III,8086,8088,....

>SERVICE
it looks fine what you gave me , can I know the status of each service (running,stop) or even the start type (automaticaly,manual...).

   Thanks
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6363628
>Memory
Type of memory is not of any interest for a real OS, so UNIX/linux does not have programs for that ;-)

>CPU
Linux% grep '<.>CPU:' /var/log/boot.msg
Solaris% uname -im

>SERVICE
 > .. can I know the status of each process
Linux% see that STAT column of ps output
Solaris% see S column of output
 > .. or even the start type
this is of no interrest at all in UNIX/Linux.
A deamon is either running or not. Dot. There is no difference if started by inetd, any startup script at boot time, or manually from within a shell by a user.
If you want to which deamons may be started automatically, just have a look at the scripts in
  Linux% /etc/rc[12345].d  or  /sbin/rc[12345].d
  Solaris% /etc/rc[12345]
     (the number 1..5 indicates the runlevel of your machine)
and  grep -v ^# /etc/inetd.conf
0
 

Author Comment

by:dannynt
ID: 6363805
Hi ahoffmann

>CPU
Linux - I tried the line grep '<.>CPU:' /var/log/boot.log
and I get : "grep: /var/log/boot.msg: No such file or directory" error message , is there any other file I should get it from there ?
    Thanks Danny
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Expert Comment

by:dbalaski
ID: 6364624
I cannot answer for Linux,

But in Solaris, you can use the program
prtconf program  (in my system, it is in /etc/ )

Here is the clipping from the MAN page:
================================================
NAME
prtconf - print system configuration

SYNOPSIS
SPARC
 /usr/sbin/prtconf [ -V ] | [ -F ]  | [ -x ]  | [ -vpPD ]
IA
 /usr/sbin/prtconf [ -V ] | [ -x ]  | [ -vpPD ]

DESCRIPTION
The prtconf command prints the system configuration information.  The  output  includes the total amount of memory, and the configuration of system peripherals formatted as a  device tree.
================================================

Hope this helps,
sincerely,
dBalaski
0
 

Expert Comment

by:barazani
ID: 6416224
I'llgive it a try as well :
Cpu -
linux cat /proc/cpuinfo
solaris psrinfo -v

Mem -
Linux cat /proc/meminfo
Solaris prtconf |grep Mem

as for services and demons
Linux - chkconfig --list
Solaris - go through the rc3.d scripts

all linux commands are tested on redhat ....

Moti
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6891325
Please update and finalize this.  Expert input appreciated if no response so we can close this.
Moondancer - EE Moderator
0
 
LVL 20

Expert Comment

by:tfewster
ID: 8048855
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by ahoffmann

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8096448
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now