信息收集

查看OS信息

(1)查看操作系统版本信息,可用下面3个命令进行查询:

命令1,如下:

shell
cat /etc/openEuler-latest

命令2,如下:

shell
cat /etc/os-release

命令3,如下:

shell
cat /etc/openEuler-release

(2)查看内核版本信息

shell
uname -a

查看硬件信息

(1)查看CPU的统计信息

shell
lscpu

(2)查看CPU相关参数

shell
cat /proc/cpuinfo

(3)查看系统内存信息

shell
cat /proc/meminfo

(4)查看内存信息

shell
dmidecode -t memory

(5)查看硬盘和分区分布

shell
lsblk

(6)看硬盘和分区的详细信息

shell
fdisk -l

(7)查看网卡硬件信息

shell
lspci | grep -i 'eth'

(8)查看所有网络接口

shell
ip a ifconfig -a

(9)查看某个网络接口的详细信息

shell
ethtool enp7s0 (以enp7s0为例)

(10)查看pci信息

shell
lspci

(11)查看设备树

shell
lspci -t

(12)查看BIOS信息

shell
[root@openEuler ~]# dmidecode -t bios
# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: EFI Development Kit II / OVMF
        Version: 0.0.0
        Release Date: 02/06/2015
        Address: 0xE8000
        Runtime Size: 96 kB
        ROM Size: 64 kB
        Characteristics:
                BIOS characteristics not supported
                Targeted content distribution is supported
                UEFI is supported\
                System is a virtual machine
        BIOS Revision: 0.0

查看软件信息

(1)查看软件包的详细信息

shell
rpm -qi systemd(以systemd为例)

(2)查看软件包提供的模块

shell
rpm -q --provides  (以systemd为例)

(3)查看所有已安装软件包

shell
rpm -qa (以systemd为例)

(4)查看软件包文件列表

shell
rpm -ql (以python3-rpm为例)

查看OS日志

(1)查看系统启动后的信息和错误日志

shell
cat  /var/log/messages

(2)查看安全相关的日志信息

shell
cat /var/log/secure

(3)查看邮件相关的日志信息

shell
cat /var/log/maillog

(4)查看定时任务相关的日志信息

shell
cat /var/log/cron

(5)查看UUCP和news设备相关的日志信息

shell
cat /var/log/spooler

(6)查看系统启动日志消息

shell
cat /var/log/boot.log