Module: check_mk
Branch: master
Commit: c81bef3de89e70f5c754f7fb65cc419da3977d36
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c81bef3de89e70…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Tue Dec 20 17:17:54 2016 +0100
4119 FIX check_mk_agent.solaris: fixed run_cached function
Previously the run_cached function simply exited if cache file $CACHEFILE.new was too
old.
This has been fixed now, the function acts just like in the Linux agent - it removes the
process of the file as well as the file itself.
Change-Id: I886c524ac21280eae54531a66808ab407ab84dc7
---
.werks/4119 | 11 +++++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 3 ++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4119 b/.werks/4119
new file mode 100644
index 0000000..c3fbb7c
--- /dev/null
+++ b/.werks/4119
@@ -0,0 +1,11 @@
+Title: check_mk_agent.solaris: fixed run_cached function
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1482250470
+
+Previously the run_cached function simply exited if cache file $CACHEFILE.new was too
old.
+This has been fixed now, the function acts just like in the Linux agent - it removes the
process of the file as well as the file itself.
diff --git a/ChangeLog b/ChangeLog
index 10af144..2773636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
NOTE: Please refer to the migration notes!
* 4208 FIX: mk_jolokia: Plugin now works with jolokia versions requiring the base url
to finish with a slash...
* 4174 FIX: added missing perfometer for interface services
+ * 4119 FIX: check_mk_agent.solaris: fixed run_cached function...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 1e73af4..f8b1b23 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -91,7 +91,8 @@ function run_cached () {
if [ -e "$CACHEFILE.new" ] ; then
AGE=$(file_age "$CACHEFILE.new")
if [ $AGE -ge $((MAXAGE * 2)) ] ; then
- return
+ fuser -k "$CACHEFILE.new" >/dev/null 2>&1
+ rm -f "$CACHEFILE.new"
fi
fi