diff --git a/ansible/playbooks/haproxy_exporter.yml b/ansible/playbooks/haproxy_exporter.yml deleted file mode 100644 index 1177e49694..0000000000 --- a/ansible/playbooks/haproxy_exporter.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# Ansible playbook that makes sure the base items for all nodes are installed -- hosts: all - gather_facts: yes - tasks: [ ] - -- hosts: haproxy_exporter - become: true - become_method: sudo - roles: - - haproxy_exporter diff --git a/ansible/playbooks/prometheus.yml b/ansible/playbooks/prometheus.yml index 45f232cd41..b7a715f228 100644 --- a/ansible/playbooks/prometheus.yml +++ b/ansible/playbooks/prometheus.yml @@ -2,7 +2,7 @@ # Ansible playbook that makes sure the base items for all nodes are installed - hosts: all - gather_facts: yes + gather_facts: true tasks: [ ] - hosts: prometheus diff --git a/ansible/playbooks/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/playbooks/roles/haproxy/templates/haproxy.cfg.j2 index 5be20b9051..7d5ab556c3 100644 --- a/ansible/playbooks/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/playbooks/roles/haproxy/templates/haproxy.cfg.j2 @@ -92,7 +92,7 @@ backend {{ back.name }} {%- if specification.stats is defined and specification.stats.enable == True %} listen stats - bind {{ specification.stats.bind_address }} + bind {{ specification.stats.bind_address }}:{{ specification.stats.port }} stats enable stats refresh 10s stats admin if { src 127.0.0.1 } @@ -100,3 +100,9 @@ listen stats stats uri {{ specification.stats.uri }} stats auth {{ specification.stats.user }}:{{ specification.stats.password }} {%- endif %} + +{%- if specification.metrics is defined and specification.metrics.enable == True %} +listen metrics + bind {{ specification.metrics.bind_address }}:{{ specification.metrics.port }} + http-request use-service prometheus-exporter if { path /metrics } +{%- endif %} diff --git a/ansible/playbooks/roles/haproxy_exporter/defaults/main.yml b/ansible/playbooks/roles/haproxy_exporter/defaults/main.yml deleted file mode 100644 index 8fc0f92546..0000000000 --- a/ansible/playbooks/roles/haproxy_exporter/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -haproxy_exporter: - file_name: - x86_64: "haproxy_exporter-0.10.0.linux-amd64.tar.gz" - aarch64: "haproxy_exporter-0.10.0.linux-arm64.tar.gz" diff --git a/ansible/playbooks/roles/haproxy_exporter/meta/main.yml b/ansible/playbooks/roles/haproxy_exporter/meta/main.yml deleted file mode 100644 index 745ba4d956..0000000000 --- a/ansible/playbooks/roles/haproxy_exporter/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: preflight_facts diff --git a/ansible/playbooks/roles/haproxy_exporter/tasks/main.yml b/ansible/playbooks/roles/haproxy_exporter/tasks/main.yml deleted file mode 100644 index 7dc35e8a12..0000000000 --- a/ansible/playbooks/roles/haproxy_exporter/tasks/main.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -- name: Create haproxy_exporter system group - group: - name: haproxy_exporter - system: true - state: present - -- name: Create haproxy_exporter system user - user: - name: haproxy_exporter - system: true - shell: "/usr/sbin/nologin" - group: haproxy_exporter - createhome: false - -- name: Set HAProxy Exporter file name to install - set_fact: - exporter_file_name: "{{ haproxy_exporter.file_name[ansible_architecture] }}" - -- name: Download HAProxy Exporter binaries - include_role: - name: download - tasks_from: download_file - vars: - file_name: "{{ exporter_file_name }}" - -- name: Create /opt/haproxy_exporter directories - file: - path: "{{ item }}" - recurse: true - owner: root - group: haproxy_exporter - mode: 0750 - state: directory - with_items: - - /opt/haproxy_exporter - -- name: Unpack haproxy_exporter binary - unarchive: - remote_src: true - src: "{{ download_directory }}/{{ exporter_file_name }}" - dest: "/opt/haproxy_exporter" - creates: "/opt/haproxy_exporter/haproxy_exporter" - extra_opts: [--strip-components=1] - owner: root - group: haproxy_exporter - mode: 0750 - check_mode: false - -- name: Load stats credentials from HAProxy - shell: >- - awk '/stats auth/ {print $3}' /etc/haproxy/haproxy.cfg - register: stats_credentials_cmd - failed_when: stats_credentials_cmd.stderr - changed_when: false - delegate_to: "{{ groups['haproxy'] | first }}" - -- name: Set credentials variable - set_fact: - stats_credentials: "{{ stats_credentials_cmd.stdout }}" - changed_when: false - -- name: Load stats uri from HAProxy - shell: >- - awk '/stats uri/ {print $3}' /etc/haproxy/haproxy.cfg - register: stats_uri_cmd - failed_when: stats_uri_cmd.stderr - changed_when: false - delegate_to: "{{ groups['haproxy'] | first }}" - -- name: Set uri variable - set_fact: - stats_uri: "{{ stats_uri_cmd.stdout }}" - changed_when: false - -- name: Load stats bind address from HAProxy - shell: >- - grep -A4 'listen stats' /etc/haproxy/haproxy.cfg | - awk '/bind/ {print $2}' - register: stats_bind_cmd - failed_when: stats_bind_cmd.stderr - changed_when: false - delegate_to: "{{ groups['haproxy'] | first }}" - -- name: Set bind address variable - set_fact: - stats_bind_address: "{{ stats_bind_cmd.stdout }}" - changed_when: false - -- name: Install haproxy_exporter service to systemd - template: - src: prometheus-haproxy-exporter.service.j2 - dest: /etc/systemd/system/prometheus-haproxy-exporter.service - owner: root - group: root - mode: 0644 - -- name: Configure systemd to use prometheus-haproxy-exporter service - systemd: - enabled: true - state: started - name: prometheus-haproxy-exporter - daemon_reload: true - -- name: Copy file_sd_haproxy_config to prometheus hosts - template: - dest: "{{ specification.config_for_prometheus.prometheus_config_dir }}/file_sd/haproxy-exporter-{{ inventory_hostname }}.yml" - src: file_sd_haproxy_config.yml.j2 - owner: root - group: root - mode: 0644 - delegate_to: "{{ item }}" - with_inventory_hostnames: - - prometheus - -- name: Restart systemd prometheus-haproxy-exporter service - systemd: - state: restarted - name: prometheus-haproxy-exporter - daemon_reload: true diff --git a/ansible/playbooks/roles/haproxy_exporter/templates/file_sd_haproxy_config.yml.j2 b/ansible/playbooks/roles/haproxy_exporter/templates/file_sd_haproxy_config.yml.j2 deleted file mode 100644 index 4e274071af..0000000000 --- a/ansible/playbooks/roles/haproxy_exporter/templates/file_sd_haproxy_config.yml.j2 +++ /dev/null @@ -1,6 +0,0 @@ -# {{ ansible_managed }} -- targets: ['{{ inventory_hostname }}:{{ specification.config_for_prometheus.exporter_listen_port }}'] - labels: -{% for item in specification.config_for_prometheus.file_sd_labels %} - "{{ item.label }}": "{{ item.value }}" -{% endfor %} diff --git a/ansible/playbooks/roles/haproxy_exporter/templates/prometheus-haproxy-exporter.service.j2 b/ansible/playbooks/roles/haproxy_exporter/templates/prometheus-haproxy-exporter.service.j2 deleted file mode 100644 index fb4c3093e6..0000000000 --- a/ansible/playbooks/roles/haproxy_exporter/templates/prometheus-haproxy-exporter.service.j2 +++ /dev/null @@ -1,13 +0,0 @@ -# {{ ansible_managed }} -[Unit] -Description={{ specification.description }} - -[Service] -User=haproxy_exporter -Group=haproxy_exporter -ExecStart=/opt/haproxy_exporter/haproxy_exporter "--haproxy.scrape-uri=http://{{ stats_credentials }}@{{ stats_bind_address }}{{ stats_uri }};csv" -SyslogIdentifier=prometheus_haproxy_exporter -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/ansible/playbooks/roles/preflight/defaults/main.yml b/ansible/playbooks/roles/preflight/defaults/main.yml index 65c9ca0112..4ec4968c63 100644 --- a/ansible/playbooks/roles/preflight/defaults/main.yml +++ b/ansible/playbooks/roles/preflight/defaults/main.yml @@ -53,7 +53,6 @@ unsupported_roles: - kafka_exporter - postgresql - postgres_exporter - - haproxy_exporter - applications - ignite - distro: CentOS @@ -94,7 +93,6 @@ unsupported_roles: - kafka_exporter - postgresql - postgres_exporter - - haproxy_exporter - applications - ignite diff --git a/ansible/playbooks/roles/prometheus/tasks/configure.yml b/ansible/playbooks/roles/prometheus/tasks/configure.yml index c2b210eb2e..d2f1c8a175 100644 --- a/ansible/playbooks/roles/prometheus/tasks/configure.yml +++ b/ansible/playbooks/roles/prometheus/tasks/configure.yml @@ -1,16 +1,36 @@ --- -- name: Load RabbitMQ's config vars - include_vars: - file: roles/rabbitmq/vars/main.yml - name: rabbitmq_config +- name: Check if Alertmanager is enabled + set_fact: + is_alertmanager_enabled: "{{ specification.alertmanager.enable | bool and (specification.alertmanager.config.receivers | length>0 ) }}" + +- name: Check RabbitMQ when: - groups.rabbitmq is defined - groups.rabbitmq | length > 0 + block: + - name: Load RabbitMQ's config vars + include_vars: + file: roles/rabbitmq/vars/main.yml + name: rabbitmq_config -- name: Set fact about RabbitMQ monitoring - set_fact: - rabbitmq_monitoring_enabled: "{{ rabbitmq_config.specification.rabbitmq_monitoring_enabled }}" - when: rabbitmq_config is defined + - name: Set fact about RabbitMQ monitoring + set_fact: + rabbitmq_monitoring_enabled: "{{ rabbitmq_config.specification.rabbitmq_monitoring_enabled }}" + +- name: Check HAproxy + when: + - groups.haproxy is defined + - groups.haproxy | length > 0 + block: + - name: Load HAproxy's config vars + include_vars: + file: roles/haproxy/vars/main.yml + name: haproxy_config + + - name: Set fact about HAproxy monitoring + set_fact: + haproxy_monitoring_enabled: "{{ haproxy_config.specification.metrics.enable }}" + haproxy_monitoring_port: "{{ haproxy_config.specification.metrics.port }}" - name: Configure prometheus template: @@ -21,6 +41,7 @@ group: prometheus mode: u=rw,g=r,o= validate: "/usr/local/bin/promtool check config %s" + backup: true notify: - Restart Prometheus diff --git a/ansible/playbooks/roles/prometheus/tasks/install.yml b/ansible/playbooks/roles/prometheus/tasks/install.yml index 21e4bda002..86b7cf2436 100644 --- a/ansible/playbooks/roles/prometheus/tasks/install.yml +++ b/ansible/playbooks/roles/prometheus/tasks/install.yml @@ -37,9 +37,6 @@ set_fact: binary_file_name: "{{ prometheus.file_name[ansible_architecture] }}" -- name: Package - debug: msg="{{ binary_file_name }}" - - name: Download Prometheus binaries include_role: name: download diff --git a/ansible/playbooks/roles/prometheus/tasks/main.yml b/ansible/playbooks/roles/prometheus/tasks/main.yml index 1c4b383f24..305de7658d 100644 --- a/ansible/playbooks/roles/prometheus/tasks/main.yml +++ b/ansible/playbooks/roles/prometheus/tasks/main.yml @@ -22,10 +22,6 @@ - "{{ ansible_distribution | lower }}.yml" - "{{ ansible_os_family | lower }}.yml" -- name: "Check if Alertmanager is enabled" - set_fact: - is_alertmanager_enabled: "{{ specification.alertmanager.enable | bool and (specification.alertmanager.config.receivers | length>0 ) }}" - - name: Include install include_tasks: install.yml @@ -34,12 +30,12 @@ - name: Include tasks if Alertmanager is enabled block: - - name: Include provide-rules + - name: Include provide-rules include_tasks: provide-rules.yml - name: Include install-alertmanager include_tasks: install-alertmanager.yml - + - name: Include configure-alertmanager include_tasks: configure-alertmanager.yml when: is_alertmanager_enabled | bool diff --git a/ansible/playbooks/roles/prometheus/tasks/upgrade/main.yml b/ansible/playbooks/roles/prometheus/tasks/upgrade/main.yml index 18b7fa6754..71647aae11 100644 --- a/ansible/playbooks/roles/prometheus/tasks/upgrade/main.yml +++ b/ansible/playbooks/roles/prometheus/tasks/upgrade/main.yml @@ -125,7 +125,6 @@ - name: Upgrade AlertManager include_tasks: upgrade/upgrade-alertmanager.yml - # Start services again if needed - name: Start services include_tasks: upgrade/start-services.yml @@ -135,3 +134,48 @@ file: path: "{{ upgrade_defaults.state_file_path }}" state: absent + +# Can be removed after 1.2 deprecation +- name: Find haproxy-exporter targets + find: + paths: "/etc/prometheus/file_sd" + patterns: "^haproxy-exporter.*.yml$" + use_regex: true + register: haproxy_exporter_filesd + +- name: Remove haproxy-exporter targets + file: + path: "{{ item }}" + state: absent + loop: "{{ haproxy_exporter_filesd.files | map(attribute='path') }}" + notify: Restart Prometheus + +- name: Check HAproxy + when: + - groups.haproxy is defined + - groups.haproxy | length > 0 + block: + - name: Load HAproxy's config vars + include_vars: + file: roles/haproxy/vars/main.yml + name: haproxy_config + + - name: Set fact about HAproxy monitoring + set_fact: + haproxy_monitoring_enabled: "{{ haproxy_config.specification.metrics.enable }}" + haproxy_monitoring_port: "{{ haproxy_config.specification.metrics.port }}" + + - name: Add HAproxy target to Prometheus config + when: haproxy_monitoring_enabled + blockinfile: + path: /etc/prometheus/prometheus.yml + backup: true + block: |2 + - job_name: 'haproxy' + static_configs: + - targets: + {% for haproxy_node in groups['haproxy'] -%} + - "{{ haproxy_node }}:{{ haproxy_monitoring_port }}" + {% endfor %} + insertafter: 'scrape_configs:' + notify: Restart Prometheus diff --git a/ansible/playbooks/roles/prometheus/templates/prometheus.yml.j2 b/ansible/playbooks/roles/prometheus/templates/prometheus.yml.j2 index 4a2ebc95f5..247f785ffe 100644 --- a/ansible/playbooks/roles/prometheus/templates/prometheus.yml.j2 +++ b/ansible/playbooks/roles/prometheus/templates/prometheus.yml.j2 @@ -50,6 +50,15 @@ scrape_configs: {% endfor %} {% endif %} +{% if haproxy_monitoring_enabled is defined and haproxy_monitoring_enabled %} + - job_name: 'haproxy' + static_configs: + - targets: + {% for haproxy_node in groups['haproxy'] %} + - "{{ haproxy_node }}:{{ haproxy_monitoring_port }}" + {% endfor %} +{% endif %} + {% if bearer_token is defined %} - job_name: 'kubernetes-apiservers' kubernetes_sd_configs: @@ -84,7 +93,7 @@ scrape_configs: insecure_skip_verify: true bearer_token: "{{ bearer_token }}" relabel_configs: - - source_labels: + - source_labels: - __meta_kubernetes_endpoints_name regex: 'node-exporter' action: keep diff --git a/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.aarch64.txt b/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.aarch64.txt index f373137c5c..eccfd3fc24 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.aarch64.txt +++ b/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.aarch64.txt @@ -95,8 +95,6 @@ python2-cryptography # for Ansible (certificate modules) python3-3.6.8 quota # for nfs-utils rabbitmq-server-3.8.9 -#rh-haproxy18 -#rh-haproxy18-haproxy-syspaths postgresql13-server samba-client samba-client-libs # for samba-client @@ -156,7 +154,6 @@ https://packages.erlang-solutions.com/erlang/rpm/centos/7/aarch64/esl-erlang_23. # Grafana package is not downloaded from repository since it was not reliable (issue #2449) https://dl.grafana.com/oss/release/grafana-8.3.2-1.aarch64.rpm # --- Exporters --- -https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-arm64.tar.gz https://github.com/danielqsj/kafka_exporter/releases/download/v1.4.0/kafka_exporter-1.4.0.linux-arm64.tar.gz https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-arm64.tar.gz @@ -193,8 +190,8 @@ https://grafana.com/api/dashboards/4279/revisions/4/download grafana_dashboard_4 https://grafana.com/api/dashboards/1860/revisions/23/download grafana_dashboard_1860.json # Kafka Exporter Overview https://grafana.com/api/dashboards/7589/revisions/5/download grafana_dashboard_7589.json -# HAproxy Servers | HAproxy -https://grafana.com/api/dashboards/367/revisions/3/download grafana_dashboard_367.json +# HaProxy backend (or frontend/servers) +https://grafana.com/api/dashboards/789/revisions/1/download grafana_dashboard_789.json # Docker and Host Monitoring w/ Prometheus https://grafana.com/api/dashboards/179/revisions/7/download grafana_dashboard_179.json # Kubernetes pod and cluster monitoring (via Prometheus) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.x86_64.txt b/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.x86_64.txt index 9be696701b..346da92d3e 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.x86_64.txt +++ b/ansible/playbooks/roles/repository/files/download-requirements/centos-7/requirements.x86_64.txt @@ -95,8 +95,6 @@ python2-cryptography # for Ansible (certificate modules) python3-3.6.8 quota # for nfs-utils rabbitmq-server-3.8.9 -rh-haproxy18 -rh-haproxy18-haproxy-syspaths postgresql13-server repmgr10-5.2.1 # used to upgrade only repmgr repmgr13-5.2.1 @@ -157,7 +155,6 @@ https://github.com/rabbitmq/erlang-rpm/releases/download/v23.1.5/erlang-23.1.5-1 # Grafana package is not downloaded from repository since it was not reliable (issue #2449) https://dl.grafana.com/oss/release/grafana-8.3.2-1.x86_64.rpm # --- Exporters --- -https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-amd64.tar.gz https://github.com/danielqsj/kafka_exporter/releases/download/v1.4.0/kafka_exporter-1.4.0.linux-amd64.tar.gz https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz @@ -194,8 +191,8 @@ https://grafana.com/api/dashboards/4279/revisions/4/download grafana_dashboard_4 https://grafana.com/api/dashboards/1860/revisions/23/download grafana_dashboard_1860.json # Kafka Exporter Overview https://grafana.com/api/dashboards/7589/revisions/5/download grafana_dashboard_7589.json -# HAproxy Servers | HAproxy -https://grafana.com/api/dashboards/367/revisions/3/download grafana_dashboard_367.json +# HaProxy backend (or frontend/servers) +https://grafana.com/api/dashboards/789/revisions/1/download grafana_dashboard_789.json # Docker and Host Monitoring w/ Prometheus https://grafana.com/api/dashboards/179/revisions/7/download grafana_dashboard_179.json # Kubernetes pod and cluster monitoring (via Prometheus) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/redhat-7/requirements.x86_64.txt b/ansible/playbooks/roles/repository/files/download-requirements/redhat-7/requirements.x86_64.txt index 6499a7cdea..bd2751297f 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/redhat-7/requirements.x86_64.txt +++ b/ansible/playbooks/roles/repository/files/download-requirements/redhat-7/requirements.x86_64.txt @@ -153,7 +153,6 @@ https://github.com/rabbitmq/erlang-rpm/releases/download/v23.1.5/erlang-23.1.5-1 # Grafana package is not downloaded from repository since it was not reliable (issue #2449) https://dl.grafana.com/oss/release/grafana-8.3.2-1.x86_64.rpm # --- Exporters --- -https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-amd64.tar.gz https://github.com/danielqsj/kafka_exporter/releases/download/v1.4.0/kafka_exporter-1.4.0.linux-amd64.tar.gz https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz @@ -190,8 +189,8 @@ https://grafana.com/api/dashboards/4279/revisions/4/download grafana_dashboard_4 https://grafana.com/api/dashboards/1860/revisions/23/download grafana_dashboard_1860.json # Kafka Exporter Overview https://grafana.com/api/dashboards/7589/revisions/5/download grafana_dashboard_7589.json -# HAproxy Servers | HAproxy -https://grafana.com/api/dashboards/367/revisions/3/download grafana_dashboard_367.json +# HaProxy backend (or frontend/servers) +https://grafana.com/api/dashboards/789/revisions/1/download grafana_dashboard_789.json # Docker and Host Monitoring w/ Prometheus https://grafana.com/api/dashboards/179/revisions/7/download grafana_dashboard_179.json # Kubernetes pod and cluster monitoring (via Prometheus) diff --git a/ansible/playbooks/roles/repository/files/download-requirements/ubuntu-18.04/requirements.x86_64.txt b/ansible/playbooks/roles/repository/files/download-requirements/ubuntu-18.04/requirements.x86_64.txt index 6dc4e38336..92f0f4df61 100644 --- a/ansible/playbooks/roles/repository/files/download-requirements/ubuntu-18.04/requirements.x86_64.txt +++ b/ansible/playbooks/roles/repository/files/download-requirements/ubuntu-18.04/requirements.x86_64.txt @@ -46,7 +46,6 @@ filebeat 7.9.2 firewalld fping gnupg2 -haproxy htop iftop jq @@ -216,7 +215,6 @@ https://packages.elastic.co/curator/5/debian9/pool/main/e/elasticsearch-curator/ # Grafana package is not downloaded from repository since it was not reliable (issue #2449) https://dl.grafana.com/oss/release/grafana_8.3.2_amd64.deb # --- Exporters --- -https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-amd64.tar.gz https://github.com/danielqsj/kafka_exporter/releases/download/v1.4.0/kafka_exporter-1.4.0.linux-amd64.tar.gz https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.16.1/jmx_prometheus_javaagent-0.16.1.jar https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz @@ -253,8 +251,8 @@ https://grafana.com/api/dashboards/4279/revisions/4/download grafana_dashboard_4 https://grafana.com/api/dashboards/1860/revisions/23/download grafana_dashboard_1860.json # Kafka Exporter Overview https://grafana.com/api/dashboards/7589/revisions/5/download grafana_dashboard_7589.json -# HAproxy Servers | HAproxy -https://grafana.com/api/dashboards/367/revisions/3/download grafana_dashboard_367.json +# HaProxy backend (or frontend/servers) +https://grafana.com/api/dashboards/789/revisions/1/download grafana_dashboard_789.json # Docker and Host Monitoring w/ Prometheus https://grafana.com/api/dashboards/179/revisions/7/download grafana_dashboard_179.json # Kubernetes pod and cluster monitoring (via Prometheus) diff --git a/ansible/playbooks/roles/upgrade/tasks/legacy-haproxy/remove-haproxy-exporter.yml b/ansible/playbooks/roles/upgrade/tasks/legacy-haproxy/remove-haproxy-exporter.yml new file mode 100644 index 0000000000..a420f77775 --- /dev/null +++ b/ansible/playbooks/roles/upgrade/tasks/legacy-haproxy/remove-haproxy-exporter.yml @@ -0,0 +1,25 @@ +--- +- name: Remove haproxy_exporter | Stop service + systemd: + state: stopped + name: prometheus-haproxy-exporter + +- name: Remove haproxy_exporter | Remove service + file: + path: /etc/systemd/system/prometheus-haproxy-exporter.service + state: absent + +- name: Remove haproxy_exporter | Remove directories + file: + path: /opt/haproxy_exporter + state: absent + +- name: Remove haproxy_exporter | Remove system user + user: + name: haproxy_exporter + state: absent + +- name: Remove haproxy_exporter | Remove system group + group: + name: haproxy_exporter + state: absent diff --git a/ansible/playbooks/roles/upgrade/tasks/load_balancer.yml b/ansible/playbooks/roles/upgrade/tasks/load_balancer.yml index f9b4c9ce25..5e522b7c69 100644 --- a/ansible/playbooks/roles/upgrade/tasks/load_balancer.yml +++ b/ansible/playbooks/roles/upgrade/tasks/load_balancer.yml @@ -3,9 +3,18 @@ include_tasks: file: "legacy-haproxy/{{ ansible_os_family }}/uninstall-haproxy.yml" +- name: load_balancer | Populate service facts + service_facts: + no_log: true + +- name: load_balancer | Remove haproxy-exporter + include_tasks: + file: "legacy-haproxy/remove-haproxy-exporter.yml" + when: ansible_facts.services["prometheus-haproxy-exporter.service"] is defined + - name: load_balancer | Upgrade haproxy service (runc) include_role: name: haproxy - vars_from: manifest + vars_from: main vars: haproxy_upgrade_enabled: true diff --git a/cli/engine/ansible/AnsibleVarsGenerator.py b/cli/engine/ansible/AnsibleVarsGenerator.py index ee73abb74c..cb7fd2be7d 100644 --- a/cli/engine/ansible/AnsibleVarsGenerator.py +++ b/cli/engine/ansible/AnsibleVarsGenerator.py @@ -68,7 +68,7 @@ def generate(self): # is changed between versions (e.g. wal_keep_segments -> wal_keep_size) and sometimes previous parameters # are not compatible with the new ones, defaults are used for template processing roles_with_defaults = [ - 'repository', 'image_registry', 'node_exporter', + 'repository', 'image_registry', 'node_exporter', 'haproxy', 'postgresql', 'kafka_exporter', 'jmx_exporter' ] # now lets add any external configs we want to load @@ -76,7 +76,7 @@ def generate(self): # In special cases (like haproxy), where user specifies majority of the config, it's easier (and less # awkward) to re-render config templates instead of modifying (for example with regular expressions) # no-longer-compatible config files. - roles_with_manifest = ['filebeat', 'haproxy', 'ignite', 'postgresql', 'repository'] + roles_with_manifest = ['filebeat', 'ignite', 'postgresql', 'repository'] else: roles_with_defaults = self.inventory_creator.get_enabled_roles() roles_with_manifest = [] # applies only to upgrades diff --git a/docs/architecture/logical-view.md b/docs/architecture/logical-view.md index 4e1f945558..d82c707d16 100644 --- a/docs/architecture/logical-view.md +++ b/docs/architecture/logical-view.md @@ -17,7 +17,6 @@ Exporter | Component | Description `Node exporter` | OS/Hardware metrics | [description](https://prometheus.io/docs/guides/node-exporter/) `Kafka exporter` | Kafka metrics | [description](https://github.com/danielqsj/kafka_exporter) `JMX exporter` | JVM metrics (Kafka, Zookeeper) | [description](https://github.com/prometheus/jmx_exporter) -`HAProxy exporter` | HAProxy metrics | [description](https://github.com/prometheus/haproxy_exporter) `cAdvisor` | Container metrics (Kubernetes, Docker) | [description](https://prometheus.io/docs/guides/cadvisor/) ### Prometheus @@ -114,4 +113,4 @@ Zookeepers are usually deployed in more than one instance - this is called Zooke `HAProxy` is a high performance load balancer. Applications deployed on `Kubernetes` can be exposed through `HAProxy` that supports TLS termination and supports multiple backends. Epiphany Platform automates the configuration for backend and frontend of `HAProxy`. -[Read more](http://www.haproxy.org/#desc) \ No newline at end of file +[Read more](http://www.haproxy.org/#desc) diff --git a/docs/changelogs/CHANGELOG-1.3.md b/docs/changelogs/CHANGELOG-1.3.md index 1d8793a6af..47e79ead5a 100644 --- a/docs/changelogs/CHANGELOG-1.3.md +++ b/docs/changelogs/CHANGELOG-1.3.md @@ -64,6 +64,7 @@ ### Removed - [#2680](https://github.com/epiphany-platform/epiphany/issues/2680) - Remove PgBouncer standalone installation +- [#1739](https://github.com/epiphany-platform/epiphany/issues/1739) - Replace standalone HAproxy-exporter by embedded one ### Deprecated diff --git a/docs/home/COMPONENTS.md b/docs/home/COMPONENTS.md index 488e538eab..953685e129 100644 --- a/docs/home/COMPONENTS.md +++ b/docs/home/COMPONENTS.md @@ -30,7 +30,6 @@ Note that versions are default versions and can be changed in certain cases thro | Node Exporter | 1.3.1 | https://github.com/prometheus/node_exporter | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | | Bitnami Node Exporter Helm Chart | 1.1.2 | https://github.com/bitnami/charts | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | | Kafka Exporter | 1.4.0 | https://github.com/danielqsj/kafka_exporter | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | -| HAProxy Exporter | 0.10.0 | https://github.com/prometheus/haproxy_exporter | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | | JMX Exporter | 0.16.1 | https://github.com/prometheus/jmx_exporter | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | | Postgres Exporter | 0.9.0 | https://github.com/prometheus-community/postgres_exporter | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) | | PostgreSQL | 13 | https://www.postgresql.org/ | [PostgreSQL license](http://www.postgresql.org/about/licence/) | @@ -237,7 +236,7 @@ Note that versions are default versions and can be changed in certain cases thro | RabbitMQ Monitoring | 4279 | https://grafana.com/grafana/dashboards/4279 | [MIT License](https://github.com/kbudde/rabbitmq_exporter/blob/main/LICENSE) | | Node Exporter Full | 1860 | https://grafana.com/grafana/dashboards/1860 | [LGPL-3.0 License](https://github.com/rfrail3/grafana-dashboards/blob/master/LICENSE) | | Kafka Exporter Overview | 7589 | https://grafana.com/grafana/dashboards/7589 | [Apache License 2.0](https://github.com/danielqsj/kafka_exporter/blob/master/LICENSE) | -| HAproxy Servers \| HAproxy | 367 | https://grafana.com/grafana/dashboards/367 | None | +| HaProxy backend (or frontend/servers) | 789 | https://grafana.com/grafana/dashboards/367 | None, [Source Code](https://github.com/tcheronneau/grafana_dashboard) | | | Docker and Host Monitoring w/ Prometheus | 179 | https://grafana.com/grafana/dashboards/179 | [MIT License](https://github.com/vegasbrianc/prometheus/blob/master/LICENSE) | | Kubernetes pod and cluster monitoring (via Prometheus) | 6663 | https://grafana.com/grafana/dashboards/6663 | None | -| RabbitMQ cluster monitoring (via Prometheus) | 10991 | https://grafana.com/grafana/dashboards/10991 | None | +| RabbitMQ cluster monitoring (via Prometheus) | 10991 | https://grafana.com/grafana/dashboards/10991 | [License](https://github.com/rabbitmq/rabbitmq-server/blob/master/LICENSE), [Source Code](https://github.com/rabbitmq/rabbitmq-server/blob/master/deps/rabbitmq_prometheus/docker/grafana/dashboards/RabbitMQ-Overview.json) | diff --git a/docs/home/SECURITY.md b/docs/home/SECURITY.md index 2d81d5ab5b..2b466a0514 100644 --- a/docs/home/SECURITY.md +++ b/docs/home/SECURITY.md @@ -21,7 +21,6 @@ This setting can be changed in Epiphany yaml configuration files. Additional to users created by each component Epiphany creates also users and groups: -- haproxy_exporter/haproxy_exporter - kafka_exporter/kafka_exporter - node_exporter/node_exporter - jmx-exporter/jmx-exporter @@ -123,8 +122,8 @@ different values. The list does not include ports that are bound to the loopback - 443 - HTTPS frontend - 9000 - stats page - - unconfigurable random UDP port from ephemeral range* - local connection to rsyslog UDP server (remote access not - needed), see note [[3]](#notes) + - 9101 - metrics + - unconfigurable random UDP port from ephemeral range* - local connection to rsyslog UDP server (remote access not needed), see note [[3]](#notes) **NOTE:** Not applicable for Ubuntu where UNIX socket is used (deb package's default). diff --git a/docs/home/howto/CLUSTER.md b/docs/home/howto/CLUSTER.md index 6f37f329f2..d01ae3a610 100644 --- a/docs/home/howto/CLUSTER.md +++ b/docs/home/howto/CLUSTER.md @@ -705,10 +705,15 @@ specification: stats: enable: true - bind_address: 127.0.0.1:9000 + bind_address: 127.0.0.1 + port: 9000 uri: "/haproxy?stats" user: operations password: your-haproxy-stats-pwd + metrics: + enable: true + bind_address: "*" + port: 9101 frontend: - name: https_front port: 443 diff --git a/docs/home/howto/MONITORING.md b/docs/home/howto/MONITORING.md index b3031fc23f..3f2917c2d0 100644 --- a/docs/home/howto/MONITORING.md +++ b/docs/home/howto/MONITORING.md @@ -222,7 +222,6 @@ There are many monitoring components deployed with Epiphany that you can visuali List of monitoring components - so called exporters: - cAdvisor -- HAProxy Exporter - JMX Exporter - Kafka Exporter - Node Exporter @@ -330,6 +329,27 @@ specification: During upgrade Epiphany takes `kibanaserver` (for Kibana) and `logstash` (for Filebeat) user passwords and re-applies them to upgraded configuration of Filebeat and Kibana. Epiphany upgrade of Open Distro, Kibana or Filebeat will fail if `kibanaserver` or `logstash` usernames were changed in configuration of Kibana, Filebeat or Open Distro for Elasticsearch. +# HAProxy + +## How to enable HAProxy monitoring + +HAProxy metrics are enabled by default. To disable change `specification/metrics/enable` to `false`: + +```yaml +kind: configuration/haproxy +title: "HAProxy" +provider: any +name: default +specification: + metrics: + enable: true + bind_address: "*" + port: 9101 +``` + +You can also change the rest of parameters but note, that you would have to change your security group as well. + + # RabbitMQ ## How to enable RabbitMQ monitoring diff --git a/schema/aws/defaults/infrastructure/virtual-machine.yml b/schema/aws/defaults/infrastructure/virtual-machine.yml index 3526e63f88..3f2e8d8769 100644 --- a/schema/aws/defaults/infrastructure/virtual-machine.yml +++ b/schema/aws/defaults/infrastructure/virtual-machine.yml @@ -106,8 +106,8 @@ specification: security: rules: - _merge: true - - name: haproxy_exporter - description: Allow haproxy_exporter traffic + - name: haproxy_metrics + description: Allow haproxy_metrics traffic direction: Inbound protocol: Tcp destination_port_range: "9101" @@ -415,7 +415,7 @@ specification: protocol: ALL destination_port_range: "0" source_address_prefix: "10.1.1.0/24" - destination_address_prefix: "0.0.0.0/0" + destination_address_prefix: "0.0.0.0/0" --- kind: infrastructure/virtual-machine title: "Virtual Machine Infra" diff --git a/schema/azure/defaults/infrastructure/virtual-machine.yml b/schema/azure/defaults/infrastructure/virtual-machine.yml index eff14c400b..901193d3b3 100644 --- a/schema/azure/defaults/infrastructure/virtual-machine.yml +++ b/schema/azure/defaults/infrastructure/virtual-machine.yml @@ -425,8 +425,8 @@ specification: security: rules: - _merge: true - - name: haproxy_exporter - description: Allow haproxy_exporter traffic + - name: haproxy_metrics + description: Allow haproxy_metrics traffic priority: 201 direction: Inbound access: Allow @@ -435,7 +435,6 @@ specification: destination_port_range: "9101" source_address_prefix: "10.1.0.0/20" destination_address_prefix: "0.0.0.0/0" - --- kind: infrastructure/virtual-machine title: "Virtual Machine Infra" diff --git a/schema/common/defaults/configuration/feature-mapping.yml b/schema/common/defaults/configuration/feature-mapping.yml index 9aa514dbc7..cdea25b7c7 100644 --- a/schema/common/defaults/configuration/feature-mapping.yml +++ b/schema/common/defaults/configuration/feature-mapping.yml @@ -49,8 +49,6 @@ specification: enabled: true - name: haproxy enabled: true - - name: haproxy-exporter - enabled: true - name: vault enabled: true - name: applications @@ -80,7 +78,6 @@ specification: - firewall load_balancer: - haproxy - - haproxy-exporter - node-exporter - filebeat - firewall diff --git a/schema/common/defaults/configuration/firewall.yml b/schema/common/defaults/configuration/firewall.yml index 19957f663e..6d3d0b6d17 100644 --- a/schema/common/defaults/configuration/firewall.yml +++ b/schema/common/defaults/configuration/firewall.yml @@ -27,11 +27,7 @@ specification: enabled: true ports: - 443/tcp - - 9000/tcp # stats - haproxy_exporter: - enabled: true - ports: - - 9101/tcp + - 9000/tcp # stats and metrics ignite: enabled: true ports: diff --git a/schema/common/defaults/configuration/grafana.yml b/schema/common/defaults/configuration/grafana.yml index 47b7d063fd..f958ff6195 100644 --- a/schema/common/defaults/configuration/grafana.yml +++ b/schema/common/defaults/configuration/grafana.yml @@ -82,6 +82,9 @@ specification: # # 1 Node Exporter for Prometheus Dashboard EN v20201010 # - dashboard_id: '11074' # datasource: 'Prometheus' + # # HaProxy backend (or frontend/servers) + # - dashboard_id: '789' + # datasource: 'Prometheus' # Get dashboards from https://grafana.com/dashboards. Only for online mode grafana_online_dashboards: [] diff --git a/schema/common/defaults/configuration/haproxy-exporter.yml b/schema/common/defaults/configuration/haproxy-exporter.yml deleted file mode 100644 index 1c46234d9e..0000000000 --- a/schema/common/defaults/configuration/haproxy-exporter.yml +++ /dev/null @@ -1,14 +0,0 @@ -kind: configuration/haproxy-exporter -title: "HAProxy exporter" -name: default -specification: - description: "Service that runs HAProxy Exporter" - - web_listen_port: "9101" - - config_for_prometheus: # configuration that will be written to Prometheus to allow scraping metrics from this exporter - exporter_listen_port: "9101" - prometheus_config_dir: /etc/prometheus - file_sd_labels: - - label: "job" - value: "haproxy-exporter" \ No newline at end of file diff --git a/schema/common/defaults/configuration/haproxy.yml b/schema/common/defaults/configuration/haproxy.yml index d3c64c5ca7..4e34b495f8 100644 --- a/schema/common/defaults/configuration/haproxy.yml +++ b/schema/common/defaults/configuration/haproxy.yml @@ -10,10 +10,15 @@ specification: stats: enable: true - bind_address: 127.0.0.1:9000 + bind_address: 127.0.0.1 + port: 9000 uri: "/haproxy?stats" user: operations password: your-haproxy-stats-pwd + metrics: + enable: true + bind_address: "*" + port: 9101 frontend: - name: https_front port: 443 @@ -27,4 +32,4 @@ specification: # servers: # Definition for server to that hosts the application. # - name: "node1" # address: "epiphany-vm1.domain.com" - port: 30104 \ No newline at end of file + port: 30104 diff --git a/schema/common/validation/configuration/firewall.yml b/schema/common/validation/configuration/firewall.yml index 8ab744ab04..b1ea2e508c 100644 --- a/schema/common/validation/configuration/firewall.yml +++ b/schema/common/validation/configuration/firewall.yml @@ -53,15 +53,6 @@ properties: type: array items: type: string - haproxy_exporter: - type: object - properties: - enabled: - type: boolean - ports: - type: array - items: - type: string ignite: type: object properties: diff --git a/schema/common/validation/configuration/haproxy-exporter.yml b/schema/common/validation/configuration/haproxy-exporter.yml deleted file mode 100644 index 5466cbc822..0000000000 --- a/schema/common/validation/configuration/haproxy-exporter.yml +++ /dev/null @@ -1,25 +0,0 @@ -"$id": "#/specification" -title: "Haproxy-exporter specification schema" -description: "Haproxy-exporter specification schema" -type: object -properties: - description: - type: string - web_listen_port: - type: string - config_for_prometheus: - type: object - properties: - exporter_listen_port: - type: string - prometheus_config_dir: - type: string - file_sd_labels: - type: array - items: - type: object - properties: - label: - type: string - value: - type: string diff --git a/schema/common/validation/configuration/haproxy.yml b/schema/common/validation/configuration/haproxy.yml index 4e2b5c8400..96d45b470f 100644 --- a/schema/common/validation/configuration/haproxy.yml +++ b/schema/common/validation/configuration/haproxy.yml @@ -20,12 +20,23 @@ properties: type: boolean bind_address: type: string + port: + type: integer uri: type: string user: type: string password: type: string + metrics: + type: object + properties: + enable: + type: boolean + bind_address: + type: string + port: + type: integer frontend: type: array items: diff --git a/tests/spec/spec/haproxy/haproxy_spec.rb b/tests/spec/spec/haproxy/haproxy_spec.rb index 078b5fd4d0..6c9c3e48ab 100644 --- a/tests/spec/spec/haproxy/haproxy_spec.rb +++ b/tests/spec/spec/haproxy/haproxy_spec.rb @@ -3,8 +3,9 @@ haproxy_host = 'localhost' haproxy_front_port = 443 haproxy_stats_port = 9000 +haproxy_metrics_port = 9101 -# Running systemctl status command as "is-active" returns "unknown" in result +# Running systemctl status command as "is-active" returns "unknown" in result # https://bugzilla.redhat.com/show_bug.cgi?id=1073481 describe 'Checking HAProxy service status' do @@ -37,7 +38,10 @@ describe port(haproxy_stats_port) do it { should be_listening } end -end + describe port(haproxy_metrics_port) do + it { should be_listening } + end +end describe 'Checking SSL certificates' do describe file('/etc/ssl/haproxy') do @@ -84,3 +88,18 @@ end end +describe 'Checking HAProxy HTTP status code for metrics page' do + describe command("curl -k -o /dev/null -s -w '%{http_code}' http://#{haproxy_host}:#{haproxy_metrics_port}/metrics") do + it "is expected to be equal" do + expect(subject.stdout.to_i).to eq 200 + end + end +end + +describe 'Checking if it is possible to collect the metrics from HAProxy' do + describe command("curl -s http://#{haproxy_host}:#{haproxy_metrics_port}/metrics") do + its(:stdout) { should include "haproxy_process_nbthread" } + its(:stdout) { should include "haproxy_process_current_tasks" } + its(:exit_status) { should eq 0 } + end +end diff --git a/tests/spec/spec/haproxy_exporter/haproxy_exporter_spec.rb b/tests/spec/spec/haproxy_exporter/haproxy_exporter_spec.rb deleted file mode 100644 index b461e7eb22..0000000000 --- a/tests/spec/spec/haproxy_exporter/haproxy_exporter_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'spec_helper' - -haproxy_exporter_host = 'localhost' -haproxy_exporter_port = 9101 - -describe 'Checking if HAProxy Exporter user exists' do - describe group('haproxy_exporter') do - it { should exist } - end - describe user('haproxy_exporter') do - it { should exist } - it { should belong_to_group 'haproxy_exporter' } - it { should have_home_directory '/home/haproxy_exporter' } - it { should have_login_shell '/usr/sbin/nologin' } - end - describe file('/opt/haproxy_exporter') do - it { should exist } - it { should be_grouped_into 'haproxy_exporter' } - end -end - -describe 'Checking if HAProxy Exporter service is running' do - describe service('prometheus-haproxy-exporter') do - it { should be_enabled } - it { should be_running } - end -end - -describe 'Checking if the ports are open' do - describe port(haproxy_exporter_port) do - let(:disable_sudo) { false } - it { should be_listening } - end -end - -describe 'Checking if it is possible to collect the metrics from HAProxy' do - describe command("curl -s #{haproxy_exporter_host}:#{haproxy_exporter_port}/metrics | grep -i haproxy") do - its(:stdout) { should match /haproxy_up 1/ } - its(:stdout) { should_not match /haproxy_up 0/ } - its(:exit_status) { should eq 0 } - end -end diff --git a/tests/spec/spec/prometheus/prometheus_spec.rb b/tests/spec/spec/prometheus/prometheus_spec.rb index 60fecf6b7a..9984c580db 100644 --- a/tests/spec/spec/prometheus/prometheus_spec.rb +++ b/tests/spec/spec/prometheus/prometheus_spec.rb @@ -6,6 +6,7 @@ alertmanager_host = 'localhost' alertmanager_port = 9093 kubelet_port = 10250 +haproxy_metrics_port = 9101 describe 'Check if Prometheus user exists' do describe group('prometheus') do @@ -101,24 +102,24 @@ end end -describe 'Check configuration files for HAProxy Exporter' do - listInventoryHosts("haproxy_exporter").each do |val| - describe command("ls /etc/prometheus/file_sd") do +describe 'Check Prometheus configuration if exist HAproxy target' do + listInventoryHosts("haproxy").each do |val| + describe command("cat /etc/prometheus/prometheus.yml") do let(:disable_sudo) { false } - its(:stdout) { should match /haproxy-exporter-#{val}.yml/ } + its(:stdout) { should include "#{val}:#{haproxy_metrics_port}" } end end end -describe 'Check connection to HAProxy Exporter hosts' do - listInventoryHosts("haproxy_exporter").each do |val| - let(:disable_sudo) { false } - describe command("curl -o /dev/null -s -w '%{http_code}' $(grep -oP \"(?<=targets: \\\[\').*(?=\'\\\])\" /etc/prometheus/file_sd/haproxy-exporter-#{val}.yml)/metrics") do - it "is expected to be equal" do - expect(subject.stdout.to_i).to eq 200 +describe 'Check connection HAproxy metrics endpoint' do + listInventoryHosts("haproxy").each do |val| + let(:disable_sudo) { false } + describe command("curl -o /dev/null -s -w '%{http_code}' #{val}:#{haproxy_metrics_port}/metrics") do + it "is expected to be equal" do + expect(subject.stdout.to_i).to eq 200 + end end - end - end + end end describe 'Check configuration files for JMX Exporter' do @@ -257,7 +258,7 @@ # its(:stdout) { should_not match /FAILED/ } # its(:exit_status) { should eq 0 } # end -# end +# end # describe 'Check if it is possible to create a rule checking if node is up' do # describe command("cp -p /etc/prometheus/rules/UpDown.rules /etc/prometheus/rules/TEST_RULE.rules && sed -i 's/UpDown/TEST_RULE/g; s/down/up/g; s/== 0/== 1/g; \ @@ -279,8 +280,8 @@ # its(:stdout) { should match /READY/ } # its(:exit_status) { should eq 0 } # end -# end - +# end + # # Tests for Alertmanager assuming monitoring.alerts.enable == true and monitoring.alerts.handlers.mail.enable == true # if readDataYaml["monitoring"]["alerts"]["handlers"]["mail"]["enable"] == true @@ -290,7 +291,7 @@ # let(:disable_sudo) { false } # it { should be_listening } # end -# end +# end # describe 'Check if Alertmanager service is running' do # describe service('alertmanager') do @@ -319,7 +320,7 @@ # describe command("curl -XPOST -d '[{\"labels\":{\"alertname\":\"TEST ALERT\", \"severity\":\"critical\"}}]' #{alertmanager_host}:#{alertmanager_port}/api/v1/alerts") do # its(:stdout_as_json) { should include('status' => 'success') } # end -# end +# end # end # end