mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 02:18:08 +00:00
[cpubyuser] expand magic 'ALL' user before config
This commit is contained in:
parent
6f7473b2a7
commit
4b21d58195
1 changed files with 3 additions and 4 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue