#!/bin/bash
echo "服务器型号、序列号:"
echo "===================================================================================================="
echo "	设备型号：" `dmidecode -s system-serial-number`
echo "	序列号：" `dmidecode -t system | grep -i 'serial number'`
echo "	其他：" `dmidecode -t system | grep -i 'System information' -A9 | egrep -i 'manufacturer|product|sial'`
echo "===================================================================================================="
echo " "
echo "主板信息:"
echo "===================================================================================================="
dmidecode | grep -i -A16 'System information$'
echo "===================================================================================================="
echo " "
echo "BIOS信息:"
echo "===================================================================================================="
dmidecode 3.0 | head -10
echo "===================================================================================================="
echo " "
echo "PCI信息:"
echo "===================================================================================================="
lspci | head -10
echo "===================================================================================================="

echo " "
echo "CPU信息:"
echo "===================================================================================================="
echo "	cpu型号" `grep name /proc/cpuinfo | cut -f2 -d: | uniq -c`
echo "	物理CPU的数量" ` grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l`
echo "	核心数" `grep 'processor' /proc/cpuinfo | wc -l`
echo "	单个cpu核心" `grep "cores" /proc/cpuinfo | uniq`
echo "	cpu主频" `grep -i MHz /proc/cpuinfo | uniq`
echo "===================================================================================================="

echo " "
echo "内存信息:"
echo "===================================================================================================="
dmidecode -t memory | head -45 | tail -23
echo "	最大支持内存："
dmidecode | grep -P 'Maximum\s+Capacity'
#echo "内存频率："
#dmidecode | grep -A16 -i "Memory Device" | grep -i 'Speed'
echo "	内存使用信息："
free -m
echo "===================================================================================================="

echo " "
echo "硬盘信息:"
echo "===================================================================================================="
lsblk
echo "	空间使用情况："
df -h
echo "===================================================================================================="

echo " "
echo "网卡信息:"
echo "===================================================================================================="
echo "	物理信息：" `lspci | grep -i 'eth'`
echo "	网卡配置信息："
ip a
echo "===================================================================================================="

echo " "
echo "显卡信息:"
echo "===================================================================================================="
echo "	物理信息：" 
lspci | grep -i vga
for i in `lspci | grep -i vga | awk '{print $1}'`;  
do   
echo "	显卡配置信息：" 
lspci -v -s $i
done   

echo "	显卡驱动："
lshw -c video | grep configuration


echo "===================================================================================================="

