From 9acda61d44037605b9d90df462af9725146052fe Mon Sep 17 00:00:00 2001 From: Chris Sibbitt Date: Thu, 19 Jan 2023 14:54:14 -0500 Subject: [PATCH] Fixed alertmanager verification command (#430) (cherry picked from commit f7200112a0d0b801e6faab27c07aa31d763c42c6) --- ...lert-route-with-templating-in-alertmanager.adoc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/doc-Service-Telemetry-Framework/modules/proc_creating-an-alert-route-with-templating-in-alertmanager.adoc b/doc-Service-Telemetry-Framework/modules/proc_creating-an-alert-route-with-templating-in-alertmanager.adoc index 19303fe6..8a7fcca1 100644 --- a/doc-Service-Telemetry-Framework/modules/proc_creating-an-alert-route-with-templating-in-alertmanager.adoc +++ b/doc-Service-Telemetry-Framework/modules/proc_creating-an-alert-route-with-templating-in-alertmanager.adoc @@ -94,27 +94,17 @@ route: ---- -. Run the `curl` command against the `alertmanager-proxy` service to retrieve the status and `configYAML` contents, and verify that the supplied configuration matches the configuration in Alertmanager: +. Run the `wget` command from the prometheus pod against the `alertmanager-proxy` service to retrieve the status and `configYAML` contents, and verify that the supplied configuration matches the configuration in Alertmanager: + [source,bash,options="nowrap"] ---- -$ oc run curl -it --serviceaccount=prometheus-k8s --restart='Never' --image=radial/busyboxplus:curl -- sh -c "curl -k -H \"Content-Type: application/json\" -H \"Authorization: Bearer \$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://default-alertmanager-proxy:9095/api/v1/status" +$ oc exec -it prometheus-default-0 -c prometheus -- /bin/sh -c "wget --header \"Authorization: Bearer \$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://default-alertmanager-proxy:9095/api/v1/status -q -O -" {"status":"success","data":{"configYAML":"...",...}} ---- . Verify that the `configYAML` field contains the changes you expect. - -. To clean up the environment, delete the `curl` pod: -+ -[source,bash] ----- -$ oc delete pod curl - -pod "curl" deleted ----- - .Additional resources * For more information about the {OpenShift} secret and the Prometheus operator, see https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/alerting.md[Prometheus user guide on alerting].