必须在近期进行财产清点,并收集戴尔网络服务器的硬件信息,包括以下信息:
1.计算机 *** 作系统信息(类型、版本、核心、服务平台、IP地址)
2.计算机主板信息(制造商、型号、序列号)
3.CPU信息(型号规格、数量、物理核心数量)
4. *** 作内存(总容量,一卷)
5.硬盘(数量、单个卷、硬盘类型、Raid级别)
请在实施前安装MegaRAID。为了提高工作效率,我们应该使用SHELL脚本来完成它,如下:
#!/bin/sh #get os information function get_os_info() { release=`cat /etc/redhat-release | awk '{print $1"_"$3}'` kname=`uname -s` nodename=`uname -n` kernal=`uname -r` bit=`uname -i` printf "OS_RELEASE: $release"_"$bit\n" printf "OS_DETAIL: $kname $nodename $kernal $bit\n" } get_os_info #get vendor, model, sn... function motherboard() { vendor=`dmidecode -t 1|grep "Manufacturer"|awk '{print $2}'` model=`dmidecode -t 1|grep "Product"|awk '{print $4}'` sn=`dmidecode -t 1|grep "Serial" |awk '{print $3}'` printf "MODEL: $vendor $model\n" printf "SN: $sn\n" } motherboard function memory() { count=`dmidecode -q -t 17 2 |grep "Size" |grep -v "No Module Installed"|awk '{print $2}'|uniq -c|awk '{print $1}'` capacity=`dmidecode -q -t 17 2 |grep "Size" |grep -v "No Module Installed"|awk '{print $2}'|uniq -c|awk '{print $2}'` capacity=`expr $capacity / 1024` printf "MEM: $count"*"$capacity"G"\n" } memory function cpuinfo() { cpu_model=`cat /proc/cpuinfo|grep "model name"|head -1|awk -F: '{print $2}'` cpu_count=`cat /proc/cpuinfo|grep "core id"|grep "0"|uniq -c|awk '{print $1}'` cpu_total_cores=`cat /proc/cpuinfo|grep "processor"|wc -l` single_cores=`expr $cpu_total_cores / $cpu_count` printf "CPU:$cpu_model($cpu_count"*"$single_cores"Cores")\n" } cpuinfo function diskinfo() { raidlevel=`/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL |grep "RAID"|awk '{print $3}'|cut -b 9-9` disknumber=`/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL | grep "Drives"|awk -F ":" '{print $2}'` disktype=`/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep "PD Type"|head -1|awk -F: '{print $2}'` diskcapacity=`/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep "Raw Size" | head -1 | awk '{print $3}'` printf "DISK: $disknumber"*"$diskcapacity"GB"$disktype (Raid Level: $raidlevel)\n" } diskinfo脚本制作和实现结果如下:
OS_RELEASE: CentOS_6.5_x86_64 OS_DETAIL: Linux appsrv 2.6.32-431.el6.x86_64 x86_64 MODEL: Dell R730 SN: CDFGHJL MEM: 4*8G CPU: Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz(2*8Cores) DISK: 2*279.398GB SAS (Raid Level: 1)欢迎分享,转载请注明来源:内存溢出
评论列表(0条)