Page 1 of 1

template use for a new setup

Posted: Wed Aug 15, 2012 1:26 pm
by rlacasse
Hi all,
I'm relatively new to Nagios and in the process of deploying a new XI server. This server will be monitoring 300+ servers, many of which perform similar functions. In parallel, I'm writing new scripts that'll feed information to Nagios for monitoring purposes.

What I'm trying to prevent is modifying each host entry with new services every time a new script is available. I've read over many posts and it seems templates is the way to go but I can't find any document on how to set them up. I've create host templates and service templates but I'm not sure how to join them.

I had expected to set up a host template, lets call it "ApplicationServer" and then set up multiple hosts using this template. Then, going forward, I could modify the .... something ... related to the "ApplicationServer" template so add the same service to all hosts using that template. Am I on the right track or way off? I can't seem to find that magic something the connects hosts and services.

Any help would be greatly appreciated.

Oh, I'm using Nagios XI (latest version) running in a VM.

Thanks,

Re: template use for a new setup

Posted: Wed Aug 15, 2012 1:38 pm
by mguthrie
Templates are probably the most flexible way to go.

We're actually working on XI-specific documentation for this as we speak, but right now the best reference for these concepts is actually the Nagios Core documentation:
http://nagios.sourceforge.net/docs/3_0/ ... ricks.html
http://nagios.sourceforge.net/docs/3_0/ ... tance.html

The other method to look into would be to add a service to a hostgroup instead of a single host, or a list of hosts. That way if it's the same service for 300 hosts, you only have to maintain one definition, and if you add hosts to that hostgroup, they'll get that service as well.

Templates as well as Host and Service configs are managed through the Configure->Core Config Manager in Nagios XI.

Re: template use for a new setup

Posted: Wed Aug 15, 2012 1:41 pm
by nscott
mgurthrie covered most of this, but to reiterate:

I will open with this document, so you just open that up in a new tab. Its pictorial guide to host management in XI, which will be invaluable for you going forward. It discusses how to add hosts, services, hostgroups and host templates. Now to discuss the actual architecture of your XI server:

From what I am gathering, it sounds like you are looking for hostgroups. You can put hosts in host groups, and have services assigned hostgroups, that way, whenever you add a host to a certain hostgroup, that host will get all that certain hostgroups associated services.

Templates will come in handy if you're adding a large chunk of a certain type of host, lets say for instance Windows Servers. Then you just make template, specify the hostgroup (from previous paragraph) for this template, contacts etc and you're done. Then just create a bunch of hosts using that template.

I hope this answers your question.

Re: template use for a new setup

Posted: Wed Aug 15, 2012 1:50 pm
by lmiltchev
If you've already created your templates, you can go to the Nagios Core Config Manager->Hosts (or Services) ->...->Modify and insert the template you would like to use under the "Common Settings" tab.

If you had a service, already configured, to save time, you can add this service to multiple hosts, or add it to a hostgroup.

I think you will find this document helpful:

http://nagios.sourceforge.net/docs/nagi ... tance.html

Hope this helps.

Re: template use for a new setup

Posted: Thu Aug 16, 2012 6:58 am
by rlacasse
Excellent thank you. For whatever reason I missed that you could add a service to a host group, that worked like a charm.

Thanks again
René

Re: template use for a new setup

Posted: Thu Aug 16, 2012 8:32 am
by lmiltchev
I'm glad I could help.