Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overrides do not work #40

Open
flybyray opened this issue Sep 26, 2022 · 0 comments
Open

overrides do not work #40

flybyray opened this issue Sep 26, 2022 · 0 comments

Comments

@flybyray
Copy link

I use the director configuration approach.
A badhost!slack-notifications-notification-hosts will be generated.
But my channel configuration #ops-on-call will be overriden by the default #monitoring_alerts.

Relevant output icinga2 object list --name 'badhost!slack-notifications-notification-hosts'

  % declared in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 57:1-57:67
  * __name = "badhost!slack-notifications-notification-hosts"
...
  * templates = [ "slack-notifications-notification-hosts", "slack-notifications-user-configuration-hosts", "slack-notifications-default-configuration-hosts", "slack-notifications-configuration", "slack-notifications-user-configuration", "slack-notifications-default-configuration" ]
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 57:1-57:67
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-user-configuration.conf', lines 8:1-8:68
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 51:1-51:71
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 39:1-39:57
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-user-configuration.conf', lines 1:0-1:61
    % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 1:0-1:64
...
    * slack_notifications_channel = "#monitoring_alerts"
      % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-user-configuration.conf', lines 11:5-11:53
      % = modified in '/etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf', lines 60:3-60:57
...

I guess the last one will override.

The following can be found on the relevant lines/

tail -n +11 < /etc/icinga2/zones.d/global-templates/slack-notifications-user-configuration.conf | head -n 1

    vars.slack_notifications_channel = "#ops-on-call"

Defined in template slack-notifications-user-configuration-hosts

tail -n +60 < /etc/icinga2/zones.d/global-templates/slack-notifications-configuration.conf | head -n 1

  vars.slack_notifications_channel = "#monitoring_alerts"

Defined in template slack-notifications-notification-hosts

  • I also tried to define the channel in slack-notifications-user-configuration but this has the same effect.
  • I am not sure if icinga2 is using the array order of templates somehow, therefore i included it in icinga2 object list ... output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant