Excluding hostgroup from hostgroup!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Excluding hostgroup from hostgroup!

Post by BanditBBS »

This has been asked a few times in the past by others in here.

I have 3 main groups of hosts, hosts1, hosts2 and hosts3.

I have a HG1 and HG2 created and all the proper hosts assigned. I want to create a HG3 but don't want to have to remember to update it when adding new hosts. Ideally I'd add ALL 50 hostgroups into HG3 and EXCLUDE HG1 and HG2 from it. I can't think of any possible way to do this since you can't exclude a HG in a HG Members definition.

Anyone have any ideas?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Excluding hostgroup from hostgroup!

Post by BanditBBS »

My only thought right now is to write a script that creates a static config file. Adds * for hosts as members and also pulls from the api all the members of the other two hostgroups. It then writes them as members but excluded. Put this script in cron so it runs 1 or 2 times a day and I'll have my automatically updated hostgroup.

Anyone think of a better method?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Excluding hostgroup from hostgroup!

Post by scottwilkerson »

BanditBBS wrote:My only thought right now is to write a script that creates a static config file. Adds * for hosts as members and also pulls from the api all the members of the other two hostgroups. It then writes them as members but excluded. Put this script in cron so it runs 1 or 2 times a day and I'll have my automatically updated hostgroup.

Anyone think of a better method?
This is really about the best I can think of as you cannot exclude hostgroups from other hostgroups..
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Excluding hostgroup from hostgroup!

Post by BanditBBS »

scottwilkerson wrote:
BanditBBS wrote:My only thought right now is to write a script that creates a static config file. Adds * for hosts as members and also pulls from the api all the members of the other two hostgroups. It then writes them as members but excluded. Put this script in cron so it runs 1 or 2 times a day and I'll have my automatically updated hostgroup.

Anyone think of a better method?
This is really about the best I can think of as you cannot exclude hostgroups from other hostgroups..
OK Scott, just wanted to hear that...thanks! Umm, feature request???? LOL

You can lock this!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Excluding hostgroup from hostgroup!

Post by scottwilkerson »

BanditBBS wrote:
scottwilkerson wrote:
BanditBBS wrote:My only thought right now is to write a script that creates a static config file. Adds * for hosts as members and also pulls from the api all the members of the other two hostgroups. It then writes them as members but excluded. Put this script in cron so it runs 1 or 2 times a day and I'll have my automatically updated hostgroup.

Anyone think of a better method?
This is really about the best I can think of as you cannot exclude hostgroups from other hostgroups..
OK Scott, just wanted to hear that...thanks! Umm, feature request???? LOL

You can lock this!
;)

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked