如何在 Ubuntu 18.04 上安装 INXI

INXI 是最好的工具之一,它提供了一种简单而全面的方法,可以通过单个命令获取有关服务器的大量信息。

有无数单独的工具和命令可用于从 Linux 系统中收集这些信息。 了解作为 Linux 服务器基础的特定硬件是了解该服务器功能不可或缺的一部分。 在本教程中,我们将介绍在 Ubuntu 18.04 服务器上安装 INXI。 它还将包括 INXI 工具的一些基本命令行用法。

飞行前检查:

  • 该软件的教程基于 Liquid Web Self Managed Ubuntu 18.04 LTS 服务器
  • 我们以 root 用户身份安装软件

安装 INXI

幸运的是,INXI 在基础 Ubuntu 软件包存储库中有一个可用的软件包。 这意味着它可以使用 apt 命令安装。

在开始之前,最好通过运行以下命令来更新系统包:

root@ubuntu:~# apt update -y

更新完成后,通过运行以下命令安装 INXI:

root@ubuntu:~# apt install inxi -y

就是这样! 现在已安装 INXI。 接下来,使用 INXI!

使用 INXI

INXI 有大量不同的标志,可以提供有关底层系统的非常具体的信息。 首先,我们将运行不带标志的 INXI 以获取一些基本信息:

root@ubuntu:~# inxi
CPU~Single core Intel Core i5 750 (-UP-) speed~2666 MHz (max) Kernel~4.15.0-91-generic x86_64 Up~68 days Mem~354.8/1594.2MB HDD~244.8GB(1.9% used) Procs~89 Client~Shell inxi~2.3.56

输出提供有关系统 CPU、内核、正常运行时间、内存、硬盘驱动器使用和容量以及 INXI 版本的信息。

有用的标志:

中央处理器信息

-C 标志提供有关服务器 CPU 的基本信息。

root@ubuntu:~# inxi -C
CPU: Single core Intel Core i5 750 (-UP-) cache: 8192 KB speed: 2666 MHz (max)

系统正常运行时间/当前进程

-I 标志提供有关服务器正常运行时间、当前使用的内存以及我们正在使用的 shell 类型的信息。

root@ubuntu:~# inxi -I
Info:      Processes: 100 Uptime: 4d 2h 44m Memory: 1.81 GiB used: 355.4 MiB (19.2%) Init: systemd runlevel: 5
           Shell: bash inxi: 3.0.38

磁盘信息

-d 标志向我们显示有关光驱的信息。 它为我们提供了与 -Dd 标志相同的信息。 我们还可以使用 -x,它在输出中添加额外的特征行。 这也将告诉我们是否存在任何软盘。 目前,没有办法获得我所知道的有关软盘设备的任何信息,因此它只会显示
软盘ID,没有任何额外的数据。 -xx 添加了更多功能。

root@ubuntu:~# inxi -d
Drives:    Local Storage: total: 40.00 GiB used: 2.36 GiB (5.9%)
           ID-1: /dev/vda model: N/A size: 40.00 GiB
           Optical-1: /dev/sr0 vendor: QEMU model: QEMU DVD-ROM dev-links: cdrom,dvd
           Features: speed: 4 multisession: yes audio: yes dvd: yes rw: none

网络信息

-n 标志向我们显示高级网卡信息。 使用 -Nn 标志可以获得相同的信息。 这向我们展示了接口、速度、mac 地址、id、状态等。

root@ubuntu:~# inxi -n
Network:   Device-1: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: N/A
           Device-2: Red Hat Virtio network driver: virtio-pci
           IF: eth0 state: up speed: -1 duplex: unknown mac: 52:54:00:ab:0d:04
root@ubuntu:~# 

聚合基本系统信息

-b 标志向我们展示了一个基本的短格式输出,(以前的 -d 标志用于此)。 这和跑步一样 印西-v2

root@host:~# inxi -b
System:    Host: host.BYNSS.ninja Kernel: 5.4.0-14-generic x86_64 bits: 64 Console: tty 1
           
