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

Opsgenie Stream Connector does not close alerts #160

Open
agougo opened this issue Oct 10, 2023 · 0 comments
Open

Opsgenie Stream Connector does not close alerts #160

agougo opened this issue Oct 10, 2023 · 0 comments

Comments

@agougo
Copy link

agougo commented Oct 10, 2023

Description

When an alert is closed, any monitoring system (including Centreon) should not send a new alert in Opsgenie, but it should close the existing one.

Steps to Reproduce

This is reproducible by just shutting down a host (Centreon will send a Critical notification) and then powering it up (Centreon will send an OK notification).

Describe the received result

The received result is a new alert in Opsgenie

Describe the expected result

The expected result is to close the existing alert in Opsgenie.

Additional relevant information

Opsgenie has a feature called alert de-duplication. This feature is used for 2 things:
/ To increment existing alerts, and thus reducing incoming noise to Opsgenie
/ To close an alert if the issue is shown as resolved in Centreon

Opsgenie does that by using the Alias field. The best way to do it (for example for a service) would be to change this line:

alias = string.sub(event.cache.host.name .. "" .. event.cache.service.description .. "" .. state, 1, 512)
to this line
alias = string.sub(event.cache.host.name .. "_" .. event.cache.service.description, 1, 512)

... so that the alias is the same for the critical event and the OK event.

And then, for Closing the alert to send a POST request to the https://api.opsgenie.com/v2/alerts/:identifier:/close URL - instead of the https://api.opsgenie.com/v2/alerts, as per the Close Alert API documentation: https://docs.opsgenie.com/docs/alert-api#close-alert

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