Merge "Enable OpenVSwitch alerts only when using OVS."
diff --git a/telegraf/meta/grafana.yml b/telegraf/meta/grafana.yml
index 42f8787..03d6556 100644
--- a/telegraf/meta/grafana.yml
+++ b/telegraf/meta/grafana.yml
@@ -1,5 +1,13 @@
-{%- if pillar.neutron is defined and (pillar.neutron.get('gateway', {}).get('enabled', False) == True or (pillar.neutron.get('compute',{}).get('enabled', False) == True and pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True)) or
- pillar.opencontrail is defined and pillar.opencontrail.get('compute', {}).get('enabled', False) == True %}
+{%- if (pillar.neutron is defined
+ and ((pillar.neutron.get('gateway', {}).get('enabled', False) == True
+ and 'ovs' in pillar.neutron.get('gateway', {}).get('backend', {}).get('mechanism', {}).keys())
+ or (pillar.neutron.get('compute', {}).get('enabled', False) == True
+ and 'ovs' in pillar.neutron.get('compute', {}).get('backend', {}).get('mechanism', {}).keys()
+ and pillar.neutron.get('compute', {}).get('dhcp_agent_enabled', False) == True)
+ )
+ )
+ or (pillar.opencontrail is defined
+ and pillar.opencontrail.get('compute', {}).get('enabled', False) == True) %}
dashboard:
kpi_downtime_prometheus:
datasource: prometheus
diff --git a/telegraf/meta/prometheus.yml b/telegraf/meta/prometheus.yml
index c7bc0fd..c4a1131 100644
--- a/telegraf/meta/prometheus.yml
+++ b/telegraf/meta/prometheus.yml
@@ -77,8 +77,10 @@
{%- endif %}
{%- endif %}
{%- if pillar.neutron is defined %}
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('enabled', False) == True %}
-{%- raw %}
+ {%- for component in ['gateway', 'compute'] %}
+ {%- set neutron_config = pillar.neutron.get(component, {}) %}
+ {%- if neutron_config.get('enabled', False) == True and 'ovs' in neutron_config.get('backend', {}).get('mechanism', {}).keys() %}
+ {%- raw %}
OVSTooManyPortRunningOnAgent:
if: >-
sum by (host) (ovs_bridge_status) > 1500
@@ -118,8 +120,8 @@
annotations:
summary: "Failed to Gather OVS information"
description: "Failed to Gather OVS information on host {{ $labels.host }}"
- {%- endraw %}
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
+ {%- endraw %}
+ {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
OVSInstanceArpingCheckDown:
if: instance_arping_check_up == 0
for: 2m
@@ -131,8 +133,9 @@
{%- raw %}
description: "The OVS instance arping check on the {{ $labels.host }} node is down for 2 minutes."
{%- endraw %}
+ {%- endif %}
{%- endif %}
- {%- endif %}
+ {%- endfor %}
{%- endif %}
{%- if pillar.opencontrail is defined %}
{%- if pillar.opencontrail.get('compute', {}).get('enabled', False) == True %}
@@ -150,7 +153,8 @@
{%- endif %}
{%- endif %}
{%- if pillar.neutron is defined %}
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or (pillar.neutron.get('compute',{}).get('enabled', False) == True and pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True) %}
+ {%- if (pillar.neutron.get('gateway', {}).get('enabled', False) == True and 'ovs' in pillar.neutron.get('gateway', {}).get('backend', {}).get('mechanism', {}).keys()) %}
+ or (pillar.neutron.get('compute', {}).get('enabled', False) == True and 'ovs' in pillar.neutron.get('compute', {}).get('backend', {}).get('mechanism', {}).keys() and pillar.neutron.get('compute', {}).get('dhcp_agent_enabled', False) == True) %}
recording:
instance_id:instance_arping_success:
query: >-
diff --git a/telegraf/meta/telegraf.yml b/telegraf/meta/telegraf.yml
index df55923..036a788 100644
--- a/telegraf/meta/telegraf.yml
+++ b/telegraf/meta/telegraf.yml
@@ -13,22 +13,25 @@
{%- endif %}
{%- if pillar.neutron is defined %}
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('enabled', False) == True %}
+ {%- for component in ['gateway', 'compute'] %}
+ {%- set neutron_config = pillar.neutron.get(component, {}) %}
+ {%- if neutron_config.get('enabled', False) == True and 'ovs' in neutron_config.get('backend', {}).get('mechanism', {}).keys() %}
agent:
input:
ovs_parse_bridge:
template: telegraf/files/input/exec.conf
commands: "/usr/local/bin/ovs_parse_bridge.py"
interval: 45s
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
+ {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
{%- set prometheus_address = pillar._param.stacklight_monitor_address %}
ovs_arping_check:
template: telegraf/files/input/exec.conf
commands: "/usr/local/bin/check_ovs_arping.py --host {{ prometheus_address }} --port 15010"
timeout: 30s
interval: 45s
+ {%- endif %}
{%- endif %}
- {%- endif %}
+ {%- endfor %}
{%- endif %}
{%- if pillar.opencontrail is defined %}
diff --git a/telegraf/script.sls b/telegraf/script.sls
index 79342b5..ef9b354 100644
--- a/telegraf/script.sls
+++ b/telegraf/script.sls
@@ -12,7 +12,9 @@
{%- endif %}
{%- if pillar.neutron is defined %}
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('enabled', False) == True %}
+ {%- for component in ['gateway', 'compute'] %}
+ {%- set neutron_config = pillar.neutron.get(component, {}) %}
+ {%- if neutron_config.get('enabled', False) == True and 'ovs' in neutron_config.get('backend', {}).get('mechanism', {}).keys() %}
ovs_parse_bridge:
file.managed:
- name: /usr/local/bin/ovs_parse_bridge.py
@@ -20,7 +22,7 @@
- template: jinja
- mode: 750
- {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
+ {%- if pillar.neutron.get('gateway', {}).get('enabled', False) == True or pillar.neutron.get('compute',{}).get('dhcp_agent_enabled', False) == True %}
ovs_arping_check_telegraf_script:
file.managed:
- name: /usr/local/bin/check_ovs_arping.py
@@ -28,8 +30,9 @@
- template: jinja
- mode: 750
+ {%- endif %}
{%- endif %}
- {%- endif %}
+ {%- endfor %}
{%- endif %}
{%- if pillar.opencontrail is defined %}