Skip to content

Commit

Permalink
7009 FIX cpu.threads: On Solaris the number of threads was calculated…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
si-23 committed Jan 18, 2019
1 parent 21e9670 commit 05399ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .werks/7009
@@ -0,0 +1,14 @@
Title: cpu.threads: On Solaris the number of threads was calculated incorrectly
Level: 1
Component: checks
Class: fix
Compatible: compat
Edition: cre
State: unknown
Version: 1.4.0p38
Date: 1547725852

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}}.
4 changes: 2 additions & 2 deletions agents/check_mk_agent.solaris
Expand Up @@ -277,9 +277,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
Expand Down

0 comments on commit 05399ff

Please sign in to comment.