Firing an alert on alertmanager with curl

2025-05-10

You can use curl to fire an alert on alertmanager. It is very useful when testing alert processors or alertmanager routes.

cat <<EOF | curl -v -H 'Content-Type: application/json' -d @- https://alertmanager.example.com/api/v2/alerts
[
    {
        "labels": {
            "alertname": "OnurTest",
            "severity": "warning"
            "somelabel": "somevalue",
        },
        "annotations": {
            "summary": "Test alert by onur, please ignore"
        }
    }
]
EOF