Module: check_mk
Branch: master
Commit: 709c67b1c39570bc673eb9164b5f7f377c936f83
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=709c67b1c39570…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 25 11:47:40 2015 +0100
#2017 FIX Solaris-Agent: Prevent hanging agent in uptime section
It happened running on a Solaris 8 zone, on a Solaris 10 LDOM, on Sun/Oracle T5
that the agent hung while processing the <tt>uptime</tt> section of the
agent.
Many hanging truss and nawk processes were found, which can lead to a unresponsive
and/or crashed system.
The uptime section generating code has been changed and replaced by another mechanism.
Thanks to Clint Squires for analyzing the problem and providing a fix!
---
.werks/2017 | 17 +++++++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 7 +++----
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/.werks/2017 b/.werks/2017
new file mode 100644
index 0000000..4301764
--- /dev/null
+++ b/.werks/2017
@@ -0,0 +1,17 @@
+Title: Solaris-Agent: Prevent hanging agent in uptime section
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424861065
+
+It happened running on a Solaris 8 zone, on a Solaris 10 LDOM, on Sun/Oracle T5
+that the agent hung while processing the <tt>uptime</tt> section of the
agent.
+Many hanging truss and nawk processes were found, which can lead to a unresponsive
+and/or crashed system.
+
+The uptime section generating code has been changed and replaced by another mechanism.
+
+Thanks to Clint Squires for analyzing the problem and providing a fix!
diff --git a/ChangeLog b/ChangeLog
index ead8bf0..53b1d87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -190,6 +190,7 @@
* 2033 FIX: check_mk-zfs_arc_cache: add Perf-O-Meter
* 2034 FIX: netapp_api_volumes: added Perf-O-Meter
* 2035 FIX: check_mk-netapp_api_if, check_mk-if_brocade: added missing Perf-O-Meters
+ * 2017 FIX: Solaris-Agent: Prevent hanging agent in uptime section...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 1bc04d5..7cf46a6 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -221,10 +221,9 @@ fi
# /proc/uptime
# Simulated output of Linux /proc/uptime
echo '<<<uptime>>>'
-proc0=$(ls -td /proc/* | tail -1)
-ctime=$(nawk 'BEGIN{print srand()}')
-btime=$(truss -v lstat -t lstat ls -d $proc0 2>&1 | nawk '/ct = /{printf
"%d\n", $9}')
-echo $(($ctime - $btime))
+ctime=`nawk 'BEGIN{print srand()}'`;
+btime=`kstat '-p' 'unix:::boot_time' 2>&1|grep
'boot_time'|awk '{print $2}'`;
+echo $(($ctime - $btime));
# NTP