I've been building a Nagios configuration with the new built-in types and just noticed that there seems to be no way to create template definitions in Nagios. I've only tried to do (nagios) templates with the nagios_host and nagios_service types but it's likely to affect some of the others, if not all of the nagios types.
heres an example:
# template definition
define host {
name generic-host
contact_groups admins
}
# host definition that uses the template above
define host {
host_name foo
use generic-host
}
The problem with the nagios_host type is that the namevar is host_name and there's no parameter called "name"
Same problem with nagios_server{}, except in that case the namevar is service_description.
In both cases, you need to leave the parameter that maps to the namevar out (which is impossible) and you need a parameter in the nagios config called 'name'.
I don't know how difficult this would be to implement but the ideal interface would be a template=>true parameter on the nagios types that changes service_description or host_name or whatever the namevar maps to to 'name'.