VPS - Kiểm tra host linux bằng cli

1.  Kiểm tra phần cứng

- Xem thông tin hardware:
   + yum install lshw
   + lshw -short
- Thông tin CPU: cat /proc/cpuinfo hoặc lscpu  
- Kiểm tra thông tin bộ nhớ: cat /proc/meminfo 
- Xem thông tin bộ nhớ RAM và SWAP: free -m
- Xem thông tin ổ cứng, block và disk space:
   + sudo fdisk -l
   + lsblk
   + df -H
- Xem thông tin về không fian sử dụng đĩa: sudo df -h

nguồn: https://nguyentieuhau.wordpress.com/

2. Kiểm tra thông tin host

- Check host information: hostnamectl or uname -r

[root@vm-mycloud4 /]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"

BUG_REPORT_URL="https://bugs.centos.org/"

- Check distribution information:
  + yum install lsb
  + lsb_release -a

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.0.1406 (Core)
Release:        7.0.1406
Codename:       Core


- Version: cat /proc/version hoặc uname -a 
- Hostname: hostname
- List of command relates to the hostname command:

-a, --alias Display the alias name of the host (if used). This option is deprecated and should not be used anymore.
-A, --all-fqdns Displays every FQDN of the machine. This option enumerates all configured network addresses on all configured network interface and translates them to DNS domain names. Addresses that cannot be translated (i.e. because they do not have an appropriate reverse DNS entry) are skipped. Note that different addresses may resolve to the same name, therefore the output may contain duplicate entries. Do not make any assumptions about the order of the output.
-b, --boot Always set a hostname; this allows the file specified by -F to be non-existant or empty, in which case the default hostname localhost will be used if none is yet set.
-d, --domain Display the name of the DNS domain. Don't use the command domainname to get the DNS domain name because it will show the NIS domain name and not the DNS domain name. Use dnsdomainname instead. See the warnings in section The FQDN, and avoid using this option if at all possible.
-f, --fqdn, --long Display the FQDN (Fully Qualified Domain Name). A FQDN consists of a short host name
-F, --file file name Read the host name from the specified file. Comments (lines starting with a `#') are ignored.
-i, --ip-address Display the network address(es) of the host name. Note that this works only if the host name can be resolved. Avoid using this option if at all possible; use hostname --all-ip-addresses instead.
I, --all-ip-addresses Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loopback interface and IPv6 link-local addresses are omitted. Contrary to option -i, this option does not depend on name resolution. Do not make any assumptions about the order of the output.
-s, --short Display the short host name. This is the host name cut at the first dot.
-v, --verbose Be verbose with all output.
-V, --version Print version information on standard output and exit successfully.
-y, --yp, --nis Display the NIS domain name. If a parameter is given (or --file name) then root (the superuser) can also set a new NIS domain
-h, --help


Comments

Popular Posts