Module: check_mk
Branch: master
Commit: 4b6733f8b8ff3d4d39a7476c8d8e0d644784a797
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b6733f8b8ff3d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jan 17 12:56:45 2019 +0100
7009 FIX cpu.threads: On Solaris the number of threads was calculated incorrectly
In order to get the number of threads correctly we use 'ps -AL'
instead of 'ps -o comm $ZONE'.
Perhaps you have to adapt configured rules {{Number of threads}}.
Change-Id: I9d1e762dcba95aa0e014c217d246cb288b73622c
---
.werks/7009 | 13 +++++++++++++
agents/check_mk_agent.solaris | 4 ++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/7009 b/.werks/7009
new file mode 100644
index 0000000..b13befe
--- /dev/null
+++ b/.werks/7009
@@ -0,0 +1,13 @@
+Title: cpu.threads: On Solaris the number of threads was calculated incorrectly
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1547725852
+Class: fix
+
+In order to get the number of threads correctly we use 'ps -AL'
+instead of 'ps -o comm $ZONE'.
+
+Perhaps you have to adapt configured rules {{Number of threads}}.
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index c92143a..0a2c320 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -289,9 +289,9 @@ fi
# Simulated Output of Linux /proc/cpu
echo '<<<cpu>>>'
load=$(uptime|sed -e 's;.*average: \([0-9]\{1,\}\.[0-9]\{1,\}\),
\([0-9]\{1,\}\.[0-9]\{1,\}\), \([0-9]\{1,\}\.[0-9]\{1,\}\).*;\1 \2 \3;')
-ps=$(($(ps -o comm $pszone | wc -l)))
+nthreads=$(ps -AL --no-headers | wc -l)
procs=$(($(psrinfo | wc -l)))
-echo $load 1/$ps $$ $procs
+echo $load 1/$nthreads $$ $procs
# zpool status