Information Collection

Querying OS Information

  1. Query the OS version by running either of the following commands.

    1. cat /etc/openEuler-latest
      Output:

      text
      openeulerversion=openEuler-22.03-LTS-SP4
      compiletime=2022-12-27-22-15-04
      gccversion=10.3.1-20
      kernelversion=5.10.0-136.12.0.86.oe2203SP3
      openjdkversion=1.8.0.352.b08-3.oe2203SP3
    2. cat /etc/os-release
      Output:

      text
      NAME="openEuler"
      VERSION="22.03 (LTS-SP4)"
      ID="openEuler"
      VERSION_ID="22.03"
      PRETTY_NAME="openEuler 22.03 (LTS-SP4)"
      ANSI_COLOR="0;31"
    3. cat /etc/openEuler-release
      Output:

      text
      openEuler release 22.03 (LTS-SP4)
  2. Query the kernel version.

    shell
    uname -a

    Output:

    text
    Linux localhost 5.10.0-136.12.0.86.oe2203SP3.x86_64 #1 SMP Tue Dec 27 17:50:15 CST 2022 x86_64 x86_64 x86_64 GNU/Linux

Querying Hardware Information

  1. Query CPU statistics.

    shell
    lscpu

    en-us_image_0000001387692269

  2. View CPU parameters.

    shell
    cat /proc/cpuinfo

    en-us_image_0000001387293085

  3. View system memory information.

    shell
    cat /proc/meminfo

    en-us_image_0000001387692893

  4. View memory information.

    shell
    dmidecode -t memory

    en-us_image_0000001337053248

  5. View hard drive and partition distribution.

    shell
    lsblk

    en-us_image_0000001387413509

  6. View details about hard drives and partitions.

    shell
    fdisk -l

    en-us_image_0000001337533690

  7. View NIC information.

    shell
    lspci | grep -i 'eth'

    en-us_image_0000001387413793

  8. View all network interfaces.

    shell
    ip a or ifconfig -a

    en-us_image_0000001387855149

  9. View details about a network interface.

    shell
    ethtool enp7s0 (enp7s0 is used as an example.)

    en-us_image_0000001387415629

  10. View PCI information.

    shell
    lspci

    en-us_image_0000001337696078

  11. View the device tree.

    shell
    lspci -t

    en-us_image_0000001337536842

  12. View BIOS information.

    shell
    dmidecode -t bios

    en-us_image_0000001387857005

Querying Software Information

  1. Query details about a software package.

    shell
    rpm -qi (systemd is used as an example.)

    en-us_image_0000001387755969

  2. View the modules provided by a software package.

    shell
    rpm -q --provides # (systemd is used as an example.)
    text
    /bin/systemctl
    /sbin/shutdown
    config(systemd) = 249-43.oe2203SP3
    libsystemd-shared-249.so()(64bit)
    libsystemd-shared-249.so(SD_SHARED)(64bit)
    pkgconfig(systemd) = 249
    pkgconfig(udev) = 249
    syslog
    system-setup-keyboard = 0.9
    systemd = 249-43.oe2203SP3
    systemd(x86-64) = 249-43.oe2203SP3
    systemd-rpm-config
    systemd-sysv = 206
    systemd-units = 249-43.oe2203SP3
  3. View all installed software packages.

    shell
    rpm -qa # (systemd is used as an example.)
    text
    systemd-help-249-43.oe2203SP3.noarch
    systemd-libs-249-43.oe2203SP3.x86_64
    systemd-249-43.oe2203SP3.x86_64
    systemd-udev-249-43.oe2203SP3.x86_64
  4. View the list of software packages.

    shell
    rpm -ql # (python3-rpm is used as an example.)

    en-us_image_0000001387780357

Viewing OS Logs

  1. View the information and error logs after the system is started.

    shell
    cat  /var/log/messages

    en-us_image_0000001388020197

  2. View the security-related logs.

    shell
    cat /var/log/secure

    en-us_image_0000001337580216

  3. View the email-related logs.

    shell
    cat /var/log/maillog

    en-us_image_0000001337740252

  4. View the logs related to scheduled tasks.

    shell
    cat /var/log/cron

    en-us_image_0000001337420372

  5. View the logs related to UUCP and news devices.

    shell
    cat /var/log/spooler

    en-us_image_0000001337260780

  6. View system startup logs.

    shell
    cat /var/log/boot.log

    en-us_image_0000001337740540