Book Image

Nagios Core Administration Cookbook

By : Tom Ryder
Book Image

Nagios Core Administration Cookbook

By: Tom Ryder

Overview of this book

Network monitoring requires significantly more than just pinging hosts. This cookbook will help you to comprehensively test your networks' major functions on a regular basis."Nagios Core Administration Cookbook" will show you how to use Nagios Core as a monitoring framework that understands the layers and subtleties of the network for intelligent monitoring and notification behaviour. Nagios Core Administration Guide introduces the reader to methods of extending Nagios Core into a network monitoring solution. The book begins by covering the basic structure of hosts, services, and contacts and then goes on to discuss advanced usage of checks and notifications, and configuring intelligent behaviour with network paths and dependencies. The cookbook emphasizes using Nagios Core as an extensible monitoring framework. By the end of the book, you will learn that Nagios Core is capable of doing much more than pinging a host or to check if websites respond.
Table of Contents (18 chapters)
Nagios Core Administration Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing customized Nagios Core reports


In this recipe, we'll explore some simple applications of the NDOUtils database by trying out some queries, and change one of them into both a simple report in Perl, and also into a PHP-based RSS feed.

Getting ready

This recipe assumes you have NDOUtils already installed, and that your Nagios Core 3.0 (or later) server is monitoring at least a few hosts and services, so that the queries we try actually return some data. You should also have some means of executing MySQL queries on the database server. The mysql command-line client will work just fine; a tool such as phpMyAdmin might make the data a little easier to explore.

How to do it...

We can explore some queries against the NDOUtils databases as follows:

  1. Retrieve the content and date/time of the latest ten notifications:

    mysql> SELECT start_time, long_output FROM nagios_notifications ORDER BY start_time DESC LIMIT 10;
    
  2. Retrieve the content and date/time of the latest ten host or service comments:

    ...