I am attempting to clean up a rather large Nagios installation that I have inherited from another admin. I’ve defined a number of templates that I’m not trying to apply to hosts and am running into an issue which I hope someone can shed some light on.
Here’s what I’m doing. Say I’ve defined template1 and template2. If I then define a host like this:
define host {
use template1
hostname server-xyz
address 192.168.100.123
}
Everything works fine, Nagios verifies and all the settings from template1 are inherited properly. If I define it like this:
define host {
use template1,template2
hostname server-xyz
address 192.168.100.123
}
Nagios will throw an error when I try and verify my config saying:
“Error: Template ‘template1,template2’ specified in host definition could not be not found”.
According to the documentation I should be able to use multiple templates on a single object, however when I try to do so it doesn’t work. Its like Nagios can’t tell the “,” isn’t part of the template name or something. I searched on both Google and a couple forums but if this is a known issues I couldn’t find any reference to it. I can’t be the only person trying to use multiple templates in a single object.
I can get around it by chaining templates (i.e. have make a template 3 which uses both 1&2) but this is pretty clumsy for my environment. If anyone could shed some light on why this isn’t working I’d appreciate it.
Thanks.