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

Using Templates


Templates in Nagios allow you to create a set of parameters that can then be used in the definitions of multiple hosts, services, and contacts. The main purpose of templates is to keep parameters that are generic to all objects, or a group of objects, in one place. This way, you can avoid putting the same directives in hundreds of objects, and your configuration is more maintainable.

It is also good to start using templates for hosts and services, and decide how they should be used. Sometimes, it is better to have one template inherit another and create a hierarchical structure. In many cases, it is more reasonable to create hosts so that they use multiple templates — this is new functionality in Nagios 3, so it will not work for Nagios 2 configurations. This functionality allows inheriting some options from one template, and some parameters from another template.

The following is an illustration of how the templates can be structured using both techniques:

This example illustrates...