Service Template Question?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagiosnewbie
Posts: 3
Joined: Thu Oct 06, 2011 4:34 pm

Service Template Question?

Post 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!
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Service Template Question?

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Service Template Question?

Post 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.
Locked