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

unable to call macro in notifications #2194

Closed
pradeepbbl opened this issue Nov 27, 2017 · 1 comment
Closed

unable to call macro in notifications #2194

pradeepbbl opened this issue Nov 27, 2017 · 1 comment

Comments

@pradeepbbl
Copy link
Contributor

Hi,

We are running the latest code from upstream and we are trying to add common macro body to post notification, but it failing with error conf: Test Config:21:5: at <macro = jabber_post>: macro not found: jabber_post

Please find the sample config mentioned below

template jabber_body {
    jabberAlertBody = `{
          text: "this is a {{.Subject}}"
    }`
}

template jabber {
    subject = "Test"
    body = ''
    inherit = jabber_body
}

macro jabber_post {
    bodyTemplate = jabberAlertBody
}

notification jabber {
     post = https://XXXXXXXXXXXXXXX/api/v2/notify/jabber?send_to=test@XXXXXXXX
     macro = jabber_post
}

alert test {
   template = jabber
   crit = 1
   critNotification = jabber
}
@pradeepbbl
Copy link
Contributor Author

@kylebrandt, just FYI as discussed it can be fixed by changing the macro load sequence cmd/bosun/conf/rule/rule.go#L183

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