Overview
This guide on Best Practices is about configuration wizards and templates and what you should take into consideration when designing your monitoring deployment.
Configuration Wizards
Configuration wizards are a great ice breaker for people who are new to nagios, you didn’t need to learn how a plugin worked or how to create a command definition followed by service definitions, you just pointed and clicked.
The downside to wizards is that they create a lot of services. In a large scale monitoring environment, you might use services that are applied to hostgroups which reduces administrative overhead. Using wizards doesn’t really apply to these environments however they are a great primer for setting up initial services, from there you can modify them in CCM.
-
Pros
-
Great for getting up and running quickly
-
No need to learn how a plugin works
-
-
Cons
-
Creates individual services
-
More work later when enforcing "standards"
-
Templates
Templates are very powerful when used for the right purposes.
A really good example is how the XI Configuration Wizards use templates for the host objects. The host object template has a standard ICMP up/down check. This means if you ever wanted to change the thresholds, you could change the template and then all hosts using that template will get the updated check.
You can use multiple templates in a layering fashion. As Nagios core reads the object definition, it looks at the first template and obtains the settings. It then looks at the next template and layers those settings over the top of the previous settings. This continues and builds the final object. In the XI GUI, with multiple templates, the template at the bottom of the list will be overwritten by a template above it. Object directives can be set to inherit that setting from a template, or ignore it. Other settings can be additive, like hosts, hostgroups, contacts, contactgroups.
For example you might have a master template that defines the base settings all services should use. However you have a bunch of service checks that require a specific time period. Create a separate template that uses this time period and put that template at the top of the chain. The final service object that is created will use the specific time period.
You can even create an empty template that uses a combination of other templates, this way you can use the master templates across all your objects and easily add / remove other templates to the master template, in turn reducing your administrative overhead. Be careful not to add more administrative overhead though.
Final Thoughts
For any support related questions please visit the Nagios Support Forums at: