From 45acf7f13d99320f61cc087d5463546347103b88 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 --- environments/generic/configuration.yml | 6 ++++++ environments/kolla/configuration.yml | 12 +++++++----- playbooks/deploy.yml | 9 +++++++++ scripts/check/303-prometheus-alert-status.sh | 9 +++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100755 scripts/check/303-prometheus-alert-status.sh diff --git a/environments/generic/configuration.yml b/environments/generic/configuration.yml index b420780c9..b0aea9ca3 100644 --- a/environments/generic/configuration.yml +++ b/environments/generic/configuration.yml @@ -7,3 +7,9 @@ dotfiles_repo_version: main dotfiles_repo_local_destination: "~/dotfiles" dotfiles_files: - .tmux.conf + +prometheus_alert_status_filter: + alertname: + - PrometheusAlertmanagerE2eDeadManSwitch + severity: + - info diff --git a/environments/kolla/configuration.yml b/environments/kolla/configuration.yml index fe35d1656..d7f1d242c 100644 --- a/environments/kolla/configuration.yml +++ b/environments/kolla/configuration.yml @@ -18,14 +18,15 @@ openstack_cacert: /etc/ssl/certs/ca-certificates.crt # openstack # enable services -enable_aodh: "yes" +enable_aodh: "no" enable_barbican: "yes" enable_ceilometer: "yes" enable_ironic: "yes" -enable_magnum: "yes" -enable_manila: "yes" -enable_senlin: "yes" -enable_skyline: "yes" +enable_magnum: "no" +enable_manila: "no" +enable_senlin: "no" +enable_skyline: "no" +enable_heat: "no" # generic openstack_service_workers: 2 @@ -76,6 +77,7 @@ ironic_dnsmasq_dhcp_range: "192.168.112.50,192.168.112.60" ironic_dnsmasq_dhcp_ranges: - range: "192.168.112.50,192.168.112.60" ironic_cleaning_network: "public" +enable_ironic_prometheus_exporter: "no" # ceilometer enable_ceilometer_prometheus_pushgateway: "yes" diff --git a/playbooks/deploy.yml b/playbooks/deploy.yml index 4eb23bf75..94479b39d 100644 --- a/playbooks/deploy.yml +++ b/playbooks/deploy.yml @@ -29,6 +29,7 @@ _nutshell: "{{ nutshell | default(false) | bool }}" _tempest: "{{ tempest | default(false) | bool }}" + _prometheus_alert_status: "{{ prometheus_alert_status | default(false) | bool }}" _ceph_stack: "{{ ceph_stack | default('ceph-ansible') }}" @@ -235,3 +236,11 @@ - not manual_deploy | bool - _tempest | 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