Object inheritance - Clarification please


#1

Hi,
I’ve managed to get Nagios v2.3.1 up and running and started to experiment with object inheritance.
Just read the chaper on Object Inheritance in the PDF but I’ve been unable to work.
From the examples, the “template” appear to be placed within the same cfg file that uses it.

If I have a folder structure for my servers such as /nagios/etc/servers which has seperate cfg files for different buildings, ie building1.cfg, building2.cfg.
ie /nagios/etc/servers/building1.cfg
/nagios/etc/servers/building2.cfg
and want the same notification options, check_commands etc etc

Would I need to create the same template within each building cfg file or can I create a single generic template that’s located centrally away from the cfg files but allow all cfg’s access to it ? I hope that was clear.

I’ve tried the latter but it doesn’t seem to work.
The error -> Template ‘generic_template’ specified in host definition could not be not found.

Could someone clarifiy if the latter is possible and how to achieve this ?
TIA


#2

The template must be in the same file, from what I can tell. But I may be wrong. Since you have already tested this, then it looks like that is the case then right?