Bootstrap FreeKB - OpenShift - Silence Alert Manager Alerts using amtool
OpenShift - Silence Alert Manager Alerts using amtool

Updated:   |  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 add command can be used to silence an alarm. In this example, alarmname FluentdNodeDown is silenced for 1 day.

oc exec pod/alertmanager-main-0 \
--namespace openshift-monitoring -- \
amtool silence add 'alertname=FluentdNodeDown' \
--alertmanager.url="http://localhost:9093" \
--duration="1d" \
--comment="temporarily silencing this alert for 1 day" 
--author john.doe

 

And the 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

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter b02f40 in the box below so that we can be sure you are a human.