O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Nagios - Third Edition

Book Description

Learn and monitor your entire IT infrastructure to ensure your systems, applications, services, and business function effectively

About This Book

  • Packed with tips, tricks and illustrations, the book will explain the configuration and monitoring concepts in a simplified manner
  • Experience the scalability and flexibility of Nagios in a very practical and easy-to-understand approach.
  • Unleash the power of Nagios Core and Nagios XI 5 to monitor and secure your infrastructure with ease.

Who This Book Is For

This book is targeted at System Administrators, both, who have no prior knowledge of Nagios as well as readers experienced with it. It not only covers the basics of Nagios but also the advanced features.

What You Will Learn

  • Set up and use the built-in Nagios web interface
  • Upskill the additional interfaces available for Nagios to monitor your IT infrastructure
  • Learn how to perform various checks using both, Nagios standard plugins and third-party plugins
  • Explore the working of notifications and events in Nagios
  • Familiarize yourself with SNMP and use it for monitoring devices such as routers, switches, modems and printers
  • Discover how can be Nagios can be customized and tailored to your needs
  • Get to know more about the entreprise version of Nagios, Nagios XI

In Detail

Nagios, a powerful and widely used IT monitoring and management software for problem -solving. It detects problems related to your organizations infrastructure and helps in resolving the issue before it impacts the business.

Following the success of the previous edition, this book will continue to help you monitor the status of network devices and also notify the system administrators of network problems. Starting with the fundamentals, the book will teach you how to install and configure Nagios for your environment. The book helps you learn how to end downtimes, adding comments and generating reports using the built-in Web interface of Nagios. Moving on, you will be introduced to the third-party web interfaces and applications for checking the status and report specific information. As you progress further in Learning Nagios, you will focus on the standard set of Nagios plugins and also focus on teach you how to efficiently manage large configurations and using templates. Once you are up to speed with this, you will get to know the concept and working of notifications and events in Nagios. The book will then uncover the concept of passive check and shows how to use NRDP (Nagios Remote Data Processor). The focus then shifts to how Nagios checks can be run on remote machines and SNMP (Simple Network Management Protocol) can be used from Nagios. Lastly, the book will demonstrate how to extend Nagios by creating custom check commands, custom ways of notifying users and showing how passive checks and NRDP can be used to integrate your solutions with Nagios.

By the end of the book, you will be a competent system administrator who could monitor mid-size businesses or even large scale enterprises.

Style and approach

This will be a practical learning guide for system administrators which will teach them everything about Nagios along with implementing it for your organization and then ending with securing it.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Learning Nagios - Third Edition
    1. Learning Nagios - Third Edition
    2. Credits
    3. About the Authors
    4. About the Reviewer
    5. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why subscribe?
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    7. 1. Introducing Nagios
      1. Understanding the basics of Nagios
        1. Introducing plugins
        2. Benefits of monitoring
        3. Main features
        4. Soft and hard states
      2. Summary
    8. 2. Installing Nagios 4
      1. Installing Nagios
        1. Upgrading from previous versions
        2. Performing installation with automated script
        3. Installing Nagios using package managers
          1. Installation with apt-get/dpkg
          2. Installation with yum/rpm
      2. Compiling Nagios from source code manually
        1. Installing prerequisites
        2. Setting up users, groups, and directories
        3. Obtaining Nagios and Nagios plugins
        4. Compiling and installing Nagios
        5. Compiling and installing Nagios plugins
        6. Setting up a web server
        7. Troubleshooting the web server
      3. Running Nagios using virtualizations
        1. Running Nagios inside containers
        2. Installing Nagios inside virtual machines
      4. Summary
    9. 3. Configuring Nagios
      1. Configuring Nagios
        1. Understanding macro definitions
        2. Configuring hosts
        3. Configuring host groups
        4. Configuring services
        5. Configuring service groups
        6. Configuring commands
        7. Configuring time periods
        8. Configuring contacts
        9. Configuring contact groups
        10. Verifying the configuration
        11. Understanding notifications
      2. Using inheritance and templates
      3. Summary
    10. 4. Using the Built-in Web Interface
      1. The Nagios web interface
        1. Accessing the web interface
      2. Using the web interface
        1. Checking the tactical overview
        2. Viewing the status map
      3. Managing hosts
        1. Checking status
        2. Viewing host information
      4. Managing services
        1. Checking status
        2. Viewing service information
      5. Managing downtimes
        1. Checking downtimes statuses
        2. Scheduling downtimes
      6. Managing comments
      7. Nagios information
        1. Viewing process information
        2. Checking performance information
      8. Generating reports
      9. Changing the look of the Nagios web interface
      10. Summary
    11. 5. Using Additional Interfaces
      1. Introducing third-party web interfaces
        1. Using Nagios dashboards
        2. Installing alternative Nagios web interfaces
        3. Viewing performance data with nagiosgraph
      2. Learning command-line interfaces
        1. Using nagios_commander
        2. Interacting with nagios-cli
      3. Using mobile applications to check the Nagios status
        1. Checking the status on iOS with easyNag
        2. Working with Nagios on Android using aNag
        3. Checking the status on Windows Phone with NagChecker
      4. Summary
    12. 6. Using the Nagios Plugins
      1. Understanding checks in Nagios
      2. Using standard network plugins
        1. Testing the connection to a remote host
        2. Testing connectivity using TCP and UDP
      3. Monitoring e-mail servers
        1. Checking POP3 and IMAP servers
        2. Testing SMTP protocol
      4. Monitoring network services
        1. Checking FTP server
        2. Verifying DHCP protocol
        3. Monitoring Nagios processes
        4. Testing websites
      5. Monitoring database systems
        1. Checking MySQL
        2. Checking PostgreSQL
        3. Checking Oracle
        4. Checking other databases
      6. Monitoring storage space
        1. Checking swap space
        2. Monitoring disk status SMART
        3. Checking disk space
        4. Testing free space for remote shares
      7. Monitoring resources
        1. Checking system load
        2. Checking processes
        3. Monitoring logged-in users
      8. Monitoring other operations
        1. Checking for updates with APT
        2. Monitoring UPS status
        3. Gathering information from LM sensors
        4. Using the dummy check plugin
        5. Manipulating other plugins' output
      9. Additional and third-party plugins
        1. Monitoring network software
        2. Using third-party plugins
      10. Summary
    13. 7. Advanced Configuration
      1. Creating maintainable configurations
      2. Configuring the file structure
      3. Defining object dependencies
        1. Creating host dependencies
        2. Creating service dependencies
      4. Using templates
        1. Creating templates
        2. Inheriting from multiple templates
      5. Using the custom variables
      6. Understanding state flapping
      7. Summary
    14. 8. Notifications and Events
      1. Creating effective notifications
        1. Using multiple notifications
        2. Sending instant messages via Jabber
        3. Notifying users with text messages
        4. Integrating with HipChat
        5. Slack integration
      2. Understanding escalations
        1. Setting up escalations
        2. Understanding how escalations work
      3. Sending commands to Nagios
        1. Adding comments to hosts and services
        2. Scheduling host and service checks
        3. Modifying custom variables
      4. Creating event handlers
        1. Restarting services automatically
        2. Modifying notifications
      5. Using adaptive monitoring
      6. Summary
    15. 9. Passive Checks and NRDP
      1. Understanding passive checks
        1. Introducing active and passive checks
        2. Configuring passive checks
        3. Sending passive check results for hosts
        4. Sending passive check results for services
        5. Troubleshooting errors
      2. Using NRDP
        1. Installing the NRDP server
        2. Using the NRDP client
        3. Securing the NRDP communication
      3. Summary
    16. 10. Monitoring Remote Hosts
      1. Monitoring over SSH
        1. Configuring the SSH connection
        2. Using the check_by_ssh plugin
        3. Performing multiple checks
        4. Troubleshooting the SSH-based checks
      2. Monitoring using NRPE
        1. Obtaining NRPE
        2. Compiling NRPE
        3. Configuring the NRPE server
          1. Registering NRPE check commands
        4. Configuring Nagios for NRPE
        5. Using command arguments with NRPE
        6. Troubleshooting NRPE
      3. Comparing NRPE and SSH
      4. Alternatives to SSH and NRPE
      5. Summary
    17. 11. Monitoring Using SNMP
      1. Introducing SNMP
        1. Understanding data objects
      2. Working with SNMP and MIB
        1. Using graphical tools
      3. Setting up an SNMP agent
      4. Using SNMP from Nagios
        1. Receiving traps
        2. Using additional plugins
      5. Summary
    18. 12. Advanced Monitoring
      1. Monitoring Windows machines
        1. Installing NSClient++
        2. Configuring NSClient++
        3. Monitoring Windows using check_nt
        4. Performing checks using NRPE protocol
        5. Querying WMI data from Nagios
        6. Implementing external scripts
      2. Understanding distributed monitoring
        1. Introducing obsessive notifications
        2. Configuring Nagios instances
        3. Performing freshness checking
      3. Using templates for distributed monitoring
        1. Creating the host and service objects
        2. Customizing checks with custom variables
      4. Summary
    19. 13. Programming Nagios
      1. Introducing Nagios customizations
      2. Creating custom active checks
        1. Testing MySQL database correctness
        2. Monitoring local time against a time server
        3. Writing plugins the right way
      3. Checking websites
      4. Writing commands to send notifications
      5. Managing Nagios
      6. Using passive checks
      7. Introducing the query handler
        1. Communicating with the query handler
        2. Using the query handler programmatically
        3. Using the core service
        4. Introducing the Nagios event radio dispatcher
      8. Summary