Feature to force contact_groups append instead of overwrite#7
Open
Tontonitch wants to merge 1 commit into
Open
Feature to force contact_groups append instead of overwrite#7Tontonitch wants to merge 1 commit into
Tontonitch wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature to force contact_groups append instead of overwrite
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)
Note that currently the default behaviour changes for host and service depending on the SUPERADMIN_GROUPS definition (if prefixed by a '+' or not).
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
For exemple, it is now possible to have multiple templates on the same host, and contact_groups on that host will be the sum of every contact_groups (every linked templates + host).
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.
Related forum topic:
http://forum.nconf.org/viewtopic.php?f=20&t=867