Page 1 of 1

Service Template Question?

Posted: Tue Nov 08, 2011 5:38 pm
by nagiosnewbie
Here is my situation:

I want to create templates for my Nagios systems based on the type of services they provide. For example: I want to make a service check template to apply to all my generic Linux, generic Windows, jboss, Apache, etc.... so when I add a new system I just put a base template on it and get 90% of my checks done. My question comes in the fact that there doesn't seem to be a way to do it simply... It looks like I would have to create a "ping check template", "mount check template", "SSH check template" and just combine them all into a "General Linux" template to accomplish this. Please tell me there is an easlier way. Thanks in advance for your help!

Re: Service Template Question?

Posted: Wed Nov 09, 2011 2:37 pm
by mguthrie
What you're wanting to create is the easiest way, and it does work that way. Templates are extremely flexible and they work by inheritance. So you could have a templating system like the following. Template configs that are farther down in the tree will override settings in the earlier base templates. So you could devise a system like the following.

Base Template - > Ping Template -> Location X Services Template -> Service definition

The following doc explains it much better than what I just did.
http://nagios.sourceforge.net/docs/3_0/ ... tance.html

Re: Service Template Question?

Posted: Wed Nov 09, 2011 5:49 pm
by jsmurphy
Alternatively use the power of host groups!

Generic service template ==> Service(s) ==> Linux Hostgroup,Application Hostgroup <==> linux host(s)

A single host can inherit multiple hostgroups so have Base OS host groups + Application host groups and have the host(s) inherit the ones they need.