Solved

retrieve cpu and memeory information

Posted on 2001-08-07
9
555 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 21

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

735 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