Page 1 of 1

Closing hosts with services?

Posted: Tue Nov 29, 2011 1:40 pm
by epx998
Hi All,

I have been attempting to find the best way to clone a host along with its attached services. Basically copying the host and services, giving it a new host name. This would greatly help deploying monitoring for our large clusters. Is this where creating a 'template' would be used? I tinkered with templates and the 'copy' feature in Nagios Core, but all it did was duplicate the host, none of its services.

Cheers,

Gavin

Re: Closing hosts with services?

Posted: Tue Nov 29, 2011 5:55 pm
by jsmurphy
All of this is going to depend on the way in which you have set up the inheritance... My usual approach is to tie all services to a service group or host group and have that flow down to the host for example:
I might have one host group windows-servers and another exchange-servers. Any service that will be related to all windows-servers I will assign to that hostgroup in the service definition... and the same again for exchange servers.

So when I create an exchange server host definition it will inherit both the windows-servers and the exchange-servers host groups. This has the two distinct advantages the first is I can update all windows-servers with new checks (or remove them) with one assignment the other is when I clone an exchange server the definitions will be persistent on both because I have assigned the host groups from the host definition.

You can also use templates to achieve the same thing... there's 10 different ways to skin a cat you just have to pick the one that's easiest for you to manage.

Re: Closing hosts with services?

Posted: Wed Nov 30, 2011 2:15 pm
by epx998
Yeah that is just awesome. I have 15 servers in a cluster that have about 30 identical tests. I create each test once and assign it to a hostgroup and each node inherits the test. Much happiness. Thanks for pointing that out.

Cheers!

Re: Closing hosts with services?

Posted: Wed Nov 30, 2011 4:22 pm
by jsmurphy
You're most welcome :D