Configuring Alert Forwarding
Describes how to forward alerts via SMTP or Slack and configure the alert policies by
updating the alertmanager_config.yaml file.
Prerequisites:
- Sign in to HPE Ezmeral Unified Analytics Software as an administrator.
- Have access to a terminal where
kubectlis installed to interact with your Kubernetes cluster.
Steps:
To configure alert policies and forward alerts via SMTP or Slack, complete the following
steps:
-
On the Prometheus namespace, run the following command to list secrets:
kubectl get secrets -n prometheus -
In the list of secrets, locate the secret named
alertmanager-prometheus-kube-prometheus-alertmanager. -
Extract the base64-encoded Alertmanager configuration from the
alertmanager_config.yamlfile:kubectl get secret alertmanager-prometheus-kube-prometheus-alertmanager -n prometheus -o jsonpath="{.data.alertmanager\.yaml}" | base64 -d > alertmanager_config.yaml -
Open the
alertmanager_config.yamlfile in a text editor. -
Update the email settings under the
email_configssection and the Slack settings under theslack_configssection. You can also configure the additional notification channels as required. To learn more about these settings, see Understanding the Prometheus Alertmanager Configuration File. -
Delete the existing Alertmanager configuration secret:
kubectl delete secret alertmanager-prometheus-kube-prometheus-alertmanager -n prometheus -
Create the updated Alertmanager configuration secret:
kubectl create secret generic alertmanager-prometheus-kube-prometheus-alertmanager -n prometheus --from-file=alertmanager.yaml=alertmanager_config.yaml -
Force restart the Alertmanager pod to reload its configuration:
kubectl delete pod alertmanager-prometheus-kube-prometheus-alertmanager-0 -n prometheus
Results:
You have updated the alertmanager_config.yaml file to forward alerts via
SMTP or Slack.