Module: check_mk
Branch: master
Commit: 2c7044961f0cb4cf60ae90220f1b1ff650a7cbdb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2c7044961f0cb4…
Author: Ronny Bruska <rb(a)mathias-kettner.de>
Date: Thu Feb 28 07:54:11 2019 +0100
7153 FIX Solaris Agent: fixed wrong ps command in CPU section
On Solaris the option "--no-headers" is missing and caused a crash in the check
cpu.threads.
Change-Id: Ie76beb9676f53503b4933fb40c5ca99ad0a020e9
---
.werks/7153 | 13 +++++++++++++
agents/check_mk_agent.solaris | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/7153 b/.werks/7153
new file mode 100644
index 0000000..b928220
--- /dev/null
+++ b/.werks/7153
@@ -0,0 +1,13 @@
+Title: Solaris Agent: fixed wrong ps command in CPU section
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1551336188
+Class: fix
+
+On Solaris the option "--no-headers" is missing and caused a crash in the
check
+cpu.threads.
+
+
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 0a2c320..002afda 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -289,7 +289,7 @@ 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;')
-nthreads=$(ps -AL --no-headers | wc -l)
+nthreads=$(ps -AL | wc -l)
procs=$(($(psrinfo | wc -l)))
echo $load 1/$nthreads $$ $procs