1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 10:28:36 +00:00

[cpubyuser] expand magic 'ALL' user before config

This commit is contained in:
Lars Kruse 2016-10-22 03:50:32 +02:00
parent 6f7473b2a7
commit 4b21d58195

View file

@ -39,6 +39,9 @@
. "$MUNIN_LIBDIR/plugins/plugin.sh"
[ "$USERS" = "ALL" ] && USERS=$(w --no-header | awk '{ print $1 }' | sort | uniq)
if [ "$1" = "autoconf" ]; then
if [ -n "$USERS" ]; then
echo "yes"
@ -68,10 +71,6 @@ 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 }