因为种种原来,我们可能需要查看linux服务器主板型号,cpu型号,内存大小,内存条数量等。因为服务器使用raid卡,平常查看硬盘信息的命令还不能用,待后面补充!

查看主板型号

 代码如下

复制代码

# dmidecode |grep -A 8 "System Information" 
 System Information
         Manufacturer:  Dell                   
         Product Name:  CS24-TY                
         Version:  A00                    
         Serial Number:  24Z1NL1                
         UUID:  2656CFCF-887A-0010-BBD8-00269E9C46DC
         Wake-up Type: Power Switch
         SKU Number: To Be Filled By O.E.M.
         Family: Server
上网查DELL CS24-TY,找到说主板型号是DELL  PowerEdge C1100

查看内存

 代码如下

复制代码

# free -m
               total        used       free      shared    buffers     cached
 Mem:          32103       31803        300           0         217        953
 -/+ buffers/cache:       30632       1471
 Swap:         16383         476      15907

查看内存条数

 代码如下

复制代码

[root@localhost ~]# dmidecode -t memory|grep Size
         Size: 8192 MB Type:  Other Speed: 1333 MHz
         Size: No Module Installed
         Size: No Module Installed
         Size: 8192 MB
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed
         Size: 8192 MB
         Size: No Module Installed
         Size: No Module Installed
         Size: 8192 MB
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed
         Size: No Module Installed

查看硬盘大小,分区

 代码如下

复制代码

[root@localhost ~]# df -h
 Filesystem             Size  Used Avail Use% Mounted on
 /dev/sda3              119G   17G   96G  15% /
 tmpfs                   16G     0   16G   0% /dev/shm
 /dev/sda1               97M   32M   61M  35% /boot

查看raid卡,raid卡为DELLPERC 6/i

 代码如下

复制代码

[root@localhost ~]# dmesg |grep -i raid
 dracut: rd_NO_DM: removing DM RAID activation
 dracut: rd_NO_MD: removing MD RAID activation
 ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl RAID mode
 megaraid_sas 0000:04:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
 megaraid_sas 0000:04:00.0: setting latency timer to 64
 megaraid_sas: fw state:c0000000
 scsi6 : LSI SAS based MegaRAID driver
 [root@localhost ~]# cat /proc/scsi/scsi
 Attached devices:
 Host: scsi6 Channel: 02 Id: 00 Lun: 00
   Vendor: DELL     Model: PERC  6/i         Rev: 1.11
   Type:    Direct-Access                     ANSI  SCSI revision: 05

查看网卡

 代码如下

复制代码

[root@localhost ~]# lspci | grep -i 'eth'
 05:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network  Connection (rev 01)
 05:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network  Connection (rev 01)

查看21号网络流量

 代码如下

复制代码

# sar -n DEV  -f /var/log/sa/sa21 |grep eth|less

查看板载显示信息

 代码如下

复制代码

[root@localhost ~]# dmidecode |grep -A 5 "On Board Device  Information"
 On Board Device Information
         Type: Video
         Status: Enabled
         Description:  AST2050 VGA

内存槽及内存条:
 

 代码如下

复制代码

# dmidecode |grep -A16 "Memory Device$"


查看cpu型号,主频

 代码如下

复制代码

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
       8  Intel(R) Xeon(R)  CPU             E5410   @ 2.33GHz
 (
看到有8个逻辑CPU,  也知道了CPU型号)
 # cat /proc/cpuinfo | grep physical | uniq -c
       4 physical id      :  0
       4 physical id      :  1
 (说明实际上是两颗4核的CPU)
 # 其实是可能有超线程HT技术,不一定是有4核,也可能是2核4线程。
 # getconf LONG_BIT
    32
 (说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)
 # cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
    8
 (结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)
 完整查看cpu详细信息。
 # dmidecode | grep -A81 'Processor Information'