Discussion:
[Check_mk (english)] check_mk_agent.aix "number of threads" gives number of process, should be fixed
Gilles Pion
2011-10-01 09:15:43 UTC
Permalink
Hello,

In the output of  "cpu" section of check_mk_agent.aix the value after
the "/" is supposed to be the number of threads

The code used to compute this value uses the following statement:
ps=`ps -ef|wc -l|sed -e 's;[[:space:]]\{1,\};;'`
which really gives  the number of *processes*

Maybe would be better to use the following command :
ps=`/usr/bin/ps -eo thcount | awk '{SUM+=$1} END {print SUM}'`


--
Gilles Pion
Florian Heigl
2011-10-01 10:45:52 UTC
Permalink
On Sat, 1 Oct 2011 11:15:43 +0200, Gilles Pion
Post by Gilles Pion
In the output of  "cpu" section of check_mk_agent.aix the value after
the "/" is supposed to be the number of threads
ps=`ps -ef|wc -l|sed -e 's;[[:space:]]\{1,\};;'`
which really gives  the number of *processes*
ps=`/usr/bin/ps -eo thcount | awk '{SUM+=$1} END {print SUM}'`
Is it still like this on AIX that all even PIDs are processes and uneven
are threads?
--
Mathias Kettner GmbH | \/ | |/ / M A T H I A S K E T T N E R
Florian Heigl | |\/| | ' /
Steinstr. 44 | | | | . \ Linux Beratung & Schulung
81667 München |_| |_|_|\_\ http://mathias-kettner.de
Tel.: 089 / 1890 4210
Fax.: 089 / 1890 4211 Mail: ***@mathias-kettner.de
Gilles Pion
2011-10-01 10:55:38 UTC
Permalink
Post by Florian Heigl
Is it still like this on AIX that all even PIDs are processes and uneven
are threads?
Not sure (do not have access to AIX machine until next week)
Mirza Dedic
2011-10-01 18:04:16 UTC
Permalink
I have access to an AIX 7.x (very heavy load/busy) machine if you want to validate anything shoot me some instructions.
-----Original Message-----
Sent: Saturday, October 01, 2011 3:56 AM
Subject: Re: [Check_mk (english)] check_mk_agent.aix "number of threads"
gives number of process, should be fixed
Post by Florian Heigl
Is it still like this on AIX that all even PIDs are processes and
uneven are threads?
Not sure (do not have access to AIX machine until next week)
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
The Oppenheimer Group ---- CONFIDENTIAL

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Florian Heigl
2011-10-01 18:11:48 UTC
Permalink
Hi,
Post by Mirza Dedic
I have access to an AIX 7.x (very heavy load/busy) machine if you want
to
Post by Mirza Dedic
validate anything shoot me some instructions.
[censored multiple lines of expressing envy]

yes it would be making things very easy if you could test the commands for
us.

- how many processes were running
- how many threads did they have (total)

does the check output match that?

- does -o threads (or what it was... don't remember) count processes +
threads or just the threads?

what kind of UNIX95 syntax is mentioned in the ps manpage? (trying to keep
it easy)

Thanks,
florian
--
Mathias Kettner GmbH | \/ | |/ / M A T H I A S K E T T N E R
Florian Heigl | |\/| | ' /
Steinstr. 44 | | | | . \ Linux Beratung & Schulung
81667 München |_| |_|_|\_\ http://mathias-kettner.de
Tel.: 089 / 1890 4210
Fax.: 089 / 1890 4211 Mail: ***@mathias-kettner.de
Gilles Pion
2011-10-03 13:46:33 UTC
Permalink
Post by Florian Heigl
- does -o threads (or what it was... don't remember) count processes +
threads or just the threads?
it's "-o thcount" and the resulting "THCNT" column is the number of
active thread for each process, which is then summed by the awk
expression.

You may try for exemple:
$ ps -eo pid,thcount | head
which gives something like:
PID THCNT
1 1
98418 14
131262 1
139422 1
159898
168152 29
180346 1
184512 1
188508 1


So the result of following command:
/usr/bin/ps -eo thcount | awk '{SUM+=$1} END {print SUM}'`
will compute the total number of threads in the system (kernel
processes may be included in the total by adding "k" flag to "ps":
"ps -ek" )

Loading...