当前位置:首页>Linux>Linux硬件检测

Linux硬件检测

  • 2026-09-09 02:49:08
Linux硬件检测

Linux抱负盛名的就是他的稳定性,但如果硬件除了问题,再稳定的系统也是会出问题的。

检测CPU

//下载cpuburn-in工具#> mkdir -p /testtool/cpu#> cd /testtool/cpu#> wget http://www.cpuburnin.com/downloads/cpuburn-in.tar.gz#> ll-rwxr-xr-x. 1 root root  7273 Apr 10 20:34 cpuburn-in.tar.gz#> tar zxvf cpuburn-in.tar.gz#> ./cpuburn-in-bash: ./cpuburn-in: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory#> yum install ld-linux.so.2 -y#>./cpuburn-in 5  //5是测试时间,以分钟算

测试多台机器(202.204.65.40~202.204.65.119)

//分发脚本 cpusend.sh#! /bin/shfor((i=40;i<=119;i++))dorcp /test/cpuburn-in 202.204.65.$i:/test/done//测试脚本 cputest.sh#! /bin/shfor((i=40;i<=119;i++))dorsh 202.204.65.$i "/test/cpuburn-in $1 > /test/cpulog"&done//查看脚本 viewcpu.sh#! /bin/shfor((i=40;i<=119;i++))dorsh 202.204.65.$i hostnamersh 202.204.65.$i "grep -i fail /tmp/cpulog"done

检测内存

国内坏的内存较为普遍,BIOS自检的时候,检测不到很多坏的RAM。

但是有几个现象可以判断是坏的内存

1.当同时运行大量的程序的时候,有程序无任何人为原因关闭

2.有时打不开文件,显示文件被损坏,但是有时这个文件有可以打开(同样解压的时候,过几天就可以解压)

目前检测内存的工具是memtester

//下载#> wget http://pyropus.ca/software/memtester/old-versions/memtester-4.2.2.tar.gz -O /test//安装#> tar zxvf memtester-4.2.2.tar.gz#> mv memtester-4.2.2/memtester ./memtester && cd ./memtester#> make && make install#> ./memtester 64 2 //64是ram-size,单位是M 2是run times

测试多台机器(202.204.65.40~202.204.65.119)

//分发脚本 memsend.sh#! /bin/shfor((i=40;i<=119;i++))dorcp /test/memtester 202.204.65.$i:/test/done//测试脚本 memtest.sh#! /bin/shfor((i=40;i<=119;i++))dorsh 202.204.65.$i "/test/memtester $1 > /test/memlog"&done//查看脚本 viewmem.sh#! /bin/shfor((i=40;i<=119;i++))dorsh 202.204.65.$i hostnamersh 202.204.65.$i "grep -i fail /tmp/memlog"done

‍‍

本文是我根据在自学过程中的经验总结出来的,如果有建议和看法,可以在文末留言,谢谢。

最新文章

随机文章