Sometimes you may have to deal with such problems, such as server hardware failure and need to be replaced. in this case, you may need to obtain some key information about the hardware, such as the serial number, vendor, model, slot, capacity, and so on. it is silly to go to the data center to shut down and disassemble the machine. this method is not allowed in some scenarios with strict requirements, another example is the need to update the asset list. if there are any tools or commands that can help us simply complete this task, this is my purpose to write this blog. Physical
Sometimes you may have to deal with such problems, such as server hardware failure and need to be replaced. in this case, you may need to obtain some key information about the hardware, such as the serial number, vendor, model, slot, capacity, and so on. it is silly to go to the data center to shut down and disassemble the machine. this method is not allowed in some scenarios with strict requirements, another example is the need to update the asset list. if there are any tools or commands that can help us simply complete this task, this is my purpose to write this blog.
Physical memory:
Dmidecode-q-t 17 2 | grep "Size" | grep-v "No Module Installed" | awk '{print $2}' | uniq-c
View physical memory capacity (quantity of single-stick capacity)
Dmidecode-q-t 17 2
View the detailed information of the physical memory. In short, it is very detailed. you can filter out the desired information as needed.
Dmidecode-t 1
Check the motherboard information, server model, serial number or something, so you don't have to go to the data center to view it.
----------------------------------------------------------------------------
Physical hard disk:
First install the MegaRAID management tool provided by the server provider. you can download it from the official website:
/Opt/MegaRAID/MegaCli/MegaCli64-LDInfo-Lall-aALL
View raid level and detailed raid information
/Opt/MegaRAID/MegaCli/MegaCli64-PDList-aALL
Check the hard disk information. The key is to check whether a bad track exists.
/Opt/MegaRAID/MegaCli/MegaCli64-AdpAllInfo-aALL
View RAID card information
-----------------------------------------------------------------------------
Physical CPU:
Cat/proc/cpuinfo | grep "model name" | head-1 | awk-F: '{print $2 }'
View CPU model
Cat/proc/cpuinfo | grep "core id" | grep "0" | uniq-c | awk '{print $1 }'
Check the number of physical CPUs
Cat/proc/cpuinfo | grep "processor" | wc-l
View the total number of CPU cores