Test environment:
Dell Server
CentOS 6.4
The main commands to use are:
Dmidecode, Cat, megaCli64, DF
Query Server model:
Dmidecode-t 1
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/77/wKioL1jfW7yzcQejAAAj6_1NbpU698.png-wh_500x0-wm_ 3-wmp_4-s_4239883571.png "title=" 1.png "alt=" Wkiol1jfw7yzcqejaaaj6_1nbpu698.png-wh_50 "/>
Query Motherboard information:
Dmidecode-t 2
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/77/wKioL1jfXFTzZqWbAAAiLUMo3Vs801.png-wh_500x0-wm_ 3-wmp_4-s_2408348838.png "title=" 2.png "alt=" Wkiol1jfxftzzqwbaaailumo3vs801.png-wh_50 "/>
Query CPU Information:
View CPU Models
Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/79/wKiom1jfYEGihTDtAAAOogvPwlA386.png-wh_500x0-wm_ 3-wmp_4-s_3187819685.png "title=" 6.png "alt=" Wkiom1jfyegihtdtaaaoogvpwla386.png-wh_50 "/>
View CPU Physical Number
Cat/proc/cpuinfo |grep "Physical ID" | Sort | Uniq | Wc-l
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/79/wKiom1jfXijzjDjFAAAKlERB08A389.png-wh_500x0-wm_ 3-wmp_4-s_3076976763.png "title=" 3.png "alt=" Wkiom1jfxijzjdjfaaaklerb08a389.png-wh_50 "/>
To view the number of individual CPU cores
cat/proc/cpuinfo| grep "CPU Cores" | Uniq
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8F/77/wKioL1jfXpDCLrIGAAAJwfQl10s953.png-wh_500x0-wm_ 3-wmp_4-s_3019325819.png "title=" 4.png "alt=" Wkiol1jfxpdclrigaaajwfql10s953.png-wh_50 "/>
To view the number of CPU logic
cat/proc/cpuinfo| grep "Processor" | Wc-l
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/79/wKiom1jfXxWgXmvXAAAJM9XuBvU945.png-wh_500x0-wm_ 3-wmp_4-s_4177705812.png "title=" 5.png "alt=" Wkiom1jfxxwgxmvxaaajm9xubvu945.png-wh_50 "/>
Description:
# Total Logical CPUs = number of physical CPUs x number of cores per physical CPU X number of hyper-threads
# If the CPU has the same number of cores as the logical number, it means that the CPU does not have hyper-threading and vice versa, as in this case the CPU is a double-threaded
Querying memory information
View Memory Models
Dmidecode-t 17
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/78/wKioL1jfdbyRHLz4AABUtXY6wQs805.png-wh_500x0-wm_ 3-wmp_4-s_1824807063.png "title=" 7.png "alt=" Wkiol1jfdbyrhlz4aabutxy6wqs805.png-wh_50 "/>
View the number of memory slots and current memory
Dmidecode|grep-p-a5 "Memory Device" |grep Size
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/78/wKioL1jfeCzS55p5AAA4vdIRFSQ831.png-wh_500x0-wm_ 3-wmp_4-s_1462025031.png "title=" 8.png "alt=" Wkiol1jfeczs55p5aaa4vdirfsq831.png-wh_50 "/>
Querying hard disk information
View the array card (or hard disk)
CAT/PROC/SCSI/SCSI (or by command: LSPCI)
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/7B/wKiom1jfewDx0wy0AAA8KUhAS0I618.png-wh_500x0-wm_ 3-wmp_4-s_601304858.png "title=" 9.png "alt=" Wkiom1jfewdx0wy0aaa8kuhas0i618.png-wh_50 "/>
View hard disk size
Df-th
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/97/wKiom1jl8U3w0C6HAABU4AsP7SY168.png-wh_500x0-wm_ 3-wmp_4-s_23027763.png "title=" 1.png "alt=" Wkiom1jl8u3w0c6haabu4asp7sy168.png-wh_50 "/>
Tools Introduction
Most of the servers are configured with array cards, raid on the hard disk, can be megacli this tool for command query array card and hard disk information (installation package see attachment)
Megacli64-cfgdsply-aall
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/96/wKioL1jl9EyDSaBfAACKjuIrz1Y834.png-wh_500x0-wm_ 3-wmp_4-s_1267811305.png "title=" 2.png "alt=" Wkiol1jl9eydsabfaackjuirz1y834.png-wh_50 "/>
The RAID model corresponding table information is as follows:
RAID level:primary-1, Secondary-0, Raidlevel Qualifier-0 "#代表Raid 1
RAID level:primary-0, Secondary-0, raidlevel Qualifier-0 "#代表Raid 0
RAID level:primary-5, Secondary-0, Raidlevel Qualifier-3 "#代表Raid 5
RAID level:primary-1, Secondary-3, Raidlevel Qualifier-0 "#代表Raid10
KVM Virtual machine configuration information Query
KVM Virtual Machine Default configuration file location:/etc/libvirt/qemu/
Example:
Cat/etc/libvirt/qemu/vm050.xml
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8F/96/wKioL1jl-HHj7yzBAACWUZ8fOpo662.png-wh_500x0-wm_ 3-wmp_4-s_808893948.png "title=" 3.png "alt=" Wkiol1jl-hhj7yzbaacwuz8fopo662.png-wh_50 "/>
As can be seen from the above information, the virtual machine vm050 memory is 8g,cpu logical number is 4, the hard disk virtual file path is/data/vmdisk/tmpl.sys.img
by command qemu-img info/data/vmdisk/tmpl.sys.img, you can query the size of the virtual hard disk, as follows
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/8F/96/wKioL1jl-WGCgqJQAAAdya0MILE782.png-wh_500x0-wm_ 3-wmp_4-s_2825463900.png "title=" 4.png "alt=" Wkiol1jl-wgcgqjqaaadya0mile782.png-wh_50 "/>
This article is from the "Dust Fog" blog, please be sure to keep this source http://george021.blog.51cto.com/3743506/1913485
Linux queries server model, motherboard, CPU, memory and hard disk information by command