From fee5a5b389bc5e47c2ac9393082f7fd7b0d36e2e Mon Sep 17 00:00:00 2001 From: Jan Horstmann Date: Fri, 3 May 2024 16:28:15 +0200 Subject: [PATCH] Allow check of prometheus alert status Part of https://github.com/osism/issues/issues/1009 Signed-off-by: Jan Horstmann --- playbooks/deploy.yml | 9 +++++++++ scripts/check/303-prometheus-alert-status.sh | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100755 scripts/check/303-prometheus-alert-status.sh diff --git a/playbooks/deploy.yml b/playbooks/deploy.yml index f6e3c2672..d1230c5df 100644 --- a/playbooks/deploy.yml +++ b/playbooks/deploy.yml @@ -29,6 +29,7 @@ in_a_nutshell: "{{ nutshell | default(false) | bool }}" run_refstack: "{{ refstack | default(false) | bool }}" + run_prometheus_alert_status: "{{ prometheus_alert_status | default(false) | bool }}" tasks: - name: Set facts (Zuul deployment) @@ -197,3 +198,11 @@ - not manual_deploy | bool - run_refstack | bool changed_when: true + + - name: Check prometheus alert status + ansible.builtin.command: + cmd: "ssh -i {{ terraform_path }}/.id_rsa.{{ cloud_env }} dragon@{{ manager_host }} /opt/configuration/scripts/check/303-prometheus-alert-status.sh" + when: + - not manual_deploy | bool + - run_prometheus_alert_status | bool + changed_when: true diff --git a/scripts/check/303-prometheus-alert-status.sh b/scripts/check/303-prometheus-alert-status.sh new file mode 100755 index 000000000..3f5664920 --- /dev/null +++ b/scripts/check/303-prometheus-alert-status.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -x +set -e + +echo +echo "# Checking for active prometheus alerts" +echo + +osism apply prometheus-alert-status