Configuring host roles using groups

In this recipe, we'll learn how to use the abstraction of host and service groups to our advantage in order to build a configuration where hosts and services can be added or removed more easily. We'll do this by defining roles for hosts by using a hostgroup structure, and then assigning relevant services to the hostgroup, rather than to the hosts individually.

Getting ready

You will need to have a server running Nagios Core 3.0 or later, have access to the command line to change its directories, and understand the basics of how host and service groups work. These are covered in the Creating a new hostgroup and Creating a new servicegroup recipes in Chapter 1.

In this example, we'll create two simple hostgroups; ...

Get Nagios Core Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.