Administering Linux Systems: Software, Logging, and Hardware Essentials

Managing Software Packages with YUM

Linux applications are frequently installed under the /usr/local hierarchy. Configuring a reliable mirror significantly improves download speeds and stability.

To replace the default repository with Alibaba Cloud's CentOS mirror, execute:

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

A foundational set of tools can be deployed with a single command. The bash-completion package is particularly useful for auto-completing flags and arguments for many commands.

yum install -y vim tree wget net-tools nmap bash-completion

The Extra Packages for Enterprise Linux (EPEL) repository provides access to a wide array of additional software. The following command sets up the EPEL mirror from Alibaba Cloud:

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

After enabling EPEL, you can install and run some whimsical packages to verify it works correctly:

yum install sl cowsay -y

sl      # Displays an ASCII steam locomotive animation
cowsay "Hello from server-01"  # A talking cow

Interpreting Critical System Logs

The /var/log/ directory stores vital records for system diagnostics. Two primary files are messages and secure.

  • messages: Captures service startup messages, runtime status, and general system errors.
  • secure: Contains authentication logs, including all user login attempts. This file is essential for monitoring for brute-force attacks by checking for excessive failed login records.

Inspecting the secure log reveals detailed login events:

cat /var/log/secure

Each entry typically provides:

  1. The timestamp of the connection.
  2. The originating hostname or IP adress.
  3. The authentication method (e.g., SSH).
  4. The outcome, which may show an Accepted entry for a successful login or a Failed entry for a rejected attempt.

Querying Hardware Ifnormation

Several utilities expose the server's physical characteristics. These can be accessed by reading virtual filesystems or using dedicated commands.

CPU Details

The kernel exposes processor details via the /proc/cpuinfo pseudo-file.

cat /proc/cpuinfo

Key fields include:

  • model name: The CPU's brand and model.
  • physical id: A unique identifier for each physical socket.
  • processor: An identifier for each logical core.
  • cpu cores: The number of physical cores within a single socket.

For example, if a file contains two distinct physical id values (e.g., 0 and 1) and each physical id has two associated processor values, then the server has two physical CPUs (2-socket), each with two cores, for a total of 4 logical cores.

A clearer summary is provided by the lscpu command:

lscpu

The output maps directly to the fields above:

  • Socket(s): Total physical CPU packages.
  • Core(s) per socket: Physical cores inside each package.
  • CPU(s): The total number of logical processing units (threads) on the entire system.

System Load

The load average represents the number of processes contending for CPU time. The file /proc/loadavg reports three values.

cat /proc/loadavg

These three numbers are the 1-minute, 5-minute, and 15-minute load averages. A common heuristic is that a load equal to the total CPU core count indicates a fully saturated system.

  • For a 4-core server, a sustained load near 3 warrants attention.
  • For a 128-core database server, a load of around 100 may be typical under heavy operation.

Alternatively, the w command also prints the load average along with logged-in users.

w

Memory Information

Memory statistics can be read from /proc/meminfo:

cat /proc/meminfo

Notable fields include:

  • MemTotal: Total physical RAM.
  • MemFree: Unused RAM.
  • MemAvailable: An estimate of RAM available for new processes, considering reclaimable caches.
  • Cached: Memory used for page cache.
  • Buffers: Memory used for kernel buffers.
  • SwapCached: Memory that was swapped out but is currently cached in swap.

A human-friendly summary is obtained with free:

free -h

Disk and Mount Points

To see which filesystem are currently mounted, inspect the mount table:

cat /proc/mounts

A more concise and readable overview of disk usage per mount point is:

df -h

Checking the Operating System Version

Identify the Linux distribution and kernel release with these standard commands:

cat /etc/redhat-release
uname -a

Tags: Linux Administration YUM package management system logging hardware monitoring command-line tools

Posted on Fri, 15 May 2026 02:15:15 +0000 by kristian_gl