Solved

retrieve cpu and memeory information

Posted on 2001-08-07
9
548 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

867 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

22 Experts available now in Live!

Get 1:1 Help Now