diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-07-05 06:29:09 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-07-05 06:29:09 +0200 |
commit | 2c3f1522274c09f7cfdb6309adc0719f05c188e9 (patch) | |
tree | e54e0c26f581543f48e945f186734e4bd9a8f15a /roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 | |
parent | 8af0865a3a3ef783b36016c17598adc9d932981d (diff) | |
download | ands-2c3f1522274c09f7cfdb6309adc0719f05c188e9.tar.gz ands-2c3f1522274c09f7cfdb6309adc0719f05c188e9.tar.bz2 ands-2c3f1522274c09f7cfdb6309adc0719f05c188e9.tar.xz ands-2c3f1522274c09f7cfdb6309adc0719f05c188e9.zip |
Update monitoring scripts to track leftover OpenVSwitch 'veth' interfaces and clean them up pereodically to avoid performance degradation, split kickstart
Diffstat (limited to 'roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2')
-rwxr-xr-x | roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 b/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 new file mode 100755 index 0000000..c04ce60 --- /dev/null +++ b/roles/ands_monitor/templates/scripts/clean_rogue_interfaces.sh.j2 @@ -0,0 +1,18 @@ +#!/bin/bash + +ifaces=$(ovs-vsctl show | grep -oP "could not open network device\s*\Kveth[a-f0-9]+") +[ $? -eq 0 ] || exit + +#Find bridge +#ovs-vsctl list-br + +for iface in $ifaces; do +# echo "$iface" + +# Verify that interface is not active + ip link show | grep $iface &> /dev/null + [ $? -eq 0 ] && continue + + echo "Removing: $iface" + ovs-vsctl del-port br0 $iface +done |