Module: check_mk
Branch: master
Commit: 60bda85f6dc8e043bd1dd3240aae27e50c125ffb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60bda85f6dc8e0…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue Oct 24 10:24:10 2017 +0200
5348 FIX veritas_vcs: add timeout in the Check_MK agent
Add a timeout of 2 seconds for the check veritas_vcs
in the Check_MK agent. This circumvents the problem
that the agent blocks if there is a problem with a
Veritas cluster.
Change-Id: I44a87493e080d45fa7cdadf325f923ba21547285
---
.werks/5348 | 13 +++++++++++++
agents/check_mk_agent.linux | 8 ++++----
agents/check_mk_agent.openwrt | 8 ++++----
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/.werks/5348 b/.werks/5348
new file mode 100644
index 0000000..5b8f891
--- /dev/null
+++ b/.werks/5348
@@ -0,0 +1,13 @@
+Title: veritas_vcs: add timeout in the Check_MK agent
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1508833185
+Class: fix
+
+Add a timeout of 2 seconds for the check veritas_vcs
+in the Check_MK agent. This circumvents the problem
+that the agent blocks if there is a problem with a
+Veritas cluster.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 8dc40c0..61313ad 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -737,10 +737,10 @@ if [ -x /opt/VRTSvcs/bin/haclus ]
then
echo "<<<veritas_vcs>>>"
vcshost=$(hostname | cut -d. -f1)
- /opt/VRTSvcs/bin/haclus -display -localclus | grep -e ClusterName -e ClusState
- /opt/VRTSvcs/bin/hasys -display -attribute SysState
- /opt/VRTSvcs/bin/hagrp -display -sys $vcshost -attribute State -localclus
- /opt/VRTSvcs/bin/hares -display -sys $vcshost -attribute State -localclus
+ waitmax -s 9 2 /opt/VRTSvcs/bin/haclus -display -localclus | grep -e ClusterName -e
ClusState
+ waitmax -s 9 2 /opt/VRTSvcs/bin/hasys -display -attribute SysState
+ waitmax -s 9 2 /opt/VRTSvcs/bin/hagrp -display -sys $vcshost -attribute State
-localclus
+ waitmax -s 9 2 /opt/VRTSvcs/bin/hares -display -sys $vcshost -attribute State
-localclus
fi
diff --git a/agents/check_mk_agent.openwrt b/agents/check_mk_agent.openwrt
index 02ae32d..2068499 100755
--- a/agents/check_mk_agent.openwrt
+++ b/agents/check_mk_agent.openwrt
@@ -669,10 +669,10 @@ if [ -x /opt/VRTSvcs/bin/haclus ]
then
echo "<<<veritas_vcs>>>"
vcshost=$(hostname | cut -d. -f1)
- /opt/VRTSvcs/bin/haclus -display -localclus | grep -e ClusterName -e ClusState
- /opt/VRTSvcs/bin/hasys -display -attribute SysState
- /opt/VRTSvcs/bin/hagrp -display -sys $vcshost -attribute State -localclus
- /opt/VRTSvcs/bin/hares -display -sys $vcshost -attribute State -localclus
+ waitmax -s 9 2/opt/VRTSvcs/bin/haclus -display -localclus | grep -e ClusterName -e
ClusState
+ waitmax -s 9 2/opt/VRTSvcs/bin/hasys -display -attribute SysState
+ waitmax -s 9 2/opt/VRTSvcs/bin/hagrp -display -sys $vcshost -attribute State
-localclus
+ waitmax -s 9 2/opt/VRTSvcs/bin/hares -display -sys $vcshost -attribute State
-localclus
fi
# Fileinfo-Check: put patterns for files into /etc/check_mk/fileinfo.cfg