Commit 602484b4 authored by S M Y's avatar S M Y
Browse files

monit additions for stateful

Showing with 21 additions and 9 deletions
+21 -9
......@@ -589,3 +589,11 @@ sunbird_portal_offline_tenant: ""
sunbird_portal_offline_supported_languages: "English, Hindi, Tamil, Bengali"
sunbird_portal_offline_app_release_date: ""
sunbird_portal_offline_app_version: "0.0.1"
### Monitoring vars ###
prometheus_port_for_swarm: 9090
alertmanager_port_for_swarm: 9093
prometheus_port_for_stateful: 19090
alertmanager_port_for_stateful: 19093
......@@ -116,6 +116,11 @@
- hosts: swarm-bootstrap-manager
gather_facts: false
become: yes
vars:
- alertmanager_host: "{{ groups['swarm-agent-for-alertmanager'][0] }}"
- prometheus_host: "{{ group['swarm-agent-for-prometheus'][0] }}"
- prometheus_port: "{{ prometheus_port_for_swarm }}"
- alertmanager_port: "{{ alertmanager_port_for_swarm }}"
vars_files:
- ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml']
roles:
......@@ -151,10 +156,16 @@
hosts: swarm-dashboard
gather_facts: false
become: yes
vars:
- alertmanager_host: "{{ groups['swarm-dashboard'][0] }}"
- prometheus_host: "{{ groups['swarm-dashboard'][0] }}"
- prometheus_port: "{{ prometheus_port_for_stateful }}"
- alertmanager_port: "{{ alertmanager_port_for_stateful }}"
vars_files:
- ['{{inventory_dir}}/secrets.yml', 'secrets/{{env}}.yml']
roles:
- stack-monitor-stateful
- {role: 'monit', monit_checks: ['alertmanager', 'prometheus']}
tags:
- stack-monitor-stateful
......
---
- debug:
msg="{{ groups['swarm-agent-for-alertmanager'][0] }}"
- debug:
msg="{{ groups['swarm-agent-for-prometheus'][0] }}"
- debug:
msg="{{ alertmanager_host }}"
......
# Monit by default makes HTTP HEAD request. Having content in the check will force HTTP GET
# Alert by mail is sent by default. Exec will additionally send slack alert
check host alertmanager with address {{ groups['swarm-agent-for-alertmanager'][0] }}
check host alertmanager with address {{ alertmanager_host }}
if failed
port {{ alertmanager_port }} protocol http
request /alertmanager/
......
# Monit by default makes HTTP HEAD request. Having content in the check will force HTTP GET
# Alert by mail is sent by default. Exec will additionally send slack alert
check host prometheus with address {{ groups['swarm-agent-for-prometheus'][0] }}
check host prometheus with address {{ prometheus_host }}
if failed
port {{ prometheus_port }} protocol http
request /prometheus/graph
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment