Book Image

Learning Nagios 3.0

Book Image

Learning Nagios 3.0

Overview of this book

Table of Contents (16 chapters)
Learning Nagios 3.0
Credits
About the Author
About the Reviewer
Preface

Preface

This book is a practical guide to setting up the Nagios 3.0 open source network monitoring tool. Nagios 3 is a system that watches to see whether hosts and services are working properly, and notifies users when problems occur. This book covers installing and configuring Nagios 3 on various operating systems, but focuses primarily on the Ubuntu Linux operating system.

This book takes the reader through the steps from compiling Nagios from the source, through installing and configuring it up to advanced features such as setting up redundant monitoring. It also mentions how to monitor various services such as e-mail, WWW, databases, and file sharing. This book describes what SNMP is and how it can be used to monitor various devices. It also provides details on monitoring Microsoft Windows computers. This book contains troubleshooting sections that aid the reader in case any problems arise when setting up Nagios functionality.

No previous experience with network monitoring is required, although a basic understanding of UNIX systems is assumed. This book provides examples for extending Nagios in several languages including Perl, Python, Tcl, and Java so that readers familiar with at least one of these technologies can benefit from extending Nagios.

When you finish this book, you’ll be able to set up Nagios to monitor your network, and have a good understanding of what can be monitored and in which ways.

What This Book Covers

Chapter 1 talks about the Nagios application and system monitoring in general. It shows the benefits of using system monitoring software, and the advantages of Nagios in particular. It also introduces the basic concepts of Nagios.

Chapter 2 covers installing Nagios both when compiling from source code and when using pre‑built packages. Details of how to configure users, hosts, and services are also given, as well as information on how Nagios sends notifications to users.

Chapter 3 talks about how to set up the Nagios Web interface, and what this offers to the user. It describes basic views for hosts and services, and detailed information on each individual item. It also introduces additional features such as scheduled downtimes, detailed information, and reports.

In Chapter 4, we go through Nagios plugins that allow the performing of checks of various services. It shows how you can check for standard services such as e-mail, Web, file, and database servers. It also describes how to monitor resources such as CPU usage, storage, and memory usage.

Chapter 5 focuses on managing large configurations and using templates. We see how dependencies between hosts and services can be defined, what are custom variables, and what adaptive monitoring is. We also look at flapping — services that start and stop randomly - and how Nagios detects this.

Chapter 6 describes the notification system in more details. It focuses on effective ways of communicating problems to users and how to set up problem escalations; it also shows how events work in Nagios and how they can be used to perform the automatic recovery of services.

Chapter 7 describes passive checks in detail. We give practical examples of when and how they can be used. It also shows how to use NSCA (Nagios Service Check Acceptor) for sending notifications.

Chapter 8 covers how Nagios checks can be run on remote machines. It walks through the details of deploying checks remotely over SSH using public-key authentication. It also shows how NRPE (Nagios Remote Plugin Executor) can be used for deploying plugins remotely.

In Chapter 9, we learn about SNMP (Simple Network Management Protocol) and how it can be used from Nagios. We start with an overview of SNMP and its versions; then we go through reading SNMP values from SNMP-aware devices and cover how this can then be used for performing checks from Nagios.

The first part of Chapter 10 looks at distributed monitoring. It talks about how Nagios can be set up on multiple hosts and how that information could be gathered on a central server. The second part of the chapter covers how to monitor computers that are running the Microsoft Windows operating system.

Chapter 11 shows you how to extend Nagios. We talk about how you can write your own check commands, add your own ways of notifying users, and use passive checks and NSCA to integrate your solutions with Nagios.

What You Need for This Book

No previous experience with network monitoring is required, although a basic understanding of UNIX systems is assumed. This book also provides examples for extending Nagios in several languages including Perl, Python, Tcl, and Java, so that readers familiar with at least one of these technologies can benefit from extending Nagios.

Who is This Book For

The target readers for this book are System Administrators interested in using Nagios. This book will teach Nagios beginners the basics of installation and configuration of version 3; it will show professionals who have already worked on earlier versions of Nagios the new features of Nagios, such as inheritance and new internal functions like better check scheduling.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The development packages always have the -dev suffix in their package name — in this case, it would be the libssl-dev package".

A block of code is set as follows:

define host
{
host_name     somemachine
address       10.0.0.1
check_command check-host-alive
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are shown in bold:

define host
{
host_name      somemachine
address        10.0.0.1
_MAC           12:12:12:12:12:12
check_command check-host-by-mac
}

Any command-line input or output is shown as follows:

/opt/nagios/plugins/check_ping -H 10.0.0.1 -w 3000.0,80% -c 5000.0,100% -p 5

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "It can be accessed by clicking on the Tactical Overview link in the left-side menu".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an email to, mentioning the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on this topic, see our author guide on www.packtpub.com/authors.

Customer Support

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.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/files/code/5180_Code.zip to directly download the example code.

Note

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in text or code — we would be grateful if you would report this to us. By doing so you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to the list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem. 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 the location address or website name immediately so we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.