On 2021-11-16 12:29, rajendar t wrote:
Is there any way we can run pod based on the alert fired from
Prometheus , we have a scenario where we need to execute a pod based
on the disk pressure threshold. I am able to create alert , but I need
to execute a pod .How can I achieve that

groups:
  - name: node_memory_MemAvailable_percent
    rules:
    - alert: node_memory_MemAvailable_percent_alert
      annotations:
        description: Memory on node {{ $labels.instance }} currently
at {{ $value }}%
          is under pressure
        summary: Memory usage is under pressure, system may become
unstable.
      expr: |
        100 - ((node_memory_MemAvailable_bytes{job="node-exporter"} *
100) / node_memory_MemTotal_bytes{job="node-exporter"}) > 80
      for: 2m
      labels:
        severity: warning


You can use a webhook to do anything you want. Just create a small app (using whatever language you wish) that listens for webhook notifications from Alertmanager than then executes your code when triggered. You can then set your alert routing to send the notification for the alert(s) you wish.

--
Stuart Clark

--
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/50a8527cdea919d34b3496bdc6fdebad%40Jahingo.com.

Reply via email to