Files
devops-infra-helm-charts-gcp/helm-overrides/k8s-admin-prd-ase1/alertmanager/migrate_silenced_alerts
T
2026-08-26 03:39:42 +05:30

22 lines
1006 B
Plaintext

Here are the steps on how to migrate silenced alerts from an older Alertmanager to a newer Alertmanager machine:
1. Stop the old Alertmanager.
2. Export the silenced alerts from the old Alertmanager. You can use the following command:
amtool -o json --alertmanager.url=http://devops-p-alertmanager-01b.meeshoint.in:9093 silence > silenced_alerts.json
3. Copy the silenced_alerts.json file to the new Alertmanager machine.
k cp helm-overrides/prod-ops-cluster/alertmanager/silenced_alerts.json alertmanager/prd-infra-alertmanager-1:/home -c alertmanager
4. Exec into the new Alertmanager.
k exec -it prd-infra-alertmanager-1 -c alertmanager -- sh
5. Import the silenced alerts into the new Alertmanager. You can use the following command:
amtool --alertmanager.url=https://prd-infra-alertmanager.meesho.com silence import ../home/silenced_alerts.json
Note:
1. If you are running alertmanager on K8s as STS, then you only need to import in any 1 of the pods else duplicate silences will be created.