linux服务器或win-server 内存、CPU、磁盘、RAID统计

1、软件准备

    CPU、内存:dmidecode-2.10-setup.exe

    磁盘、RAID:Megacli64.exe                     

    windows简化查询:grep-2.5.4-setup.exe  下载链接:https://nchc.dl.sourceforge.net/project/gnuwin32/grep/2.5.4/grep-2.5.4-setup.exe

注:上述软件均为GNU软件 官网可下

2、CPU 统计

①在默认目录

dmidecode  -t 4 >../bin/cpu.txt

cd ../bin

egrep "CPU|Count" cpu.txt

②在同一级目录时


主要获取CPU 型号 频率 数量 线程数 如上可统计为  2* Intel Xeon<R> E5-2650 v4 2.2GHz 12核 一核2线程

3、内存统计

dmidecode >../bin/memory.txt

1°获取内存产商 品牌 序列号

grep "System Information" -A9 memory.txt | egrep "Manufacturer|Product|Serial"


2°获取内存盘频率

grep -A16 "Memory Device" memory.txt | grep "Speed"


3°获取内存大小、卡槽数量

grep -A5 "Memory Device" memory.txt | grep Size | grep -v range


4、Raid查看

MegaCli64.exe -PDList -aAll -NoLog|grep "Device Speed"


MegaCli64.exe -ShowSummary -aALL

MegaCli64.exe -pdlist -aall | egrep "Raw Size|Inquiry Data|PD Type"


MegaCli64.exe -LDInfo -LALL -aAll | grep  "RAID Level"


MegaCli64.exe -PDList -aALL > disks.txt

RAID Level对应关系

RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0 RAID 1

RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0 RAID 0

RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 RAID 5

RAID Level : Primary-1, Secondary-3, RAID Level Qualifier-0 RAID 10

下列为linux简要命令,可直接复制粘贴:

dmidecode  -t 4 |egrep "CPU|Count"

dmidecode |grep "System Information" -A9  | egrep "Manufacturer|Product|Serial" 

dmidecode| grep -A16 "Memory Device"|grep "Speed"

dmidecode | grep -A5 "Memory Device"| grep Size | grep -v range

wget ftp://download2.boulder.ibm.com/ecc/sar/CMA/XSA/ibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip

unzip ibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip

cd linux/;rpm -ivh Lib_Utils-1.00-09.noarch.rpm  MegaCli-8.00.48-1.i386.rpm

  /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll -NoLog|grep "Device Speed" 

 /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll | grep  "RAID Level" 

/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall | egrep "Raw Size|Inquiry Data|PD Type"

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容