S
S
shell_guy2021-12-21 17:49:22
Devops
shell_guy, 2021-12-21 17:49:22

How to edit Prometheus config to send an alert when a node is more than 2 minutes down?

Good day!
Please tell me how to solve the following. problem: Prometheus sends alerts even if there are short-line signal losses on the switch, for example, and spam to slack.
How to make it so that 1 alert is sent if the node lies for more than 2 minutes in a row? What rule should be added and in what config? Thank you very much

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-12-21
@shell_guy

Correct the rule, in for write 2m like this:

- alert: Node down
    expr: up{job="node_exporter"} == 0
    for: 2m
    labels:
      severity: warning
    annotations:
      title: Node {{ $labels.instance }} is down
      description: Failed to scrape {{ $labels.job }} on {{ $labels.instance }} for more than 3 minutes. Node seems down.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question