Linux 服務器配置信息查詢方法,國產化申威服務器配置信息查看演示

第一章:常用命令

① 顯示服務器信息

通過 dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product" 命令可以顯示服務器信息。
申威服務器沒查出來,其它服務器可用,下面這個是飛騰服務器的。

root@compute9:/opt/dmdbms/tool# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product"
        Manufacturer: GreatWall
        Product Name: 擎天DF720

下面這個是泰山服務器的

[root@taishan-kylinosv10-18 yonyou_nc]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product"
        Manufacturer: Huawei
        Product Name: TaiShan 2280 V2

② 顯示操作系統信息

通過 uname -a 命令可以顯示操作系統信息。

root@sw6a:~# uname -a
Linux sw6a 4.4.15-deepin-aere #176 SMP Thu Dec 19 17:36:51 CST 2019 sw_64 GNU/Linux

③ 顯示CPU相關信息

通過 cat /proc/cpuinfo 命令可以顯示 CPU 相關信息。

root@sw6a:~# cat /proc/cpuinfo
cpu                     : sw
cpu model               : sw
cpu variation           : 1
cpu revision            : SW6A
cpu serial number       :
system type             : Aere
system variation        : Aere
system revision         : 0
system serial number    :
CPU frequency [MHz]     : 1600.00
cpu MHz : 1600.00
page size [bytes]       : 8192
phys. address bits      : 48
BogoMIPS                : 3200.00
kernel unaligned acc    : 0 (pc=0,va=0)
user unaligned acc      : 11024109263 (pc=120e79c00,va=2000151a666)
platform string         : N/A
cpus detected           : 16
cpus active             : 16
cpu active mask         : 000000000000ffff
cpus core_start         : 000000000000ffff
L1 Icache               : 32K, 4-way, 128b line
L1 Dcache               : 32K, 4-way, 128b line
L2 cache                : 512K, 8-way, 128b line
L3 cache                : 32768K, 8-way, 128b line

④ 顯示磁盤使用情況

通過 df -h 命令可以顯示磁盤使用情況。

root@sw6a:~# df -h
文件系統        容量  已用  可用 已用% 掛載點
udev             63G     0   63G    0% /dev
tmpfs            13G   25M   13G    1% /run
/dev/sda2        99G   32G   63G   34% /
tmpfs            63G     0   63G    0% /dev/shm
tmpfs           5.0M     0  5.0M    0% /run/lock
tmpfs            63G     0   63G    0% /sys/fs/cgroup
/dev/sda1       232M   60M  161M   27% /boot
tmpfs            13G  8.0K   13G    1% /run/user/110
tmpfs            13G   72K   13G    1% /run/user/0
tmpfs            13G     0   13G    0% /run/user/1001

⑤ 顯示網卡信息

通過 ethtool eth0 命令可以顯示網卡相關信息。

root@sw6a:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes

⑥ 顯示centos版本信息

通過 cat /etc/issue 命令可以顯示 centos 版本信息。

root@sw6a:~# cat /etc/issue
deepin GNU/Linux 15 \n \l

⑦ 顯示磁盤分區情況

通過 fdisk -l 命令可以顯示磁盤分區情況。

root@sw6a:~# fdisk -l
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: EB619DDD-154F-4C5F-8F8E-A3398071DD57

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    499711    497664   243M Linux filesystem
/dev/sda2     499712 212082687 211582976 100.9G Linux filesystem
/dev/sda3  212082688 468860927 256778240 122.5G Linux swap

⑧ 顯示內存相關信息

通過 cat /proc/meminfo 命令可以顯示內存相關信息。

root@sw6a:~# cat /proc/meminfo
MemTotal:       131469720 kB
MemFree:        95030168 kB
MemAvailable:   119071160 kB
Buffers:         1539048 kB
Cached:         21550632 kB
SwapCached:            0 kB
Active:         31452832 kB
Inactive:        3369336 kB
Active(anon):   11738056 kB
Inactive(anon):    26504 kB
Active(file):   19714776 kB
Inactive(file):  3342832 kB
Unevictable:          32 kB
Mlocked:              32 kB
SwapTotal:      128389112 kB
SwapFree:       128389112 kB
Dirty:               240 kB
Writeback:             0 kB
AnonPages:      11732696 kB
Mapped:           364904 kB
Shmem:             32040 kB
Slab:            1239864 kB
SReclaimable:    1155200 kB
SUnreclaim:        84664 kB
KernelStack:       12496 kB
PageTables:        34520 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    194123968 kB
Committed_AS:   41329400 kB
VmallocTotal:    8388608 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       8192 kB

