Link to home
Start Free TrialLog in
Avatar of dannynt
dannynt

asked on

retrieve cpu and memeory information

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
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dannynt
dannynt

ASKER

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
>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
Avatar of dannynt

ASKER

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
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
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
Please update and finalize this.  Expert input appreciated if no response so we can close this.
Moondancer - EE Moderator
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
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange