44,39 €
Red Hat Enterprise Linux is an operating system that allows you to modernize your infrastructure, boost efficiency through virtualization, and finally prepare your data center for an open, hybrid cloud IT architecture. It provides the stability to take on today's challenges and the flexibility to adapt to tomorrow's demands.
In this book, you begin with simple troubleshooting best practices and get an overview of the Linux commands used for troubleshooting. The book will cover the troubleshooting methods for web applications and services such as Apache and MySQL. Then, you will learn to identify system performance bottlenecks and troubleshoot network issues; all while learning about vital troubleshooting steps such as understanding the problem statement, establishing a hypothesis, and understanding trial, error, and documentation. Next, the book will show you how to capture and analyze network traffic, use advanced system troubleshooting tools such as strace, tcpdump & dmesg, and discover common issues with system defaults.
Finally, the book will take you through a detailed root cause analysis of an unexpected reboot where you will learn
to recover a downed system.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 665
Veröffentlichungsjahr: 2015
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2015
Production reference: 1131015
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-355-0
www.packtpub.com
Author
Benjamin Cane
Reviewers
Brian C Galura
Deepak G Kulkarni
Warren Myers
Siddhesh Poyarekar
Commissioning Editor
Nadeem Baghban
Acquisition Editor
Reshma Raman
Content Development Editor
Mamata Walkar
Technical Editor
Ryan Kochery
Copy Editors
Tani Kothari
Merilyn Pereira
Project Coordinator
Shipra Chawhan
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Benjamin Cane has nearly 10 years of experience in Linux systems administration. His first systems administration role was in 2006. At that time, he worked for a web hosting company supporting thousands of FreeBSD and Linux systems.
Afterwards, he joined a managed services company that specialized in managing mission-critical systems. There, he worked his way to the position of a lead systems engineer, providing 24x7 support for highly critical enterprise systems that ran Red Hat Enterprise Linux.
Now, Benjamin is a systems architect. He focuses on building High and Continuous Availability environments within the financial services industry. He is also currently a Red Hat Certified Engineer and Certified Ethical Hacker.
With his experience in mission-critical environments, he has learned to identify and troubleshoot very complex issues quickly, because often these environments have a low tolerance for downtime. Being able to identify the root causes of very complex systems issues quickly is a skill that requires extensive knowledge of Linux and troubleshooting best practices.
In addition to this book, Benjamin writes about Linux systems administration and DevOps topics on his blog at http://bencane.com. He is also the project founder for Runbook (https://github.com/Runbook/runbook), an open source application designed to monitor and automatically resolve infrastructure and application issues.
Brian C Galura spent his childhood tinkering with subjects such as Java programming and Linux; his professional experience started with VoIP testing at 3Com in suburban Chicago. He then spent two years studying computer engineering at Purdue University before leaving to pursue freelance consulting in Los Angeles.
Following several years of freelancing, he developed his expertise in enterprise infrastructure and cloud computing by working for a variety of start-ups and large corporations. Later, he completed a bachelor's in IT while working at Citrix. Brian is currently working on Citrix's cloud engineering and systems architecture team in Santa Barbara, California.
Deepak G Kulkarni has around 10 years of experience in software engineering including nine years of strong experience in product development using C/C++/Java.
He has over four years of experience in JUnit, Core JAVA, Web Services, XML, Spring, Spring MVC, and Hibernate. He also has extensive software development experience using C/C++ on UNIX (HP-UX) and Sun-Solaris, shell scripting, and STL (Standard Template Library) and cross-platform development. Deepak also has over two years of experience in the Mac OS using Objective C/C++, Cocoa framework, Xcode, and MetroWorks IDE.
Deepak has a working knowledge of Perl/SNMP/TCP/IP, OS Internals, web services, XML, XSD, database (Oracle)/IPC (inter process communication)/system calls/Pro*C. He has been exposed to UML / use case diagrams / class diagrams / sequence diagrams / activity diagrams / state diagrams, IBM Rational Rose, and Design Patterns (GoF Patterns) / Design Principles. He has hands-on experience with Ant, Maven, JUnit, JProfiler, JProbe, JSON, Servlets, Python, and Ruby on Rails, as well as experience in remote service calls and client server programming.
Warren Myers has been a professional data center and cloud automation architect for over eight years, with exposure to dozens of platforms, scores of customers, and hundreds of interesting problems.
He was a reviewer on Raspberry Pi Server Essentials and wrote the freely-available e-book, Debugging and Supporting Software Systems (http://cnx.org/contents/[email protected]:1/Debugging_and_Supporting_Softw).
Siddhesh Poyarekar has been a free and open source software programmer for over seven years and has worked on a variety of projects beginning with writing his own dialer program for an ISP that did not have a UI-based dialer for Linux. He spent a number of years troubleshooting problems in various domains from the Linux desktop, shell, and the kernel to the core system runtime on Linux systems, that is, the GNU C Library for which he is now a maintainer.
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
This book is dedicated to my wife Ruby and our two sons Ethan and Jacob. Ruby, without your love and support I would have never been able to write this book. Thank you for putting up with the long hours and sleepless nights while trying to complete this.
Red Hat Enterprise Linux is a widely popular Linux distribution that is used in everything from Cloud to enterprise mainframe computers. If you include downstream distributions such as CentOS, the adoption of the Red Hat Enterprise Linux distribution is even greater.
As with most things, there is always someone responsible for resolving issues with all of these various systems running Red Hat Enterprise Linux. Red Hat Enterprise Linux Troubleshooting Guide is written to provide basic to advanced troubleshooting practices and commands for Linux systems, with these troubleshooting techniques specifically focused on systems running Red Hat Enterprise Linux.
This book is designed to provide you with steps and the knowledge required to remedy a wide variety of scenarios. The examples in this book use real-world issues with real-world resolutions.
While the examples in this book are situational, this book can also be used as a reference for Linux-related topics and commands. They provide the reader with the ability to reference both troubleshooting steps and specific commands to resolve complex issues.
Chapter 1, Troubleshooting Best Practices, covers the troubleshooting process at a high level. By equating the troubleshooting process with the scientific method, this book will explain how to break down a problem to identify the root cause, no matter how complicated the problem.
Chapter 2, Troubleshooting Commands and Sources of Useful Information, provides the reader with a simple introduction to common locations of useful information. It will also provide a reference for fundamental Linux commands that can be used for troubleshooting many types of issues.
Chapter 3, Troubleshooting a Web Application, takes the process learned in Chapter 1 and the commands learned in Chapter 2 to work through a complicated problem. The problem outlined in this chapter is "By example" meaning that the flow of this chapter is designed to walk you through the entire troubleshooting process, from end to end.
Chapter 4, Troubleshooting Performance Issues, deals with performance issues and some of the most complicated problems to troubleshoot. Often, the complications are compounded by the perception of users versus expected levels of performance. In this chapter, the tools and information discussed in Chapter 2 will, once again, be used to resolve a real-world performance problem.
Chapter 5, Network Troubleshooting, talks about networking being a critical component of any modern day system. This chapter will cover the core commands necessary for the configuration and diagnostics of Linux networking.
Chapter 6, Diagnosing and Correcting Firewall Issues, covers the complex nature of Linux firewalls, in a continuation of Chapter 5. This chapter will introduce and highlight commands and techniques necessary to troubleshoot Linux software firewalls.
Chapter 7, Filesystem Errors and Recovery, teaches you that being able to recover a filesystem could mean the difference between losing and retaining data. This chapter will introduce some core Linux filesystem concepts and will demonstrate how to recover a read-only filesystem.
Chapter 8, Hardware Troubleshooting, starts to touch on the process of troubleshooting hardware issues. This chapter will walk you through the restoration of a failed hard drive.
Chapter 9, Using System Tools to Troubleshoot Applications, explores how often a system administrator's role is not only to troubleshoot OS issues but also application issues. This chapter will show you how to utilize common system tools to identify the root cause of an application issue.
Chapter 10, Understanding Linux User and Kernel Limits, demonstrates that Red Hat Enterprise Linux has many components in place to prevent users from overloading the system. This chapter will explore these components and explain how to modify them to allow legitimate resource utilization.
Chapter 11, Recovering from Common Failures, walks you through troubleshooting out-of-memory conditions. This scenario is very common in heavily utilized environments and can be difficult to troubleshoot. This chapter will cover not only how to troubleshoot this issue, but also why the issue occurred.
Chapter 12, Root Cause Analysis of an Unexpected Reboot, puts the troubleshooting process and commands learned in the previous chapters to the test. This chapter walks you through performing a Root Cause Analysis on a server that has unexpectedly rebooted.
Although this book can be standalone, readers will benefit greatly from having a system with Red Hat Enterprise Linux release 7, with the operating system available. You will more effectively learn the commands and resources discussed in this book when you have the ability to execute them on a test system.
While it is possible to use many of the commands, processes, and resources covered in this book with other Linux distributions, it is highly recommended to utilize a Red Hat downstream distribution such as CentOS 7 if Red Hat Enterprise Linux 7 is not available to the reader.
If you are a competent RHEL administrator or consultant with a desire to increase your troubleshooting skills and your knowledge of Red Hat Enterprise Linux, then this book is perfect for you. A good knowledge level and understanding of basic Linux commands are expected.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Within reason, it is not required to include every cd or ls command executed."
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "we will see a message on our screen that says still here?."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
This chapter, which happens to be the first chapter, is probably the most important and least technical. Most chapters in this book cover specific issues and the commands necessary to troubleshoot those issues. This chapter, however, will cover some troubleshooting best practices that can be applied to any issue.
You can think of this chapter as the principles behind the practices being applied.
Before covering the best practices of troubleshooting, it is important to understand the different styles of troubleshooting. In my experience, I have found that people tend to use one of three styles of troubleshooting, which are as follows:
Each of these styles have their own strengths and weaknesses. Let's have a look at the characteristics of these styles.
I like to call the first style of troubleshooting, the Data Collector. The Data Collector is someone who generally utilizes a systematic approach to solve issues. The systematic troubleshooting approach is generally characterized as follows:
The strength of this style is that it is effective, no matter what level of engineer or administrator is using it. By going through issues systematically, collecting each data point, and understanding the results before executing any resolution, the Data Collector is able to resolve issues that they might not necessarily be familiar with.
The weakness of this style is that the data collection is not usually the fastest method to resolve issues. Depending on the issue, collecting data can take a long time and some of that data might not be necessary to find the resolution.
I like to call the second style of troubleshooting, the Educated Guesser. The Educated Guesser is someone who generally utilizes an intuitive approach to solve issues. The intuitive approach is generally characterized by the following:
The strength of this style of troubleshooting is that it allows you to come up with resolutions sooner. When confronted with an issue, this type of troubleshooter tends to pull from experience and requires minimal information to find a resolution.
The weakness of this style is that it relies heavily on experience, and thus requires time before being effective. When focusing on resolution, this troubleshooter might also attempt multiple actions to resolve the issue, which can make it seem like the Educated Guesser does not fully understand the issue at hand.
There is a third and often-overlooked style of troubleshooting; this style utilizes both the systematic and intuitive styles. I like to call this style the Adaptor. The Adaptor has a personality which enables it to switch between systematic and intuitive troubleshooting styles. This combined style is often faster than the Data Collector style and is more detail oriented than the Educated Guesser style. This is because they are able to apply the troubleshooting style appropriate for the task at hand.
While it is easy to say that one method is better than the other, the fact of the matter is that picking the appropriate troubleshooting style depends greatly on the person. It is important to understand which troubleshooting style best fits your own personality. By understanding which style fits you better, you can learn and use techniques that fit that style. You can also learn and adopt techniques from other styles to apply troubleshooting steps that you would normally overlook.
This book will show both the Data Collector and Educated Guesser styles of troubleshooting, and periodically highlighting which personality style the steps best fit.
Troubleshooting is a process that is both rigid and flexible. The rigidity of the troubleshooting process is based on the fact that there are basic steps to be followed. In this way, I like to equate the troubleshooting process to the scientific method, where the scientific method has a specific list of steps that must be followed.
The flexibility of the troubleshooting process is that these steps can be followed in any order that makes sense. Unlike the scientific method, the troubleshooting process often has the goal of resolving the issue quickly. Sometimes, in order to resolve an issue quickly, you might need to skip a step or execute them out of order. For example, with the troubleshooting process, you might need to resolve the immediate issue, and then identify the root cause of that issue.
The following list has five steps that make up the troubleshooting process. Each of these steps could also include several sub-tasks, which may or may not be relevant to the issue. It is important to follow these steps with a grain of salt, as not every issue can be placed into the same bucket. The following steps are meant to be used as a best practice but, as with all things, it should be adapted to the issue at hand:
With the scientific method, the first step is to establish a problem statement, which is another way of saying: to identify and understand the goal of the experiment. With the troubleshooting process, the first step is to understand the problem being reported. The better we understand an issue, the easier it is to resolve the issue.
There are a number of tasks we can perform that will help us understand issues better. This first step is where a Data Collector's personality stands out. Data Collectors, by nature, will gather as much data as they can before moving on to the next step, whereas, the Educated Guessers generally tend to run through this step quickly and then move on to the next step, which can sometimes cause critical pieces of information to be missed.
Adaptors tend to understand which data collecting steps are necessary and which ones are not. This allows them to collect data as a Data Collector would, but without spending time gathering data that does not add value to the issue at hand.
The sub-task in this troubleshooting step is asking the right questions.
Whether via human or automated processes such as a ticket system, the reporter of the issue is often a great source of information.
When they receive a ticket, the Educated Guesser personality will often read the heading of the ticket, make an assumption of the issue and move to the next stage of understanding the issue. The Data Collector personality will generally open the ticket and read the full details of the ticket.
While it depends on the ticketing and monitoring system, in general, there can be useful information within a ticket. Unless the issue is a common issue and you are able to understand all that you know from the header, it is generally a good idea to read the ticket description. Even small amounts of information might help with particularly tricky issues.
Gathering additional information from humans, however, can be inconsistent. This varies greatly depending on the environment being supported. In some environments, the person reporting an issue can provide all of the details required to resolve the issue. In other environments, they might not understand the issue and simply explain the symptoms.
No matter what troubleshooting style fits your personality best, being able to get important information from the person reporting the issue is an important skill. Intuitive problem solvers such as the Educated Guesser or Adaptor tend to find this process easier as compared to Data Collector personalities, not because these personalities are necessarily better at obtaining details from people but rather because they are able to identify patterns with less information. Data Collectors, however, can get the information they need from those reporting the issue if they are prepared to ask troubleshooting questions.
Don't be afraid to ask obvious questions
My first technical job was in a webhosting technical support call center. There I often received calls from users who did not want to perform the basic troubleshooting steps and simply wanted the issue escalated. These users simply felt that they had performed all of the troubleshooting steps themselves and had found an issue beyond first level support.
While sometimes this was true, more often, the issue was something basic that they had overlooked. In that role, I quickly learned that even if the user is reluctant to answer basic or obvious questions, at the end of the day, they simply want their issue resolved. If that meant going through repetitive steps, that was ok, as long as the issue is resolved.
Even today, as I am now the escalation point for senior engineers, I find that many times engineers (even with years of troubleshooting experience under their belt) overlook simple basic steps.
Asking simple questions that might seem basic are sometimes a great time saver; so don't be afraid to ask them.
One of the best ways to gather information and understand an issue is to experience it. When an issue is reported, it is best to duplicate the issue.
While users can be a source of a lot of information, they are not always the most reliable; oftentimes a user might experience an error and overlook it or simply forget to relay the error when reporting the issue.
Often, one of the first questions I will ask a user is how to recreate the issue. If the user is able to provide this information, I will be able to see any errors and often identify the resolution of the issue faster.
Sometimes duplicating the issue is not possible
While it is always best to duplicate the issue, it is not always possible. Every day, I work with many teams; sometimes, those teams are within the company but many times they are external vendors. Every so often during a critical issue, I will see someone make a blanket statement such as "If we can't duplicate it, we cannot troubleshoot it."
While it is true that duplicating an issue is sometimes the only way to find the root cause, I often hear this statement abused. Duplicating an issue should be viewed like a tool; it is simply one of many tools in your troubleshooting tool belt. If it is not available, then you simply have to make do with another tool.
There is a significant difference between not being able to find a resolution and not attempting to find a resolution due to the inability to duplicate an issue. The latter is not only unhelpful, but also unprofessional.
Most likely, you are reading this book to learn techniques and commands to troubleshoot Red Hat Enterprise Linux systems. The third sub-task in understanding the problem statement is just that—running investigative commands to identify the cause of the issue. Before executing investigatory commands, however, it is important to know that the previous steps are in a logical order.
It is a best practice to first ask the user reporting an issue some basic details of the issue, then after obtaining enough information, duplicate the issue. Once the issue has been duplicated, the next logical step is to run the necessary commands to troubleshoot and investigate the cause of the issue.
It is very common to find yourself returning to previous steps during the troubleshooting process. After you have identified some key errors, you might find that you must ask the original reporter for additional information. When troubleshooting, do not be afraid to take a few steps backwards in order to gain clarity of the issue at hand.
With the scientific method, once a problem statement has been formulated it is then time to establish a hypothesis. With the troubleshooting process, after you have identified the issue, gathered the information about the issue such as errors, system current state, and so on, it is also time to establish what you believe caused or is causing the issue.
Some issues, however, might not require much of a hypothesis. It is common that errors in log files or the systems current state might answer why the issue occurred. In such scenarios, you can simply resolve the issue and move on to the Documentation step.
For issues that are not cut and dry, you will need to put together a hypothesis of the root cause. This is necessary as the next step after forming a hypothesis is attempting to resolve the issue. It is difficult to resolve an issue if you do not have at least, a theory of the root cause.
Here are a few techniques that can be used to help form a hypothesis.
While performing data collection during the previous steps, you might start to see patterns. Patterns can be something as simple as similar log entries across multiple services, the type of failure that occurred (such as, multiple services going offline), or even a reoccurring spike in system resource utilization.
These patterns can be used to formulate a theory of the issue. To drive the point home, let's go through a real-world scenario.
You are managing a server that both runs a web application and receives e-mails. You have a monitoring system that detected an error with the web service and created a ticket. While investigating the ticket, you also receive a call from an e-mail user stating they are getting e-mail bounce backs.
When you ask the user to read the error to you they mention No space left on device.
Let's break down this scenario:
Could all of this mean that Apache is down because the file system is full? Possibly. Should we investigate it? Absolutely!
The above breakdown leads into the next technique for forming a hypothesis. It might sound simple but is often forgotten. "Have I seen something like this before?"
With the previous scenario, the error reported from the e-mail bounce back was one that generally indicated that a file system was full. How do we know this? Well, simple, we have seen it before. Maybe we have seen that same error with e-mail bounce backs or maybe we have seen the error from other services. The point is, the error is familiar and the error generally means one thing.
Remembering common errors can be extremely useful for the intuitive types such as the Educated Guesser and Adaptor; this is something they tend to naturally perform. For the Data Collector, a handy trick would be to keep a reference table of common errors handy.
From my experience, most Data Collectors tend to keep a set of notes that contain things such as common commands or steps for procedures. Adding common errors and the meaning behind those errors are a great way for systematic thinkers such as Data Collectors to establish a hypothesis faster.
Overall, establishing a hypothesis is important for all types of troubleshooters. This is the area where the intuitive thinkers such as Educated Guessers and Adaptors excel. Generally, those types of troubleshooters will form a hypothesis sooner, even if sometimes those hypotheses are not always correct.
In the scientific method, once a hypothesis is formed, the next stage is experimentation. With troubleshooting, this equates to attempting to resolve the issue.
Some issues are simple and can be resolved using a standard procedure or steps from experience. Other issues, however, are not as simple. Sometimes, the hypothesis turns out to be wrong or the issue ends up being more complicated than initially thought.
In such cases, it might take multiple attempts to resolve the issue. I personally like to think of this as similar to trial and error. In general, you might have an idea of what is wrong (the hypothesis) and an idea on how to resolve it. You attempt to resolve it (trial), and if that doesn't work (error), you move on to the next possible solution.
To those taking up a new role as a Linux Systems Administrator, if there were only one piece of advice I could give, it would be one that most have learned the hard way: back everything up before making changes.
Many times as systems administrators we find ourselves needing to change a configuration file or delete a few unneeded files in order to solve an issue. Unfortunately, we might think we know what needs to be removed or changed but are not always correct.
If a backup was taken, then the change can simply be restored to its previous state, however, without a backup. Thus reverting changes is not as easy.
A backup can consist of many things, it can be a full system backup using something like rdiff-backup, a VM snapshot, or something as simple as creating a copy of a file.
For those interested in seeing the extent of this tip in practice, simply run the following command on any server that has more than four systems administrators and has been around for several years:
In many cases at this point the issue is resolved, but much like each step in the troubleshooting process, it depends on the issue at hand. While getting help is not exactly a troubleshooting step, it is often the next logical step if you cannot solve the issue on your own.
When looking for help, there are generally six resources available:
Books (such as this one) are good for referencing commands or troubleshooting steps for particular types of issues. Other books such as the ones that specialize on a specific technology are good for referencing how that technology works. In previous years, it was not uncommon to see a senior admin with a bookshelf full of technical books at his or her disposal.
In today's world, as books are more frequently seen in a digital format, they are even easier to use as references. The digital format makes them searchable and allows readers to find specific sections faster than a traditional printed version.
Before Team Wikisbecame common, many operations groups had physical books called Runbooks. These books are a list of processes and procedures used daily by the operations team to keep the production environments operating normally. Sometimes, these Runbooks would contain information for provisioning new servers and sometimes they would be dedicated to troubleshooting.
In today's world, these Runbooks have mostly been replaced by Team Wikis, these Wikis will often have the same content but are online. They also tend to be searchable and easier to keep up to date, which means they are frequently more relevant than a traditional printed Runbook.
The benefit of Team Wikis and Runbooks are that not only can they often address issues that are specific to your environment, but they can also resolve those issues. There are many ways to configure services such as Apache, and there are even more ways that external systems create dependencies on these services.
In some environments, you might be able to simply restart Apache whenever there is an issue, but in others, you might actually have to go through several prerequisite steps. If there is a specific process that needs to be followed before restarting a service, it is a best practice to document the process in either a Team Wiki or Runbook.
Google is such a common tool for systems administrators that at one point there were specific search portals available at google.com/linux, google.com/microsoft, google.com/mac, and google.com/bsd.
Google has depreciated these search portals but that doesn't mean that the number of times systems administrators use Google or any other search engine for troubleshooting has decreased.
In fact, in today's world, it is not uncommon to hear the words "I would Google it" in technical interviews.
A few tips for those new to using Google for systems administration tasks are:
For example, searching for kdumpctl: No memory reserved for crash kernel returns 600 results, whereas searching for memory reserved for crash kernel returns 449,000 results.
You can find an online version of any man page by searching for man then a command such as man netstat.You can wrap an error in double quotes to refine search results to those that contain the same error.Asking what you're looking for in the form of a question usually results in tutorials. For example, How do you restart Apache on RHEL 7?While Google can be a great resource, the results should always be taken with a grain of salt. Often while searching for an error on Google, you might find a suggested command that offers little explanation but simply says "run this and it will fix it". Be very cautious when running these commands, it is important that any command you execute on a system should be a command you are familiar with. You should always know what a command does before executing it.
When Google is not available or even sometimes when it is, the best source of information on commands or Linux, in general, are the man pages. The man pages are core Linux manual documents that are accessible via the man command.
To look up documentation for the netstat command, for example, simply run the following:
As you can see, this command outputs not only the information on what the netstat command is, but also contains a quick synopsis of usage information such as the following:
Also, it gives detailed descriptions of each flag and what it does:
In general, the base manual pages for the core system and libraries are distributed with the man-pages package. The man pages for specific commands such as top, netstat, or ps are distributed as part of that command's installation package. The reason for this is because the documentation of individual commands and components is left to the package maintainers.
This can mean that some commands are not documented to the level of others. In general, however, the man pages are extremely useful sources of information and can answer most day-to-day questions.
In the previous example, we can see that the man page for netstat includes a few sections of information. In general, man pages have a consistent layout with some common sections that can be found within most man pages. The following is a simple list of some of these common sections:
The Name section generally contains the name of the command and a very brief description of the command. The following is the name section from the ps command's man page:
The Synopsis section of a command's man page will generally list the command followed by the possible command flags or options. A very good example of this section can be seen in the netstat command's synopsis:
This section can be very useful as a quick reference for command syntax.
The Description section will often contain a longer description of the command as well as a list and explanation of the various command options. The following snippet is from the cat command's man page:
The description section is very useful, since it goes beyond simply looking up options. This section is often where you will find documentation about the nuances of commands.
Often man pages will also include examples of using the command:
The preceding is a snippet from the cat command's man page. We can see, in this example, how to use cat to read from files and standard input in one command.
This section is often where I find new ways of using commands that I've used many times before.
In addition to the previous section, you might also see sections such as See Also, Files, Author, and History. These sections can also contain useful information; however, not every man page will have them.
Along with man pages, Linux systems generally also contain info documentation, which are designed to contain additional documentation, which go beyond that, within man pages. Much like man pages, the info documentation is included with a command package, and the quality/quantity of the documentation can vary by package.
The method to invoke the info documentation is similar to man pages, simply execute the info command followed by the subject you wish to view:
In addition to using man pages and info documentation to look up commands; these tools can also be used to view documentation around other items such as system calls or configuration files.
As an example, if you were to use man to search for the term signal, you would see the following:
Signal is a very important system call and a core concept of Linux. Knowing that it is possible to use the man and info commands to look up core Linux concepts and behaviors can be very useful during troubleshooting.
Red Hat Enterprise Linux based distributions generally include the man-pages package; if your system does not have the man-pages package installed, you can install it with the yum command:
In addition to man pages, the Red Hat distribution also has a package called kernel-doc. This package contains quite a bit of information on how the internals of the system works.
The kernel documentation is a set of text files that are placed into /usr/share/doc/kernel-doc-<kernel-version>/ and are categorized by the topic they cover. This resource is quite useful for deeper troubleshooting such as adjusting kernel tunables or understanding how ext4 filesystems utilize the journal.
By default, the kernel-doc package is not installed, however, it can be easily installed using the yum command:
Whether it is a friend or a team leader, there is certain etiquette when asking others for help. The following is a list of things that people tend to expect when asked to help solve an issue. When I am asked for help, I would expect you to:
The preceding list, while not extensive, is important as each of these key pieces of information can help the next person troubleshoot the issue effectively.
When escalating issues, it is always best to follow up with that other person to find out what they did and how they did it. This is important as it will show the person you asked that you are willing to learn more, which many times will lead to them taking time to explain how they resolved and identified the issue.
Interactions like these will give you more knowledge and help build your system's administration skills and experience.
Documentation is a critical step in the troubleshooting process. At every step during the process, it is key to take note and document the actions being performed. Why is it important to document? Three reasons mainly:
Depending on environments, the documentation can be anything from simple notes saved in a text file on a local system to required notes for a ticket system. Each work environment is different but a general rule is there is no such thing as too much documentation.
For Data Collectors, this step is fairly natural. As most Data Collector personalities will generally keep quite a few notes for their own personal use. For Educated Guessers, this step might seem unnecessary. However, for any issue that is reoccurring or needs to be escalated, documentation is critical.
What kind of information should be documented? The following list is a good starting point but as with most things in troubleshooting, it depends on the environment and the issue:
With the preceding items well documented, if the issue reoccurs, it is relatively simple to take the documentation and move it to a Team Wiki. The benefit to this is that a Wiki article can be used by other team members who need to resolve the same issue during reoccurrences.
One of the three reasons listed previously for documentation is to use the documentation during Root Cause Analysis, which leads to our next topic—Establishing a Root Cause Analysis.
Root cause analysis is a process that is performed after incidents occur. The goal of the RCA process is to identify the root cause of an incident and identify any possible corrective actions to prevent the same incident from occurring again. These corrective actions might be as simple as establishing user training to reconfiguring Apache across all web servers.
The RCA process is not unique to technology and is a widely practiced process in fields such as aviation and occupational safety. In these fields, an incident is often more than simply a few computers being offline. They are incidents where a person's life might have been at risk.
Different work environments might implement RCA processes differently but at the end of the day there are a few key elements in every good RCA:
One of the first
