Chapter 26: System Monitoring

What is System Monitoring? (super simple first)

System monitoring means watching and checking how your Linux computer (or server) is working right now and over time.

You keep an eye on important things like:

  • CPU → how busy is the brain of your computer?
  • Memory (RAM) → is it full? Is something eating too much?
  • Disk → how much space left? Is reading/writing slow?
  • Network → how much internet/download/upload is happening?
  • Processes → which programs are running? Any zombie or hung ones?
  • Temperature (laptops/servers) → is it getting too hot?
  • Logs & errors → any crashes, warnings, failed logins?

Why do we do this?

  • Catch problems before they crash your system (e.g. RAM full → slow → freeze)
  • Find why something is slow (e.g. one bad app using 100% CPU)
  • Know when to buy more RAM / upgrade server
  • Debug why website/app is slow for users
  • Security: spot strange high network or unknown processes

In short: It’s like checking your phone battery + temperature + apps running when it starts lagging.

Linux gives you tons of free built-in commands and nice tools for this – no need to install anything at first!

Main Things We Monitor (the big 5)

  1. CPU – load average (1 min, 5 min, 15 min), % used per core
  2. Memory – used / free / cached / swap
  3. Disk – space used, I/O speed (read/write speed)
  4. Network – bandwidth in/out, connections
  5. Processes – top CPU/memory eaters, number running

1. The Classic – top (start here – try now!)

Bash

What you see:

  • Top lines: load average (e.g. 0.85 0.60 0.45) → lower is better
  • %Cpu(s): us (user), sy (system), id (idle) → high id = good
  • MiB Mem / Swap: total, free, used
  • Tasks: total, running, sleeping, zombie
  • List of processes: PID, USER, %CPU, %MEM, COMMAND

Useful keys inside top:

  • q → quit
  • 1 → show each CPU core separately
  • Shift + P → sort by CPU
  • Shift + M → sort by memory
  • k → kill process (type PID)
  • f → manage fields (add/remove columns)

Most people start with top → then move to better versions.

2. Better than top – htop (install & love it)

Bash

Why better?

  • Colors! Mouse support!
  • Scroll with arrows/mouse
  • Tree view (F5) – see child processes
  • Kill easily (F9)
  • Search process (F3)
  • Setup columns (F2)

Try: run htop → press F2 → Colors → choose nice scheme.

3. Modern & pretty ones (2026 favorites)

Install one of these – very popular now:

Bash

btop looks like a game dashboard – CPU bars, graphs for disk/net.

4. Quick one-line checks (no install needed)

CPU quick look:

Bash

Memory:

Bash

Disk space:

Bash

Disk speed / activity:

Bash

Network:

Bash

Processes:

Bash

5. Live watching (very useful for debugging)

Bash

6. Quick cheat-sheet table (save this!)

What to check Best command What it tells you
Quick overview top or htop CPU, RAM, processes live
Load average uptime 1/5/15 min system busyness
Memory usage free -h Total/used/free RAM + swap
Disk space df -h % used per partition
Big folders/files du -sh ~/* sort -hr
CPU per core mpstat 1 5 (sysstat) Detailed CPU stats
Disk I/O speed iostat -x 1 Read/write KB/s, %util
Network connections ss -tuln or netstat -tuln Listening ports + connections
Pretty dashboard btop or glances Graphs + colors (modern feel)
Temperature (laptop) sensors (lm-sensors package) CPU/GPU temp

7. Real-life examples (Hyderabad developer style)

  • Your web app slow? → htop → see if Node/Python using 100% CPU
  • Server full disk? → df -h → find big /var/log or /home
  • Laptop hot & fan loud? → watch sensors → see temp rise
  • New server setup? → uptime; free -h; df -h; lscpu → quick health check
  • Debugging high traffic? → iftop or nethogs → who eating bandwidth

Practice right now:

  1. Open terminal
  2. Type top → look around → press 1 → q
  3. Install & run htop
  4. Run free -h and df -h
  5. Run watch -n 2 uptime

Tell me what your load average is right now (e.g. 0.45 0.30 0.25) or what process is using most CPU!

Or ask:

  • “How to monitor temperature on my laptop?”
  • “Best tool for network bandwidth live?”
  • “How to set alerts if CPU > 90%?”

We’ll go deeper together! 😄

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *