Book Image

Nagios Core Administration Cookbook Second Edition - Second Edition

By : Tom Ryder
Book Image

Nagios Core Administration Cookbook Second Edition - 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
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Implementing threshold checks in a plugin


You'll note that many of the plugins included in the Nagios Plugins set allow you to specify thresholds for different aspects of the tests that they perform, allowing custom configuration of which levels are ok, which need a warning, and which are critical. For example, the check_ping plugin requires us to specify thresholds with -w and -c options that define limits for round-trip-time and packet loss:

$ /usr/local/nagios/libexec/check_ping -H 192.0.2.21 -w 100,20% -c 200,40%
PING OK - Packet loss = 0%, RTA=0.20 ms|rta=0.200000ms;100.000000;100.000000;0.000000 pl=0%;10;20;0

In this case, the plugin's options are set only to raise a WARNING state if the round-trip-time for the check exceeds 100 milliseconds or if more than 20% of the packets are lost. It will raise a CRITICAL state if the check takes more than 200 milliseconds or 40% of the packets are lost.

When you're checking numeric values in a plugin, this is a useful way to allow the user to...