Alerts notification stopped sending

I’ve created some checks and configured the notification rules and notification endpoint from the UI and it all worked as expected for a week until suddenly I can’t recieve no notifications on my endpoint (http)!
Any idea why this can happen??

Show us some detail.

For example:

  • demonstrate that the HTTP endpoint is listening
  • show us the relevant bits of your configuration
  • show us what appears in the log files when a notification is supposed to be
    sent

Basically, give us enough information to understand what your setup is, and
either reproduce it for oursleves, or compare it with one that works.

No detail means people can only guess, and that’s normally not helpful :slight_smile:

Antony.

1 Like

Sorry, This is the endpoint rule (task) configuration. It was generated automatically while creating the task from the UI.

import "influxdata/influxdb/monitor"

import "http"

import "json"

import "experimental"

option task = {name: "notification-crit-warning", every: 12s, offset: 2s}

headers = {"Content-Type": "application/json"}

endpoint = http["endpoint"](url: "http://myendpoint")

notification = {_notification_rule_id: "098c6a16f0caf000", _notification_rule_name: "notification-crit-warning", _notification_endpoint_id: "098c04e331f09000", _notification_endpoint_name: "Checks-alerts"}

statuses = monitor["from"](start: -24s)

crit_to_warn = statuses |> monitor["stateChanges"](fromLevel: "crit", toLevel: "warn")

all_statuses = crit_to_warn |> filter(fn: (r) => r["_time"] >= experimental["subDuration"](from: now(), d: 12s))

all_statuses |> monitor["notify"](data: notification, endpoint: endpoint(mapFn: (r) => {

body = {r with _version: 1}

return {headers: headers, data: json["encode"](v: body)}

}))

The endpoint is responding when i use http.post().