Book Image

Nagios Core Administration Cookbook - Second Edition

By : Tom Ryder
Book Image

Nagios Core Administration Cookbook - Second Edition

By: Tom Ryder

Overview of this book

Nagios Core is an open source monitoring framework suitable for any network that ensures both internal and customer-facing services are running correctly and manages notification and reporting behavior to diagnose and fix outages promptly. It allows very fine configuration of exactly when, where, what, and how to check network services to meet both the uptime goals of your network and systems team and the needs of your users. This book shows system and network administrators how to use Nagios Core to its fullest as a monitoring framework for checks on any kind of network services, from the smallest home network to much larger production multi-site services. You will discover that Nagios Core is capable of doing much more than pinging a host or to see whether websites respond. The recipes in this book will demonstrate how to leverage Nagios Core's advanced configuration, scripting hooks, reports, data retrieval, and extensibility to integrate it with your existing systems, and to make it the rock-solid center of your network monitoring world.
Table of Contents (18 chapters)
Nagios Core Administration Cookbook Second Edition
About the Author
About the Reviewer

Writing customized Nagios Core reports

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

Getting ready

This recipe assumes that you have NDOUtils already installed and that your Nagios Core 4.0 or higher 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(1) command-line client will work just fine; a web-based 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 10 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 10 host or...