From a33ff0a83c8d5d28ef3666e33ffd83b7270cf307 Mon Sep 17 00:00:00 2001
From: Ricardo Carrillo Cruz <ricardo.carrillo.cruz@gmail.com>
Date: Tue, 18 Oct 2016 02:40:26 +0200
Subject: [PATCH] Filter out brq and tap devices from net interfaces monitoring

The computes create a ton of tap devices, and we are not entirely
interested right time on brq either.
Let's filter out them and just gather stats from regular interfaces.

Change-Id: I6a5360e1f928c8b8db73b0273d4f1c8fdd5935e2
---
 modules/openstack_project/files/cacti/create_graphs.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/openstack_project/files/cacti/create_graphs.sh b/modules/openstack_project/files/cacti/create_graphs.sh
index 83f56a0b45..ff75f990dc 100644
--- a/modules/openstack_project/files/cacti/create_graphs.sh
+++ b/modules/openstack_project/files/cacti/create_graphs.sh
@@ -65,14 +65,16 @@ add_ds_graph "Host MIB - Available Disk Space" "Available Disk Space" \
 SNMP_QUERY_ID=`php -q add_graphs.php --host-id=$HOST_ID --list-snmp-queries | \
     grep "SNMP - Interface Statistics"|cut -f 1`
 
+for $iface in $(php -q /usr/share/cacti/cli/add_graphs.php --host-id=$HOST_ID --snmp-field=ifName --list-snmp-values | grep -v tap| grep -v brq) ; do
 add_ds_graph "Interface - Traffic (bits/sec)" "In/Out Bits (64-bit Counters)" \
-    "ifOperStatus" "Up"
+    "ifName" "$iface"
 add_ds_graph "Interface - Errors/Discards" "In/Out Errors/Discarded Packets" \
-    "ifOperStatus" "Up"
+    "ifName" "$iface"
 add_ds_graph "Interface - Unicast Packets" "In/Out Unicast Packets" \
-    "ifOperStatus" "Up"
+    "ifName" "$iface"
 add_ds_graph "Interface - Non-Unicast Packets" "In/Out Non-Unicast Packets" \
-    "ifOperStatus" "Up"
+    "ifName" "$iface"
+done
 
 SNMP_QUERY_ID=`php -q add_graphs.php --host-id=$HOST_ID --list-snmp-queries | \
     grep "ucd/net - Get IO Devices"|cut -f 1`