Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 230

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 300

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 301

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 302

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 305

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 308

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 311

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/typology/functions.php on line 320
查看本服务器硬件信息(CPU、内存、硬盘等) – 理想社会

查看本服务器硬件信息(CPU、内存、硬盘等)

以戴尔服务器为例:

#!/bin/bash
#查看服务器ip:
ifconfig |grep -A7 “eth0” |grep “inet addr” |awk ‘{print $2}’|sed ‘s/addr://g’
#查看服务器型号:
dmidecode |grep -A8 “System Information” |grep “Product Name”|sed ‘s/^[ t]*//’
#查看硬件编号:
dmidecode |grep -A8 “System Information” |grep “Serial Number” |sed ‘s/^[ t]*//’
#现有内容数量和容量:
dmidecode |grep -A16 “Memory Device” |grep “Size” |sed ‘s/^[ t]*//’
#最大支持内存容量:
dmidecode |grep “Maximum Capacity” |sed ‘s/^[ t]*//’
#查看CPU类型和主频:
cat /proc/cpuinfo |grep “model name”
#硬盘容量:
fdisk -l |grep “Disk” |awk ‘{print $2$3$4}’


获取到的内容为:

192.168.1.1
Product Name: PowerEdge R510
Serial Number: XXXXXXX
Size: 4096 MB
Size: 4096 MB
Size: 4096 MB
Size: 4096 MB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Maximum Capacity: 128 GB
model name : Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
model name : Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
model name : Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
model name : Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
/dev/sda:292.3GB,
/dev/sdb:859.0GB,

About the author

Add comment

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

By now163

Your sidebar area is currently empty. Hurry up and add some widgets.