Linux System Monitoring

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What command is used to display active processes as well as CPU and memory usage in real-time?

  • `top` (correct)
  • `mpstat`
  • `uptime`
  • `free`

Which of the following is the primary purpose of system monitoring?

  • To encrypt all network traffic.
  • To automatically update the operating system.
  • To identify bottlenecks, optimize performance, and troubleshoot issues. (correct)
  • To predict future hardware failures.

In the top command, what key is pressed to terminate a process?

  • k (correct)
  • r
  • e
  • q

Which of the following commands provides a better visual representation of system resource usage compared to top?

<p><code>htop</code> (C)</p> Signup and view all the answers

The mpstat command is part of which package?

<p>sysstat (B)</p> Signup and view all the answers

What does the uptime command primarily display?

<p>How long the system has been running and its load average. (A)</p> Signup and view all the answers

Which command is used to check RAM (memory) and swap usage?

<p><code>free</code> (B)</p> Signup and view all the answers

Which command gives a detailed overview of system performance including CPU, memory, swap, disk and process activity?

<p><code>vmstat</code> (A)</p> Signup and view all the answers

You suspect that a particular directory is consuming excessive disk space. Which command would you use to investigate?

<p><code>du</code> (D)</p> Signup and view all the answers

What is the primary function of the df command?

<p>To display the disk space usage on Ubuntu. (C)</p> Signup and view all the answers

To identify disk read/write bottlenecks, which command would be most appropriate?

<p><code>iostat</code> (D)</p> Signup and view all the answers

Which command is used to display active network connections, routing tables and interface statistics?

<p><code>netstat</code> (D)</p> Signup and view all the answers

Which command is considered a faster and more efficient alternative to netstat for displaying network socket information?

<p><code>ss</code> (A)</p> Signup and view all the answers

If you want to monitor the bandwidth usage on a specific network interface in real-time, which tool should you use?

<p><code>iftop</code> (B)</p> Signup and view all the answers

Which command is best suited for displaying the bandwidth usage per process?

<p>nethogs (B)</p> Signup and view all the answers

What is the primary purpose of the journalctl command?

<p>To query and view logs stored in the systemd journal. (A)</p> Signup and view all the answers

Which command is used to continuously monitor log files in real-time?

<p><code>tail -f</code> (D)</p> Signup and view all the answers

To monitor new entries to syslog which command would you use:

<p><code>tail -f /var/log/syslog</code> (D)</p> Signup and view all the answers

After noticing slow system performance, which of the following tools would provide the most comprehensive overview to start diagnosing the issue?

<p><code>vmstat 2 5</code> (D)</p> Signup and view all the answers

A web server is experiencing high traffic. You need to identify which processes are consuming the most network bandwidth. Which command would be most suitable for this task?

<p><code>nethogs</code> (B)</p> Signup and view all the answers

Flashcards

System Monitoring Purpose

Identifies bottlenecks, optimizes performance, and troubleshoots issues in a system.

top command

Displays active processes, CPU, and memory usage in real-time.

htop command

Provides a better visual representation of system resrouce usage.

mpstat command

Monitors CPU usage per core in real-time.

Signup and view all the flashcards

uptime command

Provides a quick summary of how long the system has been running and its load average.

Signup and view all the flashcards

free command

Checks the RAM (memory) and swap usage on a Linux system.

Signup and view all the flashcards

vmstat command

Provides a detailed overview of system performance, including CPU, memory, swap, disk, and process activity.

Signup and view all the flashcards

df command

Displays disk space usage on Ubuntu.

Signup and view all the flashcards

du command

Checks how much disk space directories and files are consuming.

Signup and view all the flashcards

iostat command

Monitors disk performance and analyzes disk read/write speeds.

Signup and view all the flashcards

netstat command

Displays active network connections, routing tables and interface statistics.

Signup and view all the flashcards

ss command

Faster and more efficient alternative to netstat for displaying network socket information.

Signup and view all the flashcards

iftop command

Real-time network monitoring tool that shows bandwidth usage on an interface.

Signup and view all the flashcards

nethogs command

Real-time network monitoring tool that displays the bandwidth usage per process.

Signup and view all the flashcards

journalctl

Command-line utility used to query and view logs stored in the systemd journal.

Signup and view all the flashcards

tail -f command

Continuously monitors log files in real time, watching for new log entries.

Signup and view all the flashcards

Study Notes

  • System monitoring helps with identifying bottlenecks, optimizing performance, and troubleshooting issues.

Monitoring CPU Usage

  • The top command is used for real-time process monitoring.
  • It displays active processes, CPU, and memory usage.
  • Press "q" to exit, "k" to kill a process, and "r" to renice a process in top.
  • The command htop provides a better visual representation of system resource usage.
  • Install htop with sudo apt install htop.
  • The mpstat command is part of the sysstat package.
  • mpstat is used to monitor CPU usage per core in real-time.
  • Use mpstat -P ALL 1 to view all CPU cores.
  • The uptime command provides a quick summary of how long the system has been running and its load average.

Monitoring Memory Usage

  • The free command displays memory statistics.
  • free checks the RAM (memory) and swap usage on a Linux system.
  • Use free -m for output in megabytes.

System Performance Overview

  • The command vmstat (Virtual Memory Statistics) provides a detailed overview of system performance.
  • This includes CPU, memory, swap, disk, and process activity.
  • Use vmstat 2 5 to update every 2 seconds, 5 times.

Monitoring Disk Usage

  • The df (Disk Filesystem) command displays the disk space usage on Ubuntu.
  • Command df -h shows disk usage in human readable format.
  • Command df -h /home shows disk usage for the /home directory.

Directory Disk Usage

  • The du (Disk Usage) command checks how much disk space directories and files are consuming.
  • Command du -sh /home shows the total disk usage for /home in summary format.
  • Command du -h /home shows disk usage for /home in human readable format.
  • Command du -ah /home | sort -rh | head -10 lists the 10 largest files/directories in /home.

Disk I/O Statistics

  • The iostat command monitors disk performance.
  • iostat helps analyze disk read/write speeds, utilization, and performance bottlenecks.
  • Command iostat -dx 1 shows detailed disk I/O statistics, updating every 1 second.

Monitoring Network Usage

  • The netstat (Network Statistics) command displays active network connections, routing tables, and interface statistics and more.
  • The option netstat -tulnp shows listening ports.

Monitoring Socket Statistics

  • The ss command (Socket Statistics) is a faster and more efficient alternative to netstat for displaying network socket information.
  • Use ss -tulnp to show listening ports.

Real-time Network Bandwidth Monitoring

  • The iftop is a real-time network monitoring tool.
  • iftop shows bandwidth usage on an interface by monitoring the traffic between hosts.
  • Use sudo iftop to run command.

Per Process Bandwidth Usage

  • nethogs is also a real-time network monitoring tool
  • nethogs displays the bandwidth usage per process.
  • Use sudo nethogs to run the command.

Monitoring Logs

  • journalctl is the command-line utility used to query and view logs stored in the systemd journal.
  • Use the command journalctl -xe to show logs with explanations and extra details.

Live System Log Monitoring

  • tail -f is a command used to continuously monitor log files in real time.
  • tail -f allows for watching new log entries as they are added.
  • Command tail -f /var/log/syslog monitors the system log file continuously.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Aircraft System Monitoring
3 questions

Aircraft System Monitoring

TimeHonoredSchrodinger avatar
TimeHonoredSchrodinger
Resource Monitoring Chapter 4
7 questions
Backup Software and System Monitoring in Airlines
5 questions
Use Quizgecko on...
Browser
Browser