Module: check_mk
Branch: master
Commit: f231bcb7da1679ef86afc051db84e81151cc7a8e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f231bcb7da1679…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue Oct 24 11:39:05 2017 +0200
5349 FIX ovs_bonding: display bonding correctly for newer ovs-appctl versions
The bonding information for the check ovs_bonding is now provided correctly
by the Check_MK agent for newer versions of ovs-appctl.
Change-Id: I0ae2b9a232f12d5fcea152704199f751e13eb472
---
.werks/5349 | 11 +++++++++++
agents/check_mk_agent.linux | 4 +++-
agents/check_mk_agent.openwrt | 4 +++-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/5349 b/.werks/5349
new file mode 100644
index 0000000..b74f246
--- /dev/null
+++ b/.werks/5349
@@ -0,0 +1,11 @@
+Title: ovs_bonding: display bonding correctly for newer ovs-appctl versions
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1508837666
+Class: fix
+
+The bonding information for the check ovs_bonding is now provided correctly
+by the Check_MK agent for newer versions of ovs-appctl.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 61313ad..f060f68 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -378,8 +378,10 @@ fi
# Same for Open vSwitch bonding
if type ovs-appctl > /dev/null ; then
+ BONDS=$(ovs-appctl bond/list)
+ COL=$(echo "$BONDS" | awk '{for(i=1;i<=NF;i++) {if($i ==
"bond") printf("%d", i)} exit 0}')
echo '<<<ovs_bonding:sep(58)>>>'
- for bond in $(ovs-appctl bond/list | sed -e 1d | rev | cut -f3 | rev) ; do
+ for bond in $(echo "$BONDS" | sed -e 1d | cut -f${COL}) ; do
echo "[$bond]"
ovs-appctl bond/show $bond
done
diff --git a/agents/check_mk_agent.openwrt b/agents/check_mk_agent.openwrt
index d50b794..c7e3125 100755
--- a/agents/check_mk_agent.openwrt
+++ b/agents/check_mk_agent.openwrt
@@ -356,8 +356,10 @@ fi
# Same for Open vSwitch bonding
if type ovs-appctl > /dev/null ; then
+ BONDS=$(ovs-appctl bond/list)
+ COL=$(echo "$BONDS" | awk '{for(i=1;i<=NF;i++) {if($i ==
"bond") printf("%d", i)} exit 0}')
echo '<<<ovs_bonding:sep(58)>>>'
- for bond in $(ovs-appctl bond/list | sed -e 1d | rev | cut -f3 | rev) ; do
+ for bond in $(echo "$BONDS" | sed -e 1d | cut -f${COL}) ; do
echo "[$bond]"
ovs-appctl bond/show $bond
done