Learning Nagios 4

Learning Nagios 4
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Set up, configure, and manage Nagios 4 to secure and monitor your system
  • Learn how to use libnagios and NERD to process and handle queries
  • Packed with lots of tips, tricks and illustrations to explain the Nagios configuration and monitoring concepts in a simplified manner

Book Details

Language : English
Paperback : 400 pages [ 235mm x 191mm ]
Release Date : March 2014
ISBN : 1783288647
ISBN 13 : 9781783288649
Author(s) : Wojciech Kocjan
Topics and Technologies : All Books, Open Source

Table of Contents

Chapter 1: Introducing Nagios
Chapter 2: Installing Nagios 4
Chapter 3: Using the Nagios Web Interface
Chapter 4: Using the Nagios Plugins
Chapter 5: Advanced Configuration
Chapter 6: Notifications and Events
Chapter 7: Passive Checks and NSCA
Chapter 8: Monitoring Remote Hosts
Chapter 9: Monitoring using SNMP
Chapter 10: Advanced Monitoring
Chapter 11: Programming Nagios
Chapter 12: Using the Query Handler
  • Chapter 1: Introducing Nagios
    • Understanding the basics of Nagios
      • The benefits of monitoring resources
      • Main features
    • Soft and hard states
    • What's new in Nagios 4.0
    • Summary
  • Chapter 2: Installing Nagios 4
    • Installation
      • Upgrading from previous versions
      • Installing prerequisites
      • Obtaining Nagios
      • Setting up users and groups
      • Compiling and installing Nagios
      • Compiling and installing Nagios plugins
      • Setting up Nagios as a system service
      • Resolving errors with script for the Nagios system service
    • Configuring Nagios
      • Creating the main configuration file
      • Understanding macro definitions
      • Configuring hosts
      • Configuring host groups
      • Configuring services
      • Configuring service groups
      • Configuring commands
      • Configuring time periods
      • Configuring contacts
      • Configuring contact groups
      • Verifying the configuration
      • Understanding notifications
      • Templates and object inheritance
    • Summary
  • Chapter 3: Using the Nagios Web Interface
    • Setting up the web interface
      • Configuring the web server
      • Creating an administrative user for Nagios
      • Accessing the web interface
      • Troubleshooting
    • Using the web interface
      • Checking the tactical overview
      • Viewing the status map
    • Managing hosts
      • Checking statuses
      • Viewing host information
    • Managing services
      • Checking statuses
      • Viewing service information
    • Managing downtime
      • Checking downtime statuses
      • Scheduling downtime
    • Managing comments
    • Nagios information
      • Viewing process information
      • Checking performance information
    • Generating reports
    • Changing the look of the Nagios web interface
    • Third-party Nagios web interfaces
    • Summary
  • Chapter 4: Using the Nagios Plugins
    • Understanding how checks work
    • Monitoring using the standard network plugins
      • Testing the connection to a remote host
      • Testing the connectivity using TCP and UDP
    • Monitoring the e-mail servers
      • Checking the POP3 and IMAP servers
      • Testing the SMTP protocol
    • Monitoring network services
      • Checking the FTP server
      • Verifying the DHCP protocol
      • Monitoring the Nagios process
      • Testing the websites
    • Monitoring the database systems
      • Checking MySQL
      • Checking PostgreSQL
      • Checking Oracle
      • Checking other databases
    • Monitoring the storage space
      • Checking the swap space
      • Monitoring the disk status using SMART
      • Checking the disk space
      • Testing the free space for remote shares
    • Monitoring the resources
      • Checking the system load
      • Checking the processes
      • Monitoring the logged-in users
    • Monitoring other operations
      • Checking for updates with APT
      • Monitoring the UPS status
      • Gathering information from the lm-sensors
      • Using the dummy check plugin
      • Manipulating other plugins' output
    • Additional and third-party plugins
      • Monitoring the network software
      • Using third-party plugins
    • Summary
  • Chapter 5: Advanced Configuration
    • Creating maintainable configurations
    • Configuring the file structure
    • Defining the dependencies
      • Creating the host dependencies
      • Creating the service dependencies
    • Using the templates
      • Creating the templates
      • Inheriting from multiple templates
    • Using the custom variables
    • Understanding flapping
    • Summary
  • Chapter 6: Notifications and Events
    • Creating effective notifications
      • Using multiple notifications
      • Sending instant messages via Jabber
      • Notifying users with text messages
      • Integrating with HipChat
    • Understanding escalations
      • Setting up escalations
      • Understanding how escalations work
    • Sending commands to Nagios
      • Adding comments to hosts and services
      • Scheduling host and service checks
      • Modifying custom variables
    • Creating event handlers
      • Restarting services automatically
      • Modifying notifications
    • Using adaptive monitoring
    • Summary
  • Chapter 7: Passive Checks and NSCA
    • Understanding passive checks
      • Configuring passive checks
      • Sending passive check results for hosts
      • Sending passive check results for services
      • Troubleshooting errors
    • Using NSCA
      • Downloading NSCA
      • Compiling NSCA
      • Configuring the NSCA server
      • Sending results over NSCA
      • Configuring NSCA for secure communication
    • Summary
  • Chapter 8: Monitoring Remote Hosts
    • Monitoring over SSH
      • Configuring the SSH connection
      • Using the check_by_ssh plugin
      • Performing multiple checks
      • Troubleshooting the SSH-based checks
    • Monitoring using NRPE
      • Obtaining NRPE
      • Compiling NRPE
      • Configuring the NRPE daemon
      • Setting up NRPE as a system service
      • Configuring Nagios for NRPE
      • Using command arguments with NRPE
      • Troubleshooting NRPE
    • Comparing NRPE and SSH
    • Alternatives to SSH and NRPE
    • Summary
  • Chapter 9: Monitoring using SNMP
    • Introducing SNMP
      • Understanding data objects
    • Working with SNMP and MIB
      • Using graphical tools
    • Setting up an SNMP agent
    • Using SNMP from Nagios
      • Receiving traps
      • Using additional plugins
    • Summary
  • Chapter 10: Advanced Monitoring
    • Monitoring Windows hosts
      • Setting up NSClient++
      • Performing tests using check_nt
      • Performing checks with NRPE protocol
      • Performing passive checks using NSCA Protocol
    • Understanding distributed monitoring
      • Introducing obsessive notifications
      • Configuring Nagios instances
      • Performing freshness checking
    • Using templates for distributed monitoring
      • Creating the host and service objects
      • Customizing checks with custom variables
    • Summary
  • Chapter 11: Programming Nagios
    • Introducing Nagios customizations
    • Programming in C with libnagios
    • Creating custom active checks
      • Testing the correctness of the MySQL database
      • Monitoring local time with a time server
      • Writing plugins correctly
    • Checking websites
    • Virtualization and clouds
      • Monitoring VMware
      • Monitoring Amazon Web Services
    • Writing commands to send notifications
    • Managing Nagios
    • Summary
  • Chapter 12: Using the Query Handler
    • Introducing the query handler
      • Communicating with the query handler
      • Using the query handler programmatically
    • Using the core service
    • Introducing Nagios Event Radio Dispatcher
      • Displaying real-time status updates
      • Displaying checks using Gource
    • Summary

