Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i only need the logs to track down and fix issues on a Linux machine. Introducti

ID: 3902889 • Letter: I

Question

i only need the logs to track down and fix issues on a Linux machine.

Introduction

In this lab, you'll use logs to help you troubleshoot and track down an issue. As an IT Support Specialist, it's crucial that you know how to troubleshoot and "follow the cookie crumbs." There are five different issues that you'll need to resolve, using the skills you've learned so far in this course.

Head's up: You'll experience a delay as the labs initially load (particularly for Windows labs). So, please wait a couple of minutes for the labs to load. Please also make sure to access the labs directly through Coursera and not in the Qwiklabs catalog. If you access the labs through the Qwiklabs catalog, you will *not* receive a grade. (As you know, a passing grade is required to matriculate through the course.) The grade is calculated when the lab is complete, so be sure to hit "End Lab" when you're done!

You'll have 60 minutes to complete this lab.

The scenario

Your computer is having some issues, and you can't seem to figure out what's wrong. Argh! Dig through the logs to figure out how to fix these issues.

You'll use logs to identify issues on a Linux VM, which you'll then fix using the knowledge you've gained from the other labs that you've completed.

What you should already know

This lab focuses on looking at logs that indicate issues that need to be fixed. These issues can be resolved using the skills you've gained in previous labs, so detailed instructions won't be included here. You're on your own...but you've got this!

Here are the concepts you need to be familiar with before taking this lab:

Updating software that's out-of-date

Finding and deleting files

Modifying file permissions

Finding and terminating specific processes

Go ahead and connect to the linux-instance Google Cloud instance now. As a reminder, your machines are available in Google Cloud Console under Compute Engine -> VM instances. If you are having difficulty connecting to your instance, no worries! Just follow the steps outlined in the Accessing Qwiklabs reading for detailed instructions on how to connect.

Viewing logs on Linux

On Linux machines, logs are stored in the /var/log directory. There are lots of log files in this directory, and you can view them with this command:

We're interested in syslog for the moment. The logs on Linux can be viewed like any text file; you can use the command below to view the contents of syslog:

The log contents are super long, so you'll have to scroll through the logs to look for the five entries that are relevant to this lab. The logs are entered chronologically, and the logs that you'll need to fix should be timestamped around the time that the lab started. For convenience, all of the log entries you need to fix contain the phrase "Qwiklab Error". Knowing this, you could also filter out the relevant labs using the grep command.

We'll walk through addressing one of the log's issues, then the other four will be up to you!

Low disk space!

Here's the log entry we will be dealing with first:

This error indicates that your computer is running out of memory due to a super large file. Unfortunately, it doesn't indicate which file is causing the problem, so you'll need to find it. Luckily, Linux has an easy way to find the largest files on your file system. The du command can be used to list all files in a directory (recursively through subdirectories, too), which you can sort by size to find the largest files. By piping the output of du (using the "|" symbol) to the sort command, you can sort the output by file size. The "-n" and "-r" flags tell sort to treat the string output on each line as a number (the file size), and to sort in reverse order so that the largest files are listed first. By piping the output of this into the head command, you can print out only the top few results (you can specify how many to output by adding "-n [NUMBER]" to the end of the command).

The command below uses du, sort, and head to show the top five largest files, starting from your /home directory:

You can see that the largest file in your home directory is /home/lab/storage/ultra_mega_large.txt, at about 5GB. This isn't an important file, but it's taking up a lot of space, so you can delete it to fix the disk space error:

Now that the large file is gone, this log's issue has been dealt with. You can see that the log entry is still present in the log file; logs aren't deleted once the errors that caused them are resolved.

The remaining log entries

The rest of the logs involve issues that you should already know how to fix. Good luck!

gapstaging7084 student@linux-instance: ls /var/log apt auth.log cloud-init.log dist-upgrade gopstaging7084 studentelinux-instance:~$ btmp cloud-init-output.log dpkq.log kern.log 1xd syslog wtmp fsck lastlog ntpstats unattended-upgrades

Explanation / Answer

Solution: -

Problem Statement: -

From the given scenario, I understood that there are some issues with the linux VM which includes, issues like disk utilization issues, memory issues, load average issues for which it needs to narrow down throughout the Linux VM.

Troubleshooting steps: -