Distro: Ubuntu 20.04 LTS (Focal Fossa)

Machine:   Type: Kvm System: QEMU product: Standard PC (i440FX + PIIX, 1996) v: pc-i440fx-2.2 serial: N/A

Mobo: N/A model: N/A serial: N/A BIOS: SeaBIOS v: rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org date: 04/01/2014

CPU:       2x Single Core: Intel Xeon E5-1650 v4 type: SMP speed: 3600 MHz

Graphics:  Device-1: driver: N/A

Display: server: No display server data found. Headless machine? tty: 120x30

Message: Advanced graphics data unavailable in console for root.

Network:   Device-1: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: N/A

Device-2: Red Hat Virtio network driver: virtio-pci

Drives:    Local Storage: total: 40.00 GiB used: 2.36 GiB (5.9%)

Info:      Processes: 95 Uptime: 4d 3h 53m Memory: 1.81 GiB used: 356.7 MiB (19.2%) Init: systemd runlevel: 5

Shell: bash inxi: 3.0.38

可能最有用的标志是 -h 标志,因为它枚举了 INXI 选项提供的所有不同标志,以及标志提供的信息类型。

root@ubuntu:~# inxi -h

我们的最后一个标志“––recommends”检查应用程序依赖项和各种目录,并显示我们需要安装哪些包以添加对给定功能的支持。

root@host:~# inxi --recommends
inxi will now begin checking for the programs it needs to operate.

Check inxi --help or the man page (man inxi) to see what options are available.
----------------------------------------------------------------------------

Test: core tools:

Perl version:  5.030000
Current shell: bash 5.0.16
Default shell: bash
sh links to: /usr/bin/dash
Package manager: apt
----------------------------------------------------------------------------

Test: required system directories:

/proc: ..............................................................Present
/sys: ...............................................................Present

All required system directories are present
----------------------------------------------------------------------------

Test: recommended system programs:

Note: IPMI sensors are generally only found on servers. To access that data, you only need one of the ipmi items.

blockdev: --admin -p/-P (filesystem blocksize) .....................................................................Present
dig: -i wlan IP .....................................................................Present
dmidecode: -M if no sys machine data; -m .....................................................................Present
fdisk: -D partition scheme (fallback) .....................................................................Present
file: -o unmounted file system (if no lsblk) .....................................................................Present
hddtemp: -Dx show hdd temp .....................................................................Present
ifconfig: -i ip LAN (deprecated) .....................................................................Present
ip: -i ip LAN .....................................................................Present
ipmitool: -s IPMI sensors (servers) .....................................................................Missing
ipmi-sensors: -s IPMI sensors (servers) .....................................................................Missing
lsblk: -o unmounted file system (best option) .....................................................................Present
lsusb: -A usb audio; -N usb networking; --usb (optional) .....................................................................Present
modinfo: Ax; -Nx module version .....................................................................Present
runlevel: -I fallback to Perl .....................................................................Present
sensors: -s sensors output .....................................................................Present
smartctl: -Da advanced data .....................................................................Missing
strings: -I sysvinit version .....................................................................Missing
sudo: -Dx hddtemp-user; -o file-user .....................................................................Present
tree: --debugger 20,21 /sys tree .....................................................................Present
upower: -sx attached device battery info .....................................................................Missing
uptime: -I uptime .....................................................................Present

The following recommended system programs are missing:
Program: ipmitool ~ Install package: ipmitool
Program: ipmi-sensors ~ Install package: freeipmi-tools
Program: smartctl ~ Install package: smartmontools
Program: strings ~ Install package: binutils
Program: upower ~ Install package: upower
----------------------------------------------------------------------------

Test: recommended display information programs:

glxinfo: -G glx info .....................................................................Present
wmctrl: -S active window manager (fallback) .....................................................................Missing
xdpyinfo: -G multi screen resolution .....................................................................Present
xprop: -S desktop data .....................................................................Present
xrandr: -G single screen resolution .....................................................................Present