Wojciech Kocjan

Wojciech Kocjan is a system administrator and programmer with 10 years of experience. His work experience includes several years of using Nagios for enterprise IT infrastructure monitoring. He also has experience in large variety of devices and servers, routers, Linux, Solaris, AIX servers and i5/OS mainframes. His programming experience includes multiple languages (such as Java, Ruby, Python, and Perl) and focuses on web applications as well as client-server solutions.

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 4 submitted: last submission 29 Apr 2014

Errata type: Code | Page number: 18

service nagios stop

should be:

/etc/init.d/nagios stop

Errata type: Code | Page number: 64


name                      linuxbox01

Should be:

host_name               linuxbox01

Errata type: Code | Page number: 64


host_name                workinghours-service

Should be:

name                       workinghours-service

Errata type: Code | Pages no.: 181,182,189,201,and even throughout the book

Given'date +%s' 

Should be`date +%s`


Errata type: Code | Page number: 155

In the given image, in the "Host Defination" box,

"Template E" should be "Template F".

Under the "Template F" box, "Template C" should be "Template D".


Errata type: Code | Page number: 156

Given: The first one to check is B along with all parent templates

Should be: The first one to check is D along with all parent templates

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Learning Nagios 4 +    Windows Server 2012 Hyper-V Cookbook =
50% Off
the second eBook
Price for both: $39.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Install and configure Nagios to administer your network and system
  • Deploy agents and plug-ins, and monitor assets with advanced features of Nagios
  • Notify users of current and future incidents to protect the availability, performance, and security of monitored assets
  • Configure and work your way around the Nagios web interface
  • Pass service and host check results over the network using NSCA
  • Set up a working and usable distributed monitoring system using NSClient++
  • Develop custom plug-ins responsible for performing checks and analyzing results
  • Use the web interface to manage scheduled downtimes for hosts and services
  • Implement adaptive monitoring to modify various check-related parameters
  • Make use of SSH and NRPE to perform remote checks
  • Use SNMP to retrieve information from a device, set options, and also cover means for a device to notify other machines about a failure

In Detail

One of the most important challenges in system monitoring is to detect and report any malfunctioning system or device as soon as possible, so that you as an administrator are aware of the problem before a user runs into one.

Nagios is a powerful monitoring tool that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. It monitors your entire IT infrastructure to ensure systems, applications, services, and business processes are functioning properly. In the event of a failure, Nagios can alert the technical staff of the problem, allowing them to begin remediation processes before outages affect business processes, end-users, or customers.

"Learning Nagios 4" is a practical, beginner-level book that introduces you to setting up Nagios and walks you through all the basics of configuring it. It will guide you through the process of getting Nagios 4 up and running, using the web interface and monitoring IT systems. This book will also help you with understanding the typical problems encountered in setting up large-scale Nagios environments, as well as guide you through creating your very own Nagios plug-ins.

"Learning Nagios 4" will introduce Nagios to the system administrators who are interested in monitoring their systems as well as networks. This book starts by guiding you through setting up and configuring your first instance of Nagios so you can quickly start using it to ensure your IT is working properly.

The book also covers using SNMP to monitor various network-enabled devices. You will also find out how to use NSClient++ to monitor Microsoft Windows systems. The book explains distributed monitoring using multiple Nagios instances. Also, if you want to create your own plug-ins for Nagios, this book will teach you how to do so using programming languages like C and scripting languages like PHP, Perl, shell and Python.

By the end of this book, you will have all the necessary knowledge you need to set up Nagios 4 as well as for using Nagios in a large, distributed environment that monitors a large number of computers, services, and devices.


This book will introduce Nagios to readers who are interested in monitoring their systems. All the concepts in the book are explained in a simplified manner, presented in an easy-to-understand language with lots of tips, tricks, and illustrations.

Who this book is for

This book is great for system administrators interested in using Nagios to monitor their systems. It will also help professionals who have already worked with earlier versions of Nagios to understand the new features of Nagios 4 and provides usable solutions to real-life problems related to Nagios administration. To effectively use this book, system administration knowledge is required. If you want to create your own plug-ins, knowledge of scripting languages like Perl, shell and Python is expected.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software