Module: check_mk
Branch: master
Commit: a55151eee196a1a7b1abf9a60d4f1f693979e7cd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a55151eee196a1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 6 11:06:22 2015 +0100
#2738 FIX Check_MK Caching agent on Linux: introduce timeout for lock
This avoids out of memory in situtations where the agent is hanging forever. Thanks
to Andreas Pflug.
---
.werks/2738 | 11 +++++++++++
ChangeLog | 1 +
agents/check_mk_caching_agent.linux | 3 ++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/2738 b/.werks/2738
new file mode 100644
index 0000000..8266b0a
--- /dev/null
+++ b/.werks/2738
@@ -0,0 +1,11 @@
+Title: Check_MK Caching agent on Linux: introduce timeout for lock
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446804323
+
+This avoids out of memory in situtations where the agent is hanging forever. Thanks
+to Andreas Pflug.
diff --git a/ChangeLog b/ChangeLog
index cd35d9e..4bfb9c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@
NOTE: Please refer to the migration notes!
* 2735 FIX: esx_vsphere_datastores: fix labelling, help and performance data of
provisioned space...
* 2737 FIX: bluecoat_sensors: fix crash when using Nagios as core (missing
include)...
+ * 2738 FIX: Check_MK Caching agent on Linux: introduce timeout for lock...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/agents/check_mk_caching_agent.linux b/agents/check_mk_caching_agent.linux
index 7a4c6e3..67b7552 100755
--- a/agents/check_mk_caching_agent.linux
+++ b/agents/check_mk_caching_agent.linux
@@ -82,7 +82,8 @@ SEENFILE=$CACHEFILE.seenby.$REMOTE_HOST
# is not very unlikely since the agent might run a couple
# of seconds
(
- flock --exclusive 200
+ flock --timeout 180 --exclusive 200 || exit 1
+
if [ ! -e "$CACHEFILE" -o -e "$SEENFILE" ]
then
check_mk_agent > $CACHEFILE