Book Image

Learning Nagios 3.0

Book Image

Learning Nagios 3.0

Overview of this book

Table of Contents (16 chapters)
Learning Nagios 3.0
Credits
About the Author
About the Reviewer
Preface

Custom Variables


Custom variables allow you to include your own directives when defining objects. These can then be used in commands. This allows you to define objects in a more concise way and define service checks in a more general fashion. This functionality was introduced in Nagios 3, and is not available in the previous versions.

The idea is that you define directives that are not standard Nagios parameters in host, service, or contact objects, and they can then be accessed from all commands — check commands, notifications, and event handlers. This is very useful for complex Nagios configurations where you might want commands to perform nontrivial tasks for which they will require additional information.

Let's assume we want Nagios to check that hosts have correct MAC addresses. In Nagios 2, we would need to use a separate service check definition for each host and specify the MAC address in each of them. With Nagios 3, we can define a custom variable to store the MAC address for...