The following recommended display information programs are missing:
Program: wmctrl ~ Install package: wmctrl
----------------------------------------------------------------------------

Test: recommended downloader programs (You only need one of these):

Perl HTTP::Tiny is the default downloader tool if IO::Socket::SSL is present. See --help --alt 40-44 options for how to override default downloader(s) in case of issues.

If dig is installed, it is the default for WAN IP data. Strongly recommended. Dig is fast and accurate.

curl: -i (if no dig); -w,-W; -U .....................................................................Present
dig: -i wlan IP .....................................................................Present
wget: -i (if no dig); -w,-W; -U .....................................................................Present

All recommended downloader programs are present
----------------------------------------------------------------------------

Test: recommended Perl modules (Optional):

None of these are strictly required, but if you have them all, you can eliminate some recommended non Perl programs from the install.

HTTP::Tiny and IO::Socket::SSL must both be present to use as a downloader option. For json export Cpanel::JSON::XS is preferred over JSON::XS.

HTTP::Tiny: -U; -w,-W; -i (if dig not installed) .....................................................................Present
IO::Socket::SSL: -U; -w,-W; -i (if dig not installed) .....................................................................Missing
Time::HiRes: -C cpu sleep (not required); --debug timers .....................................................................Present
Cpanel::JSON::XS: --output json - required for export .....................................................................Missing
JSON::XS: --output json - required for export (legacy) .....................................................................Missing
XML::Dumper: --output xml - Crude and raw .....................................................................Missing
Net::FTP: --debug 21,22 .....................................................................Present

The following recommended Perl modules are missing:
Perl Module: IO::Socket::SSL ~ Install package: libio-socket-ssl-perl
Perl Module: Cpanel::JSON::XS ~ Install package: libcpanel-json-xs-perl
Perl Module: JSON::XS ~ Install package: libjson-xs-perl
Perl Module: XML::Dumper ~ Install package: libxml-dumper-perl
----------------------------------------------------------------------------

Test: recommended directories:

/dev: -l,-u,-o,-p,-P,-D disk partition data .....................................................................Present
/dev/disk/by-id: -D serial numbers .....................................................................Present
/dev/disk/by-label: -l,-o,-p,-P partition labels .....................................................................Present
/dev/disk/by-path: -D extra data .....................................................................Present
/dev/disk/by-uuid: -u,-o,-p,-P partition uuid .....................................................................Present
/sys/class/dmi/id: -M system, motherboard, bios .....................................................................Present

All recommended directories are present
----------------------------------------------------------------------------

Test: recommended files:

Note that not all of these are used by every system, so if one is missing it's usually not a big deal.

/etc/lsb-release: -S distro version data (older version) .....................................................................Present
/etc/os-release: -S distro version data (newer version) .....................................................................Present
/proc/asound/cards: -A sound card data .....................................................................Missing
/proc/asound/version: -A ALSA data .....................................................................Missing
/proc/cpuinfo: -C cpu data .....................................................................Present
/proc/mdstat: -R mdraid data (if you use dm-raid) .....................................................................Present
/proc/meminfo: -I,-tm, -m memory data .....................................................................Present
/proc/modules: -G module data (sometimes) .....................................................................Present
/proc/mounts: -P,-p partition advanced data .....................................................................Present
/proc/scsi/scsi: -D Advanced hard disk data (used rarely) .....................................................................Present
/var/log/Xorg.0.log: -G graphics driver load status .....................................................................Missing

The following recommended files are missing:
File: /proc/asound/cards
File: /proc/asound/version
File: /var/log/Xorg.0.log
----------------------------------------------------------------------------
Ok, all done with the checks. Have a nice day.

root@host:~#

结论

INXI 是一种快速查找有关 Linux 系统的大量信息的方法。 它易于安装和使用,对于任何系统管理员来说都是一个可行的工具。

给我们打电话 800.580.4985,或打开 聊天 或与我们联系,与我们知识渊博的解决方案或经验丰富的托管顾问之一交谈,了解您今天如何利用此软件!