I needed to have some contact_group inheritances between host-templates / service-templates, which don't overwrite the contact_group defined on the host/service.
For that, I've written a patch that add an option in the nconf.php file:
a new variable FORCE_CONTACTGROUPS_APPEND can be set to globally change the way that contactgroups are added when inherited
- 0: overwrite existing contact groups. this is the default and actual behaviour
- 1: append to existing contact groups (add the '+' prefix)
So, when the FORCE_CONTACTGROUPS_APPEND option is set to 1, a character '+' will be added in front of the contact_groups lists when writing the following classes to nagios cfg files:
- host
- service
- advanced-service
- host-template
- service-template
Attached the patch: That would be great to have in future release of NConf something more flexible.
For exemple, a radio button below every contact_group selector. Something similar to what is already implemented when multimodifying contactgroups of some services.
- selecting 'overwrite' would trigger the actual behaviour.
- selecting 'append' would add a '+' to the contactgroup list, which indicates that a '+' character will be added in front of the contact_group list when written in the nagios cfg file.
Yannick