【问题标题】:Prometheus Alertmanger delete All silences using curl. REST APIPrometheus Alertmanager 使用 curl 删除所有静音。 REST API
【发布时间】:2020-04-14 18:33:55
【问题描述】:

如何使用 curl 删除 Prometheus Alertmanger 中所有现有的静音。

我尝试使用它但得到404 page not found

curl -X DELETE http://alerts.example.org:9093/api/v1/silence/<silenceId>

如何删除所有静音?像

curl -X DELETE http://alerts.example.org:9093/api/v1/silence/*

【问题讨论】:

    标签: prometheus prometheus-alertmanager


    【解决方案1】:

    您不能仅使用 curl 命令删除所有静音,但您可以使用以下命令列出所有静音 ID:

    curl -X GET http://alerts.example.org:9093/api/v1/silences | jq --raw-output '.data[].id'
    
    9e2d7680-8543-447f-9776-db513fa88b3b
    1e37bb70-a6ae-4247-b748-fd7aee838140
    6dac91c5-08a7-4a14-8dac-7137c61ae94d
    

    然后使用“curl -X DELETE”命令删除。

    【讨论】:

    • 你能批准这个答案吗?谢谢。
    猜你喜欢
    • 1970-01-01
    • 2019-07-15
    • 1970-01-01
    • 2021-07-13
    • 1970-01-01
    • 1970-01-01
    • 2022-06-12
    • 2021-03-29
    • 2022-07-13
    相关资源
    最近更新 更多