Recently, I sorted out the frequently used commands in my daily work, which are mainly divided into two main parts: one is the command to View hardware information, and the other is the command to monitor the running status of hardware. This article only involves the command to View hardware information. I will give you the command to monitor the running of hardware in the next blog.
Recently, I sorted out the frequently used commands in my daily work, which are mainly divided into two main parts: one is the command to View hardware information, and the other is the command to monitor the running status of hardware. This article only involves commands for viewing hardware information. I will share with you the commands for monitoring hardware operations in the next blog. These commands provide a basis for troubleshooting, and it is necessary to master these commands.
1. View cpu information
(1) cpu model
(2) number of cores
12 physical cores and 24-core Hyper-threading
2. View memory information
Cat/proc/meminfo
Or:
Free-m
Memory: 193793 MB
Swap size: 7844 M
3. View operating system information
(1) view Kernel Information
(2) view the version of the operating system
(3) view the number of operating systems
4. View Nic information
(1). view the overall Nic information
The machine contains two NICs, eth0 and eth1. lo indicates the local address. Note that eth0 and eth1 are bound to the same physical address HWaddr, in essence, Bonding is used to aggregate multiple NICs into one, which can provide load balancing, fault tolerance, and other functions.
(2) view binding mode
(3) view information about a network card
5. View disk information
(1) df
6. View RAID card information
Through the df command, we can understand the disk partition capacity and usage in a large part, but we do not know which disks are composed of each partition. generally, to improve disk availability, we will perform RAID on the disk. to view the RAID card information, run the MegaCli command, which is located at/opt/MegaRAID/MegaCli.
(1). View hard disk information
Sudo MegaCli64-PDList-aALL | egrep '(Raw Size | Device Id | DiskGroup | PD Type | Speed )'
Explanation: The Machine shares two SAS interface disks and eight SATA interface SSD disks.
(2) view the RAID level:
Sudo MegaCli64-LDInfo-Lall-aALL | egrep '(RAID | Size )'
Explanation: The machine has two RAID policies: RAID-1 and RAID-5.
RAID-1 Capacity: 558 GB, log disk [fully redundant to ensure high availability]
RAID-5 capacity: 3 TB, data disk
RAID-1 disk capacity calculation: disk capacity/2
RAID-5 disk capacity computing: single disk capacity * (N-1), N> = 3
Based on the disk information shown above, it is easy to obtain two SAS disks for RAID-1 and eight SSD disks for RAID-5.
(3) view the disk cache policy
Sudo/opt/MegaRAID/MegaCli/MegaCli64-LDGetProp-DskCache-LALL-aALL
Explanation:
To ensure data consistency, log disks disable disk write cache; to improve write efficiency, data disks enable disk write cache.