主板规格:主板大小-主板类型-单路双路-CPU支持型号-几个板载网卡 实例:ATX-服务器主板-支持双路至强E5-2600v4/v3系列处理器-双千兆 CPU规格:型号-物理内核数-基频-L3级缓存-功率 实例:CPU-S-4210R-Intel-Xeon-Silver--4210R-10C-2.40-GHz-13.75MB-100W AMD-EPYC-7542-32C-1500MHz-16384K- Intel-Xeon-Silver--E5-2620V4-8C-2.1GHZ-20M-85W 内存规格:内存容量-DDR-ECC-RECC-频率-颗粒规格 实例:MEM-64GB-DDR4-ECC-LRDIMM-2666-4R*4 16GB-DDR4-RECC-2933-1R*4 硬盘规格:SSD/HDD-容量-接口-速度-其他规格-尺寸 实例:SSD-240GB-SATA-6Gb/s-3D-TLC-2.5in HDD-4T-SATA-6Gb/s-7200rpm-128MB-3.5IN #后台运行 yum install epel-release -y #yum install -y screen screen -xRR Ctrl-A, d #硬件参数 sudo apt-get install inxi # 对于基于Debian的系统 sudo yum install inxi # 对于基于RedHat的系统 sudo pacman -S inxi # 对于Arch Linux系统 inxi -Fxz dnf install -y fastfetch fastfetch #neofetch 系统信息 sudo curl -s https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch -o /usr/bin/neofetch sudo curl http://192.168.1.34/neofetch.sh -o /usr/bin/neofetch && chmod +x /usr/bin/neofetch neofetch #硬件监控 ipmitool sdr list #查看系统版本 ` cat /etc/os-release cat /etc/os-release | grep PRETTY_NAME | awk -F\" '{print $2}' #查看cpu lscpu cat /proc/cpuinfo lscpu | grep 'Model name:' | awk -F\: '{print $2}'| sed 's/ //g' cat /proc/cpuinfo | grep process | wc -l # sudo localectl set-locale LANG=en_US.UTF-8 lscpu | awk -F':' ' /Model name/ {sub(/^ +/,"",$2); model=$2} /Socket\(s\)/ {socket=$2} /Core\(s\) per socket/ {core=$2} /Thread\(s\) per core/ {thread=$2} /L3 cache/ {l3=$2} END { total_phy=socket*core total_log=total_phy*thread printf "%s %d %d %s\n", model, total_phy, total_log, l3 }' #bois dmidecode -s bios-version sudo dmidecode |grep -A16 "BIOS Information$" dmidecode -t 0 #BMC ipmitool mc info #产品信息 dmidecode -t 1 #查看主板型号: sudo dmidecode |grep -A16 "System Information$" dmidecode -t 2 #内存槽及内存条: sudo dmidecode -t 16 sudo dmidecode memory sudo dmidecode |grep -A16 "Memory Device$" #内存列表 sudo dmidecode -t 17 | awk -F': ' ' BEGIN { printf "%-5s %-15s %-20s %-25s %-10s\n", "Line", "Locator", "Serial", "Size-Type-Speed", "Part Number"; } /Size:/ { size = $2 } /Bank Locator:/ { locator = $2 } /Type:/ { type = $2 } /Configured Memory Speed:/ { speed = $2 } /Serial Number:/ { serial = $2 } /Part Number:/ { part = $2 } /Firmware Version:/ { combined = size "-" type "-" speed; printf "%-5d %-15s %-20s %-25s %-10s\n", line++, locator, serial, combined, part; }' #电源信息: sudo dmidecode |grep -A16 "System Power Supply$" #硬盘信息 install -y lshw lsscsi sudo lshw -class disk #网卡 install pciutils -y lspci | grep net #ip查看 ip address #设置网卡ifcfg-eth0的IP vi /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO=static ONBOOT=yes IPADDR= NETMASK= GATWAY= /etc/init.d/network restart service network restart systemctl restart network.service #对于DHCP自动分配的ip,不能用ifconfig来激活或停止。 dhclient eth0 #!/usr/bin/env bash mapfile -t r1 < <( ipmitool sdr | grep -Ei 'RPM|degrees C|Watts' | awk '{printf "%-25s | %-15s\n", $1, $3}' ) sleep 30 mapfile -t r2 < <( ipmitool sdr | grep -Ei 'RPM|degrees C|Watts' | awk '{printf "| %-15s\n", $3}' ) sleep 30 mapfile -t r3 < <( ipmitool sdr | grep -Ei 'RPM|degrees C|Watts' | awk '{printf "| %-15s\n", $3}' ) # 并排输出(第1轮左侧,第2轮右侧) paste -d '' <(printf '%s\n' "${r1[@]}") <(printf '%s\n' "${r2[@]}") <(printf '%s\n' "${r3[@]}")