Multiple Inheritance Sources

Support requests, bug reports, questions etc.
john_moody
beginner
beginner
Posts: 8
Joined: Sat Jul 09, 2011 13:31

Multiple Inheritance Sources

Post by john_moody » Tue Jul 24, 2012 05:11

It seems if you 'use' multiple service templates, the values in the first one listed take priority (weird, I know). This impacts applying a service template to distributed collectors. The values in the template applied to each distributed collector can't override any values configured in the service template already applied to the host.

define service {
service_description <service name>
check_command <check_command>
use generic,dist_monitor
}

For example, if the 'generic' template enabled notifications, and the 'dist_monitor' template disabled notifications, it would be the 'generic' template that wins. Any chance NConf could build the 'use' parameter in reverse?

Thanks in advance!!

User avatar
scrat
NConf enthusiast
NConf enthusiast
Posts: 101
Joined: Mon Aug 23, 2010 16:28
Location: Vienna, Austria
Contact:

Re: Multiple Inheritance Sources

Post by scrat » Wed Jul 25, 2012 11:35

Hi,

The best way would be to not use templates for distributed setups.
If you don't have a Nagios server which is both monitor and collector, you don't need templates as you can disable/enable notifications, active, passive checks,... in nagios.cfg which makes the config a lot easier...


Regards,
René

john_moody
beginner
beginner
Posts: 8
Joined: Sat Jul 09, 2011 13:31

Re: Multiple Inheritance Sources

Post by john_moody » Thu Jul 26, 2012 03:34

Thanks Rene, that is the solution I have used. The suggestion was to avoid confusion for future users. I can't imagine it would be too hard to reverse the order that the templates are written to the config file, so that any implied inheritance would work as expected.

Thanks again!

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: Multiple Inheritance Sources

Post by agargiulo » Mon Feb 18, 2013 19:28

Hi. At the time we implemented this order of inheritance, it was assumed that it would be clearer to the user if the template he assigned himself to the host would take precedence over any templates added later by the system.

One way to successfully use templates in a distributed monitoring environment would be to completely leave out certain options in your "generic" template (e.g. active-checking) and to assign this property only over collector / monitor templates.
NConf offers the option of assigning different templates in the distributed-collector and central-monitor config sets.
Simply have a look at the settings of the collector / monitor items in NConf.

Locked