Sub Groups within a group

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pmams
Posts: 6
Joined: Wed Nov 21, 2012 1:25 am

Sub Groups within a group

Post by pmams »

How do you define a sub-group within a Main group ?

e.g Main group "PRODUCTION" & sub group "Prod App Servers"
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Sub Groups within a group

Post by slansing »

Is this speaking in regards to Hostgroup rules? As in a hostgroup within a hostgroup? Or a service group within a host group?
pmams
Posts: 6
Joined: Wed Nov 21, 2012 1:25 am

Re: Sub Groups within a group

Post by pmams »

i'd appreciate it in any form "either hostgroup of a host group or service group within a host group".

i basicly want to break down projects under each environment " for Dev servers { break it into sub groups such as Web Servers, App servers, DB Servers etc"
pmams
Posts: 6
Joined: Wed Nov 21, 2012 1:25 am

Re: Sub Groups within a group

Post by pmams »

i'd love to break down projects or classify servers within Host Groups.

for every environment "DEV | QA | PROD", i wanna have an extendable groups/service group "Web servers, DB Servers, LDAP Servers etc"
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Sub Groups within a group

Post by abrist »

The trick here is to use the optional directive hostgroup_members. See my mock-up below:

Code: Select all

define hostgroup{
        hostgroup_name          production ; The name of the hostgroup
        alias                   Servers in Production ; Long name of the group
        hostgroup_members:      prod_app_servers,prod_db_servers    ;This optional directive can be used to include hosts from other "sub" host groups in this host group. Specify a comma-delimited list of short names of other host groups whose members should be included in this group.
        }

define hostgroup{
        hostgroup_name          prod_app_servers
        alias                   Production app Servers
        members                 server1,server2
        }

define hostgroup{
        hostgroup_name          prod_db_servers
        alias                   Production Database Servers
        members                 server3,server4
        }
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked