Skip to content

Commit

Permalink
[test_alerts] Update the command for checking the alert in alert mana…
Browse files Browse the repository at this point in the history
…ger (#179)

The prometheus container in the prometheus-default pod no longer has wget included
The equivalent curl command is used instead.
  • Loading branch information
elfiesmelfie authored Nov 29, 2024
1 parent 097c999 commit 28a8b74
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
- name: "RHELOSP-148698 Verify that the alert is active in Alertmanager"
ansible.builtin.shell:
cmd: >-
oc exec -it prometheus-default-0 -c prometheus -- /bin/sh -c 'wget --header \
oc exec -it prometheus-default-0 -c prometheus -- /bin/sh -c 'curl -k -H \
"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
https://default-alertmanager-proxy:9095/api/v1/alerts -q -O -' | grep 'active' | grep 'Collectd metrics receive rate is zero' | wc -l
https://default-alertmanager-proxy:9095/api/v1/alerts' | grep 'active' | grep 'Collectd metrics receive rate is zero' | wc -l
register: cmd_output
changed_when: false
failed_when: cmd_output.stdout|int == 0
Expand Down

0 comments on commit 28a8b74

Please sign in to comment.