Merge "Enable monitoring for ovs-vswitchd"
diff --git a/linux/map.jinja b/linux/map.jinja
index a485c76..f9b9ea0 100644
--- a/linux/map.jinja
+++ b/linux/map.jinja
@@ -421,10 +421,6 @@
'warn': 85.0,
'major': 95.0,
},
- 'swap_usage_percentage': {
- 'warn': 50.0,
- 'minor': 90.0,
- },
'inodes_usage_percentage': {
'warn': 85.0,
'major': 95.0,
@@ -451,3 +447,7 @@
'netdev_budget_squeeze_rate': 0.1
},
}, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}
+
+{%- set sysctl_min_kernel = {
+ 'net.core.netdev_budget_usecs': '4.12',
+} %}
diff --git a/linux/meta/prometheus.yml b/linux/meta/prometheus.yml
index fd4b7b9..6ead9aa 100644
--- a/linux/meta/prometheus.yml
+++ b/linux/meta/prometheus.yml
@@ -123,30 +123,6 @@
annotations:
summary: "{{ mem_threshold }}{%- raw %}% of memory is used"
description: "The {{ $labels.host }} node uses {{ $value }}% of memory for 2 minutes."
- SystemSwapFullWarning:
- {%- endraw %}
- {%- set swap_threshold = monitoring.swap_usage_percentage.warn|float %}
- if: >-
- swap_used_percent >= {{ swap_threshold }}
- for: 2m
- labels:
- severity: warning
- service: system
- annotations:
- summary: "{{ swap_threshold }}{%- raw %}% of swap is used"
- description: "The swap on the {{ $labels.host }} node is {{ $value }}% used for 2 minutes."
- SystemSwapFullMinor:
- {%- endraw %}
- {%- set swap_threshold = monitoring.swap_usage_percentage.minor|float %}
- if: >-
- swap_used_percent >= {{ swap_threshold }}
- for: 2m
- labels:
- severity: minor
- service: system
- annotations:
- summary: "{{ swap_threshold }}{%- raw %}% of swap is used"
- description: "The swap on the {{ $labels.host }} node is {{ $value }}% used for 2 minutes."
SystemRxPacketsDroppedTooHigh:
{%- endraw %}
{%- set net_rx_dropped_threshold = monitoring.rx_packets_dropped_threshold.warn %}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 04b13ab..706af45 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -403,13 +403,21 @@
cmd.run:
- name: ifdown {{ interface_name }}
- prereq:
+ {%- if interface.type == 'eth' %}
- network: linux_interface_{{ interface_name }}
+ {%- else %}
+ - file: ovs_port_{{ interface_name }}
+ {%- endif %}
linux_interface_up_on_ipflush_{{ interface_name }}:
cmd.run:
- name: ifup {{ interface_name }}
- onchanges:
+ {%- if interface.type == 'eth' %}
- network: linux_interface_{{ interface_name }}
+ {%- else %}
+ - file: ovs_port_{{ interface_name }}
+ {%- endif %}
{%- elif interface.get('ipflush_onchange', False)%}
linux_interface_ipflush_onchange_{{ interface_name }}:
diff --git a/linux/system/kernel.sls b/linux/system/kernel.sls
index 3dc3046..59405d0 100644
--- a/linux/system/kernel.sls
+++ b/linux/system/kernel.sls
@@ -1,4 +1,5 @@
{%- from "linux/map.jinja" import system with context %}
+{%- from "linux/map.jinja" import sysctl_min_kernel %}
{%- if system.enabled %}
{%- if system.kernel is defined %}
@@ -82,13 +83,19 @@
{%- endfor %}
{%- endif %}
+{%- set cur_kernel = salt['grains.get']('kernelrelease') %}
+
{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).items() %}
+ {%- if not sysctl_name in sysctl_min_kernel or salt['pkg.version_cmp'](cur_kernel, sysctl_min_kernel[sysctl_name]) >= 0 %}
+
linux_kernel_{{ sysctl_name }}:
sysctl.present:
- name: {{ sysctl_name }}
- value: {{ sysctl_value }}
+ {%- endif %}
+
{%- endfor %}
{%- endif %}