Dec 02

How to checked the server hardware info on Linux

How to Check memory size

Basicly there are 5 way to checked memory size on linux:

  • dmesg
  • /proc/meminfo
  • free
  • top
  • lhsw (Ubuntu and fedora)

Using dmesg command

To check memory size in Linux using dmesg command , run the following command:

# dmesg |grep -i memory
Memory: 2072472k/2097024k available (2138k kernel code, 23276k reserved, 868k data, 240k init, 1179520k highmem)
Freeing initrd memory: 1515k freed
Total HugeTLB memory allocated, 0
Non-volatile memory driver v1.2
Freeing unused kernel memory: 240k freed

Checked the /proc/meminfo files

We can also check memory size in linux using /proc information ,run following from the command line:
 

# cat /proc/meminfo |grep -i memtotal MemTotal:      2075116 kB

Using Free command

We can also check memory size on Linux using free command, run the following:

# free -m
             total       used       free     shared    buffers     cached
Mem:          2026       1589        437          0        349        466
-/+ buffers/cache:        773       1252
Swap:         3812          0       3812

Using top command

Linux also comes with top command, top can be run to check real memory size and memory utilization.Top display total memory size,used memory,free memory ,memory buffers size and swap memory utilization :

# top
top – 18:11:08 up 2 days,  5:53,  2 users,  load average: 0.12, 0.87, 1.51
Tasks: 154 total,   1 running, 153 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 99.5%id,  0.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2075116k total,  1640432k used,   434684k free,   358264k buffers
Swap:  3903784k total,      200k used,  3903584k free,   477984k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      15   0  2036  640  548 S    0  0.0   0:01.71 init
    2 root      RT   0     0    0    0 S    0  0.0   0:00.73 migration/0
    3 root      34  19     0    0    0 S    0  0.0   0:00.00 ksoftirqd/0

Using lhsw command

Ubuntu and fedora linux also comes with package called lshw (list hardware) which provides detailed information on memory size, how many memory dims available, memory slots free along with other Linux system Hardware information .Run lshw and scroll down to *-memory section :

#lshw |grep

*-memory

description: System Memory

physical id: 39

slot: System board or motherboard

size: 1GB

 

How to Check HDD size

You can use fdisk and df command to checked the harddisk size

Using df command

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              9835048   5650736   3676660  61% /
tmpfs                  1037556         0   1037556   0% /dev/shm
/dev/sdb1             69436796  26951008  38901692  41% /home
/dev/sda3             56720252  35154916  18684080  66% /var
 

Display hard disk partition size in Mega bytes

# df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda1               11G   5.8G   3.8G  61% /
tmpfs                  1.1G      0   1.1G   0% /dev/shm
/dev/sdb1               72G    28G    40G  41% /home
/dev/sda3               59G    36G    20G  66% /var
 

Using fdisk command

fdisk command is partition table manipulator for Linux. But it can be use to display total hard disk site. You must type the following command as the root user:

# fdisk -l | grep Disk

Disk /dev/sda: 73.4 GB, 73407868928 bytes
Disk /dev/sdb: 73.4 GB, 73407868928 bytes

 

How to checked processor info

look into /proc/cpuinfo

# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.456
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips        : 6004.87

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.456
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips        : 6000.63

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.456
cache size      : 2048 KB
physical id     : 3
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips        : 6000.74

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz         : 3000.456
cache size      : 2048 KB
physical id     : 3
siblings        : 2
core id         : 0
cpu cores       : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr
bogomips        : 6000.73
 

You can checked the other hardware info on /proc/ directory

How to checked OS version

