1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 02:18:08 +00:00

Merge pull request #643 from rkarlsba/patch-4

ALL keyword
This commit is contained in:
Steve Schnepp 2016-10-08 13:48:52 +02:00 committed by GitHub
commit cd64b3e003

View file

@ -7,6 +7,8 @@
# [cpubyuser]
# env.USERS root yann
#
# If env.USERS is set to ALL, count all logged in users.
#
# root and yann being a list of the users to monitor.
# You need to also make sure that awk is installed
#
@ -70,6 +72,10 @@ if [ "$1" = "config" ]; then
exit
fi
if [ "$USERS" = "ALL" ]; then
USERS=$( w | awk '{ print $1 }' )
fi
top -b -n 1 | tail -n +8 | \
awk -v USERS="$USERS" '
{ if ($2 != "USER") CPU_USER[$2]+=$9 }