Tutorial on Figuring Out Your Server: Hardware

Server Config
Env Variables
This tutorial has examples for four versions of UNIX: Linux, Oracle’s Solaris, Apple’s Macintosh OS X and IBM’s AIX
Tutorial Contents



Name Service queries with DNS and NIS



What Is My Server’s Configuration ?

Hardware Information : CPU and Memory

Environmental Variables : Your Configuration


Disk Usage  and Listing Directory Contents

Who Else  is Logged in?


Hardware Information: CPU and Memory
Many intermediate level UNIX users rely on dmesg for hardware information. While that usually works, there other commands you should know about.

Most versions of UNIX have at least one command that will give you an overview of the hardware. LINUX does creates files in /proc that will give you much of the hardware information you want.

The hardware information you are probably most interested in is information about the CPU and the memory. Information on disk space and other storage is later in this tutorial.

Linux:
penguin [1]> more /proc/cpuinfo
more /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.40GHz
stepping        : 7
cpu MHz         : 2399.954
cache size      : 512 KB
penguin [1]> more /proc/meminfo
total:    used:    free:  shared: buffers:  cached:
Mem:  2627448832 2602631168 24817664        0 14983168 208465920
Swap: 4293586944 380678144 3912908800
MemTotal:      2565868 kB
MemFree:         24236 kB
MemShared:           0 kB

Buffers:         14632 kB
Cached:          75632 kB
SwapCached:     127948 kB
Active:        2011868 kB
ActiveAnon:    1967048 kB
ActiveCache:     44820 kB
Inact_dirty:    379788 kB
Inact_laundry:   72660 kB
Inact_clean:     41352 kB
Inact_target:   501132 kB
HighTotal:     1703860 kB
HighFree:         3276 kB
LowTotal:       862008 kB
LowFree:         20960 kB
SwapTotal:     4192956 kB
SwapFree:      3821200 kB
Committed_AS:  4547092 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:     2048 kB
There is one CPU and it is an Intel Xeon operating at 2.4 gigahertz. Total memory is 2,565,868 kilobytes.


Solaris:
paloalto [1]> prtconf | more
System Configuration:  Sun Microsystems  sun4u
Memory size: 2048 Megabytes


Only a small portion of the information is shown, above.
You can also use prtdiag to get information on CPUs and total memory. Remember that the location of this utility depends on the hardware implementation, which is given by uname –i. The full path can be written as:
/usr/platform/`uname –i`/sbin/prtdiag


System clock frequency: 113 MHz
Memory size: 2048 Megabytes
========================= CPUs =========================
                   Run   Ecache   CPU    CPU
Brd  CPU   Module   MHz     MB    Impl.   Mask
---  ---  -------  -----  ------  ------  ----
0     0     0      450     4.0   US-II    1.0
0     2     2      450     4.0   US-II    1.0

========================= IO Cards =========================
Bus   Freq
Brd  Type  MHz   Slot  Name                              Model
---  ----  ----  ----  --------------------------------  ----------------------
0   PCI    33     0   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     0   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     1   network-SUNW,hme                                        
0   PCI    33     1   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     1   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     1   scsi-glm/disk (block)             Symbios,53C875        
0   PCI    33     1   scsi-glm/disk (block)             Symbios,53C875        
0   PCI    33     2   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     2   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     3   scsi-glm/disk (block)             Symbios,53C875        
0   PCI    33     3   scsi-glm/disk (block)             Symbios,53C875        
0   PCI    33     3   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
0   PCI    33     3   SUNW,qfe-pci108e,1001             SUNW,pci-qfe          
No failures found in System
===========================

There are two CPUs and they are Sun Microsystems UltraSpac II operating at 450 megahertz. Total memory is 2048 MB.


OS X:
cupertino [1]> system_profiler | more
Hardware:
        Hardware Overview:
                Machine Name: PowerBook G4 12"
                Machine Model: PowerBook6,8
                CPU Type: PowerPC G4  (1.2)
                Number Of CPUs: 1
                CPU Speed: 1.5 GHz
                L2 Cache (per CPU): 512 KB
                Memory: 512 MB
                Bus Speed: 167 MHz
                Boot ROM Version: 4.9.0f0
                Serial Number: ABC123UNME
                Sudden Motion Sensor:
                        State: Enabled
                        Version: 1.0

The output from system_profiler is clean and to the point. There is one CPU and it is a PowerPC G4  version 1.2 operating at 1.5 gigahertz. Total memory is 512 MB.

AIX:
endicott[1]> prtconf | more
System Model: IBM,9133-55A
Machine Serial Number: 10B240G
Processor Type: PowerPC_POWER5
Number Of Processors: 4
Processor Clock Speed: 1496 MHz
CPU Type: 64-bit
Kernel Type: 32-bit
LPAR Info: 1 endicott
Memory Size: 15936 MB
Good Memory Size: 15936 MB
Firmware Version: IBM,SF235_180
Console Login: enable
Auto Restart: true
Full Core: false
Network Information
       Host Name: endicott
       IP Address: 192.168.22.102
       Sub Netmask: 255.255.255.0
       Gateway: 192.168.22.1
       Name Server:
       Domain Name:



dmesg
You are probably aware that during startup, information is displayed on the screen. Much of this is generated when the operating system recognizes and initializes the installed hardware.

These messages are also preserved as entries in the logs. Often a command like dmesg is used to dump log information to the screen, and that information can often be used to determine the installed hardware.
dmesg | grep –i cpu
dmesg | grep –i mem

So, if you are using dmesg to find CPU and memory information, you are essentially checking the startup logs to determine hardware configuration. While this works, you are depending on the preservation of the startup logs. Generally, this is a safe assumption, but logs are continuously cycled through. So, if a UNIX computer has been up long enough, the logs created during startup may be purged.
    


Suggestions for Future Learning
This tutorial is excrepted from  UNIX For Application Support Staff Chapter 1.



Server Config
Env Variables