Skip to content

how to configure the deadman function to trigger a warning alert instead of a critical alert in kapacitor #2802

Description

@bhuvanabalraj

Goal is to configure the deadman function in Kapacitor to trigger a warning alert instead of a critical alert, when there is no metrics form the measurement , Looks like deadman by default when there is no metrics, it is triggering critical alert. tried to run the script with Level tag and without level tag to trigger only warning when there is no metrics but still no luck. Appreciate some ideas to get this fixed.

var data = stream
|from()
.measurement(measurement)
.where(where_filter)
.groupBy(group_by)
|window()
.period(period)
.every(every)
|default()
.field(field_upper, 0.0)

var nodata = data
|deadman(deadman_threshold, deadman_interval)
.id(id)
.message(message)
.stateChangesOnly()
//.levelTag('level')
//.warn(lambda: "level" == 'CRITICAL')
//.warnReset(lambda: "level" == 'OK'
.warn(lambda: "emitted" <= deadman_threshold)
.warnReset(lambda: "emitted" > deadman_threshold)
.topic(topic) // Comment out .topic to disable alert sending and uncomment .log to write alerts to file
//.log('/tmp/alerts.log')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions