<命令>服务器硬件参数查看命令

时间:Nov. 9, 2016 分类:

目录:

查看磁盘

[root@why-1 ~]# fdisk -l

Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078f9c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        5222    41940992   83  Linux

Disk /dev/xvdb: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/xvdc: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

磁盘使用情况

[root@DZT11 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       488G   14G  450G   3% /
tmpfs           127G  228K  127G   1% /dev/shm
/dev/sda1       291M   39M  237M  15% /boot
/dev/sdb        440G  254M  418G   1% /mnt/disk1
tmpfs            64G     0   64G   0% /mnt/tmpfs

磁盘分区情况

[root@DZT11 ~]# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 558.4G  0 disk 
├─sda1   8:1    0   300M  0 part /boot
├─sda2   8:2    0  62.5G  0 part [SWAP]
└─sda3   8:3    0 495.6G  0 part /
sdb      8:16   0 446.6G  0 disk /mnt/disk1
sdc      8:32   0  16.4T  0 disk 

磁盘写入速度

[root@DZT02 ~]# iostat -m 
Linux 2.6.32-431.el6.x86_64 (DZT02)     11/03/2016  _x86_64_    (24 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.02    0.00    0.02    0.03    0.00   99.93

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               0.71         0.00         0.05        333       4732
sdb               0.01         0.00         0.00          3          0
sdd               0.01         0.00         0.00          4          0
sdc               0.01         0.00         0.00          3          0
sdf               0.01         0.00         0.00          4          0
sde               0.01         0.00         0.00          4          0
sdg               0.01         0.00         0.00          3          0
scd1              0.68         0.04         0.00       3673          0

查看内存

[root@DZT11 ~]# free -g
             total       used       free     shared    buffers     cached
Mem:           252          3        248          0          0          0
-/+ buffers/cache:          2        250
Swap:           62          0         62

[root@DZT11 ~]# grep MemTotal /proc/meminfo

查看cpu

查看物理CPU个数

[root@DZT11 ~]# cat /proc/cpuinfo|grep "physical id"|sort|uniq|wc -l
2

查看逻辑cpu核数

[root@DZT01 ~]# cat /proc/cpuinfo|grep "processor"|sort|uniq|wc -l
24

查看cpu

[root@why-1 sh]# cat /proc/cpuinfo | grep "model name" |awk -F':' '{print $2}'
 Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz

查看主板

yum install –y dmidecode

[root@why-1 sh]# dmidecode -q
BIOS Information
    Vendor: Xen
    Version: 4.0.1
    Release Date: 12/16/2014
    Address: 0xE8000
    Runtime Size: 96 kB
    ROM Size: 64 kB
    Characteristics:
        PCI is supported
        EDD is supported
        Targeted content distribution is supported
    BIOS Revision: 4.0

System Information
    Manufacturer: Xen
    Product Name: HVM domU
    Version: 4.0.1
    Serial Number: cf42b5fa-7377-4045-b276-e7dd708e3b86
    UUID: CF42B5FA-7377-4045-B276-E7DD708E3B86
    Wake-up Type: Power Switch
    SKU Number: Not Specified
    Family: Not Specified

Chassis Information
    Manufacturer: Xen
    Type: Other
    Lock: Not Present
    Version: Not Specified
    Serial Number: Not Specified
    Asset Tag: Not Specified
    Boot-up State: Safe
    Power Supply State: Safe
    Thermal State: Safe
    Security Status: Unknown

Processor Information
    Socket Designation: CPU 1
    Type: Central Processor
    Family: Other
    Manufacturer: Intel
    ID: D7 06 02 00 FF FB 89 17
    Version: Not Specified
    Voltage: Unknown
    External Clock: Unknown
    Max Speed: 2300 MHz
    Current Speed: 2300 MHz
    Status: Populated, Enabled
    Upgrade: Other

Physical Memory Array
    Location: Other
    Use: System Memory
    Error Correction Type: Multi-bit ECC
    Maximum Capacity: 1 GB
    Number Of Devices: 1

Memory Device
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 1024 MB
    Form Factor: DIMM
    Set: None
    Locator: DIMM 0
    Bank Locator: Not Specified
    Type: RAM
    Type Detail: None

Memory Array Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x0003FFFFFFF
    Range Size: 1 GB
    Partition Width: 1

Memory Device Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x0003FFFFFFF
    Range Size: 1 GB
    Partition Row Position: 1

System Boot Information
    Status: No errors detected

查看共享内存

[root@bogon /]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 98304      root       600        393216     2          dest         
0x00000000 131073     root       600        393216     2          dest         
0x00000000 163842     root       600        393216     2          dest         
0x00000000 196611     root       600        393216     2          dest         
0x00000000 229380     root       600        393216     2          dest         
0x00000000 262149     root       600        393216     2          dest         
0x00000000 294918     root       600        393216     2          dest         
0x00000000 327687     root       600        393216     2          dest         
0x00000000 360456     root       600        393216     2          dest         
0x00000000 393225     root       600        393216     2          dest         
0x00000000 425994     root       600        393216     2          dest         
0x00000000 458763     root       600        393216     2          dest         
0x00000000 491532     root       600        393216     2          dest         
0x0052e2c1 1015821    postgres   600        37879808   15            

查看网卡

yum install –y pciutils

lspci | grep -i eth | awk 'NR==1'| awk -F ":"'{print $3}'