check spanning tree
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 12 Aug 2022 10:31:31 +0000 (12:31 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 12 Aug 2022 10:31:31 +0000 (12:31 +0200)
spanning-tree-check.sh [new file with mode: 0755]

diff --git a/spanning-tree-check.sh b/spanning-tree-check.sh
new file mode 100755 (executable)
index 0000000..246fdf0
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+#git -C out grep STP | grep -v RSTP | grep 'spanning-tree active' | sed -e 's/_/ /g'  | awk '{ print $2" .*"$6 }' > /tmp/st.1.patt
+
+# active roots
+git -C out grep root '*active*'
+
+git -C ../mikrotik-switch/out grep root-bridge-id
+
+
+echo "# STP only (RSTP ignored)"
+git -C out grep STP | grep -v RSTP | grep 'spanning-tree active' | tee /tmp/st.2.full | sed -e 's/_/ /g'  | awk '{ print $6"\t"$2"[ \t$]" }' > /tmp/st.2.patt
+grep -f /tmp/st.2.patt /dev/shm/neighbors.tab | column -t