you can checked your current OS version by looking into /etc/*release

# cat /etc/*release
Fedora Core release 6 (Zod)

How to checked your memory type and

you can use dmidecode command

# dmidecode –type 17
# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0033, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0031
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 1024 MB
        Form Factor: DIMM
        Set: None
        Locator: DIMM_A1
        Bank Locator: BANK0
        Type: DDR2
        Type Detail: Synchronous
        Speed: 667 MHz (1.5 ns)
        Manufacturer: Manufacturer0
        Serial Number: SerNum0
        Asset Tag: AssetTagNum0
        Part Number: PartNum0

Handle 0x0035, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0031
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: DIMM
        Set: None
        Locator: DIMM_A2
        Bank Locator: BANK1
        Type: Unknown
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: Manufacturer1
        Serial Number: SerNum1
        Asset Tag: AssetTagNum1
        Part Number: PartNum1

Handle 0x0037, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0031
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: DIMM
        Set: None
        Locator: DIMM_B1
        Bank Locator: BANK2
        Type: Unknown
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: Manufacturer2
        Serial Number: SerNum2
        Asset Tag: AssetTagNum2
        Part Number: PartNum2

Handle 0x0039, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0031
        Error Information Handle: Not Provided
        Total Width: Unknown
        Data Width: Unknown
        Size: No Module Installed
        Form Factor: DIMM
        Set: None
        Locator: DIMM_B2
        Bank Locator: BANK3
        Type: Unknown
        Type Detail: Unknown
        Speed: Unknown
        Manufacturer: Manufacturer3
        Serial Number: SerNum3
        Asset Tag: AssetTagNum3
        Part Number: PartNum3
 

it means you are using memory ddr2 pc 667 , and the other 3 slots are empty (from the info there were 4 slots)

Here is more about dmidecode

 

Understanding BIOS keywords

dmidecode --type {KEYWORD / Number }

You need to pass dmidecode following keywords:

  • bios
  • system
  • baseboard
  • chassis
  • processor
  • memory
  • cache
  • connector
  • slot

All DMI types you need to use with dmidecode –type {Number}:

# Type Short Description
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply

Display Power supply information, enter:
# dmidecode --type 39
Display CPU information, enter:
# dmidecode --type processor
Read man page for more information:
$ man dmidecode

Nov 25

 

What is lm_sensors ?

 lm_Sensors is an Opensource Hardware health monitor. Monitor system sensors such as CPU and motherboard temperature.

Installation process

  1. install it through yum

             #yum install lm_sensors

            or you can install it through RPM ( http://fr2.rpmfind.net//linux/RPM/redhat/7.3/i386/lm_sensors-2.6.1-1.i386.html )

            # wget http://fr2.rpmfind.net//linux/RPM/redhat/7.3/i386/lm_sensors-2.6.1-1.i386.html

            # rpm -Uvh lm_sensors-2.6.1-1.i386.rpm

       2.  Detect the sensors on your mainboard, (run as root)

           # /usr/sbin/sensors-detect

            Accept all the default values.

            At the end it will print out something like:

To make the sensors modules behave correctly, add these lines to
/etc/modprobe.conf:

#—-cut here—-
# I2C module options
alias char-major-89 i2c-dev
#—-cut here—-

            Add the line, as instructed, to the end of /etc/modprobe.conf file.

      3.  Ignore the other instructions. Now run:
            #service lm_sensors start

         This will start the lm_sensors service.

          Now run:
          #sensors -s
         There should be no output.

         Next run:
         #sensors

         You should see output like this :

    # sensors
    w83792d-i2c-0-2f
    Adapter: SMBus I801 adapter at 0400
    VCoreA:    +1.25 V  (min =  +1.06 V, max =  +1.46 V)
    VCoreB:    +1.25 V  (min =  +1.06 V, max =  +1.46 V)
    VIN0:      +3.31 V  (min =  +0.00 V, max =  +4.08 V)
    VIN1:      +3.13 V  (min =  +0.00 V, max =  +4.08 V)
    VIN2:      +1.49 V  (min =  +0.00 V, max =  +4.08 V)
    VIN3:      +1.85 V  (min =  +0.00 V, max =  +4.08 V)
    5VCC:      +5.00 V  (min =  +0.00 V, max =  +6.12 V)
    5VSB:      +4.91 V  (min =  +0.00 V, max =  +6.12 V)
    VBAT:      +3.09 V  (min =  +0.00 V, max =  +4.08 V)
    Fan1:        0 RPM  (min =    0 RPM, div = 128)
    Fan2:        0 RPM  (min =    0 RPM, div = 2)
    Fan3:        0 RPM  (min =    0 RPM, div = 2)
    Fan4:        0 RPM  (min =    0 RPM, div = 128)
    Fan5:        0 RPM  (min =    0 RPM, div = 128)
    Fan7:     5769 RPM  (min =    0 RPM, div = 2)
    Temp1:     +28.0°C  (high = +127.0°C, hyst =  +0.0°C)
    Temp2:     +44.5°C  (high = +80.0°C, hyst = +75.0°C)
    Temp3:     +40.0°C  (high = +80.0°C, hyst = +75.0°C)
    chassis:  Chassis intrusion detection                  ALARM

    w83627thf-isa-0290
    Adapter: ISA adapter
    VCore:     +1.94 V  (min =  +0.70 V, max =  +1.87 V)       ALARM
    +12V:      +6.57 V  (min =  +6.51 V, max = +14.96 V)
    +3.3V:     +3.31 V  (min =  +3.90 V, max =  +3.31 V)       ALARM
    +5V:       +4.99 V  (min =  +6.59 V, max =  +3.20 V)       ALARM
    -12V:      +6.06 V  (min = -14.33 V, max =  +4.99 V)       ALARM
    V5SB:      +5.00 V  (min =  +6.40 V, max =  +6.85 V)       ALARM
    VBat:      +0.10 V  (min =  +1.86 V, max =  +2.03 V)       ALARM
    fan1:        0 RPM  (min = 2689 RPM, div = 2)              ALARM
    CPU Fan:     0 RPM  (min = 4821 RPM, div = 2)              ALARM
    fan3:        0 RPM  (min = 3426 RPM, div = 2)              ALARM
    M/B Temp:    -48°C  (high =    -9°C, hyst =   +17°C)   sensor = thermistor  
    CPU Temp:  -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor  
    temp3:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor  
    alarms:   Chassis intrusion detection                      ALARM
    beep_enable:
          Sound alarm enabled