Solved

retrieve cpu and memeory information

Posted on 2001-08-07
9
551 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Shell script errors 10 129
Skill Development 15 174
recommend secure & efficient Unix LDAP (equiv of Windows AD) 6 107
OpenLDAP Proxy to Active Directy 6 275
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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 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…

813 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

13 Experts available now in Live!

Get 1:1 Help Now