Merge "Exclude lines when specific regexp is present" into release/2019.2.0
diff --git a/linux/meta/fluentd.yml b/linux/meta/fluentd.yml
index bfcfba3..60d2ef5 100644
--- a/linux/meta/fluentd.yml
+++ b/linux/meta/fluentd.yml
@@ -96,6 +96,14 @@
               - name: ident
                 regexp: '^(.*)$'
                 result: $1.systemd
+  {%- if pillar.get('telegraf', {}).get('agent', {}).get('enabled', False) %}
+          push_to_telegraf:
+            require_in:
+              - push_to_default
+            tag: 'telegraf.systemd'
+            type: relabel
+            label: telegraf
+  {%- endif %}
           push_to_default:
             tag: '*.systemd'
             type: copy
diff --git a/linux/meta/prometheus.yml b/linux/meta/prometheus.yml
index f405367..51176c4 100644
--- a/linux/meta/prometheus.yml
+++ b/linux/meta/prometheus.yml
@@ -232,8 +232,29 @@
       annotations:
         summary: "CPU terminated {{ squeeze_rate_threshold }}{%- raw %} net_rx_action loops per second"
         description: "The rate of net_rx_action loops terminations on the {{ $labels.host }} node is {{ $value }} per second during the last 7 minutes. Modify the net.core.netdev_budget and net.core.netdev_budget_usecs kernel parameters."
-{%- endraw -%}
-
+      {%- endraw %}
+    {%- if network.bridge == 'openvswitch' %}
+      {%- raw %}
+    ProcessOVSVswitchdMemoryWarning:
+      if: procstat_memory_vms{process_name="ovs-vswitchd"} / on(host) mem_total > 0.2
+      for: 5m
+      labels:
+        severity: warning
+        service: ovs
+      annotations:
+        summary: "ovs-vswitchd takes more than 20% of system memory"
+        description: "ovs-vswitchd takes more than 20% of system memory"
+    ProcessOVSVswitchdMemoryCritical:
+      if: procstat_memory_vms{process_name="ovs-vswitchd"} / on(host) mem_total > 0.3
+      for: 5m
+      labels:
+        severity: critical
+        service: ovs
+      annotations:
+        summary: "ovs-vswitchd takes more than 30% of system memory"
+        description: "ovs-vswitchd takes more than 30% of system memory"
+      {%- endraw %}
+    {%- endif %}
 {%- set bond_interfaces = [] %}
 {%- for interface_name, interface in network.interface.items() %}
   {%- if interface.type == 'bond' and interface.enabled == True %}
diff --git a/linux/meta/telegraf.yml b/linux/meta/telegraf.yml
index 52b4fe7..972bd82 100644
--- a/linux/meta/telegraf.yml
+++ b/linux/meta/telegraf.yml
@@ -33,6 +33,10 @@
           exe: sshd
         cron:
           exe: cron
+{%- if network.bridge == 'openvswitch' %}
+        ovs-vswitchd:
+          exe: ovs-vswitchd
+{%- endif %}
     linux_sysctl_fs:
 {%- set bond_interfaces = [] %}
 {%- for interface_name, interface in network.interface.items() %}