⑨ 顯示可用塊設備情況

通過 lsblk 命令可以顯示可用塊設備情況。

root@sw6a:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 223.6G  0 disk
├─sda1   8:1    0   243M  0 part /boot
├─sda2   8:2    0 100.9G  0 part /
└─sda3   8:3    0 122.5G  0 part [SWAP]

第二章:獲取更多信息

① 顯示開機相關信息

通過 dmesg | more 命令可以顯示開機信息,裏面會包含開機過程中所有內核可以檢測到的驅動和設備信息,常用該命令來檢測系統故障。

root@sw6a:~# dmesg | more
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.15-deepin-aere (deepin@node1) (SWREACH GCC5.3.0-54 (20181101)
) #176 SMP Thu Dec 19 17:36:51 CST 2019
[    0.000000] Setup arch sys_type = 0x37, hwrpb->cpuid:0xb,hwrpb = 0xfffffc0000820000
[    0.000000] hwrpb->revision = 0x0.
[    0.000000] sw_mv.vector_name = sw.
[    0.000000] Booting on Aere variation Aere using machine vector sw
[    0.000000] Major Options: SMP LEGACY_START DISCONTIGMEM NUMA MAGIC_SYSRQ
[    0.000000] Command line: quiet splash net.ifnames=0 audit=0 apparmor=0 root=UUID=0d170bfd-
f28e-4ba8-96a4-195abcb3a5ae
[    0.000000] Raw memory layout:
[    0.000000]  memcluster  0, usage 0, start     1144, end  4194304
[    0.000000]  memcluster  1, usage 0, start  4195448, end  8388608
[    0.000000]  memcluster  2, usage 0, start  8389752, end 12582912
[    0.000000]  memcluster  3, usage 0, start 12584056, end 16777216
[    0.000000] Initializing bootmem allocator on Node ID 0
[    0.000000]  memcluster  0, usage 0, start     1144, end  4194304
[    0.000000]  Detected node memory:   start     1144, end  4194304
[    0.000000]  freeing pages 1144:4194304
[    0.000000] Initializing bootmem allocator on Node ID 1
[    0.000000]  memcluster  1, usage 0, start  4195448, end  8388608
[    0.000000]  Detected node memory:   start  4195448, end  8388608
[    0.000000]  freeing pages 4195448:8388608
[    0.000000] Initializing bootmem allocator on Node ID 2
[    0.000000]  memcluster  2, usage 0, start  8389752, end 12582912
[    0.000000]  Detected node memory:   start  8389752, end 12582912
[    0.000000]  freeing pages 8389752:12582912
[    0.000000] Initializing bootmem allocator on Node ID 3
[    0.000000]  memcluster  3, usage 0, start 12584056, end 16777216
[    0.000000]  Detected node memory:   start 12584056, end 16777216
[    0.000000]  freeing pages 12584056:16777216
[    0.000000] reserved pages for pcie memory space 458752:524288
--More--

② 顯示詳細硬件信息

通過 dmidecode | more 命令可以顯示各硬件的詳細信息。

[root@taishan-kylinosv10-18 proc]# dmidecode | more
# dmidecode 3.1
Getting SMBIOS data from sysfs.
SMBIOS 3.1.1 present.
Table at 0x2FC60000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: Huawei Corp.
        Version: 0.86
        Release Date: 07/17/2019
        Address: 0x5F000
        Runtime Size: 644 kB
        ROM Size: 6144 kB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 kB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                8042 keyboard services are supported (int 9h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 0.0

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Huawei
        Product Name: TaiShan 2280 V2
--More--

喜歡的點個贊❤吧!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章