Module: check_mk
Branch: master
Commit: ed8538e8ff37e93505a20837eafce532426ecdb7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed8538e8ff37e9…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Nov 13 09:26:33 2017 +0100
5355 FIX dmraid: add timeouts to the linux agent
Add timeouts to "dmraid -r" and "dmraid -s" to prevent the Check_MK
agent from running into a timeout in special setups with a large
amount of devices.
Change-Id: I6169847813a4e13b4f35ed4e4e9a49297f7f06a4
---
.werks/5355 | 12 ++++++++++++
agents/check_mk_agent.linux | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/5355 b/.werks/5355
new file mode 100644
index 0000000..5c1b8eb
--- /dev/null
+++ b/.werks/5355
@@ -0,0 +1,12 @@
+Title: dmraid: add timeouts to the linux agent
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1510561310
+Class: fix
+
+Add timeouts to "dmraid -r" and "dmraid -s" to prevent the Check_MK
+agent from running into a timeout in special setups with a large
+amount of devices.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 7ce4333..6fec1cd 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -466,12 +466,12 @@ echo '<<<md>>>'
cat /proc/mdstat
# RAID status of Linux RAID via device mapper
-if type dmraid >/dev/null && DMSTATUS=$(dmraid -r)
+if type dmraid >/dev/null && DMSTATUS=$(waitmax 3 dmraid -r)
then
echo '<<<dmraid>>>'
# Output name and status
- dmraid -s | grep -e ^name -e ^status
+ waitmax 20 dmraid -s | grep -e ^name -e ^status
# Output disk names of the RAID disks
DISKS=$(echo "$DMSTATUS" | cut -f1 -d\:)