2.4 Grouping Computers Together with hostgroup

A host group contains one or more computers so that they can be represented in the Web interface together (see Figure 16-10 in page 334)—in addition, certain objects (e.g., services) can be applied to an entire group of computers instead of having to define them individually for each host.

The hostgroup_name parameter specifies a unique name for the group, alias accepts a short description. The members parameter lists all hosts names belonging to the group, separated by commas:

# -- /etc/nagios/mysite/hostgroups.cfg
define hostgroup{
    hostgroup_name           linux-servers
    alias                    Linux Servers
    members                      linux01,linux02
    hostgroup_members(*) hostgroup1,hostgroup2
}

If you specify to which group they belong in the ...

Get Nagios, 2nd Edition 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.