OpenShift - List Alert Manager Silenced Alerts using amtool
by
Jeremy Canfield |
Updated: January 22 2024
| OpenShift articles
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
In the openshift-monitoring namespace, there should be one or more alertmanager pods.
~]$ oc get pods --namespace openshift-monitoring
NAME READY STATUS RESTARTS AGE
alertmanager-main-0 6/6 Running 0 6d10h
alertmanager-main-1 6/6 Running 1 (6d10h ago) 6d10h
The oc exec command can be used to run the amtool CLI in one of the alertmanager pods. The amtool silence command can be used to list the silenced alerts.
~]$ oc exec pod/alertmanager-main-0 --namespace openshift-monitoring -- amtool silence --alertmanager.url="http://localhost:9093"
ID Matchers Ends At Created By Comment
d86e8aa8-91f3-463d-a34a-daf530682f38 alertname="FluentdNodeDown" 2024-01-20 09:29:29 UTC john.doe temporarily silencing this alert for 1 day
Or, the amtool alert command with the --silenced flag can be used.
~]$ oc exec pod/alertmanager-main-0 --namespace openshift-monitoring -- amtool --alertmanager.url="http://localhost:9093" alert --silenced
ID Matchers Ends At Created By Comment
d86e8aa8-91f3-463d-a34a-daf530682f38 alertname="FluentdNodeDown" 2024-01-20 09:29:29 UTC john.doe temporarily silencing this alert for 1 day
Did you find this article helpful?
If so, consider buying me a coffee over at