Looks like sar is indeed capturing all processes+threads.
# sar -o /tmp/zfoo.sar.data 1 2 >& /dev/null
# sar -f /tmp/zfoo.sar.data -q
Linux 2.6.32-25-server (P-MXS-01) 11/15/2012 _x86_64_ (8 CPU)
02:38:42 AM runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
02:38:43 AM 0 587 0.32 0.49 0.47
02:38:44 AM 0 589 0.32 0.49 0.47
Average: 0 588 0.32 0.49 0.47
# ls -d /proc/[0-9]*/task/* | wc -l
590
# ls -d /proc/[0-9]* | wc -l ; /usr/lib64/nagios/plugins/check_procs ;
ps faux | wc -l
416
PROCS OK: 415 processes
417
That seems to solve that mystery. Now on to either getting sar to
record/display process (sans thread) counts or getting Nagios to
include thread counts.
Thanks, Rich and Charles.
Regards,
- Robert
On Wed, Nov 14, 2012 at 8:45 PM, Charles Sharp <
cas.n...@gmail.com> wrote:
>
> Hi Robert,
>
> Instead of using /proc, you might want to count the pids under the
> /proc/<pid>/task
> directory. There will be at least one (for the pid itself), plus pids for
> the the Linux
> tasks.
>
> I didn't have time to play with it much, but here's a first pass:
>
> cas@rock-ubuntu120464:~$ sudo find /proc -name task -exec ls {} \; |wc -w
> 315
> cas@rock-ubuntu120464:~$ ls -d /proc/[0-9]* | wc -l
> 141
>
> interesting,
> cas
> _______________________________________________
> Discuss mailing list
>
Dis...@sluug.org
>
http://www.sluug.org/mailman/listinfo/discuss
>
>
>
> _______________________________________________
> Discuss mailing list
>
Dis...@sluug.org
>
http://www.sluug.org/mailman/listinfo/discuss
>