forums.meulie.net

Nesting Hostgroups allowed?

I’m running the Nagios 1.3 pkg for Debian.

Can I nest hostgroups, if what is correct syntax?

Example:

Would like to do this:

define hostgroup{
hostgroup_name file-servers
alias File Servers
contact_groups network-admins
members fileserver1, fileserver2, fileserver3
}

define hostgroup{
hostgroup_name mail-servers
alias Mail Servers
contact_groups network-admins
members mailserver1, mailserver2, mailserver3
}

define hostgroup{
hostgroup_name windows-servers
alias windows Servers
contact_groups network-admins
members file-servers, mail-servers
}

Thank you in advance.

fileserver1 and 2 are hosts and they are members of a group. There is no host called “file-servers” so nagios is going to puke, if you try to do that.
Simply add all the hosts that are windows server’s to the hostgroup “windows-servers”.
I see what you are triing to do, but again, there is no host named
file-servers or mail-servers so that isn’t going to work.

I know that it will puke. What I’m asking is if there is a different syntax which will work?

something like a “member_groups” field:

define hostgroup{
hostgroup_name windows-servers
alias windows Servers
contact_groups network-admins
member_groups file-servers, mail-servers
}

Again, I’m just wondering if you can do this. If not, it’s not really a problem. It would just be a nice way to organize hostgroups as some servers are part of multiple organizational groups.

You can organize your groups as you wish. But you have to specify host names in the hostgroup definition, and not another hostgroup name, is all. I don’t see the problem. I just highlight the host, and paste within vi, and in seconds, it’s done.

I see how you would like it to work, but again, you must use a host name in a group as a member definition.

It’s not a problem, I just wanted to know if it could be done.

Thank you for your responses.