mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 10:58:12 +00:00
commit
cd64b3e003
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,8 @@
|
||||||
# [cpubyuser]
|
# [cpubyuser]
|
||||||
# env.USERS root yann
|
# 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.
|
# root and yann being a list of the users to monitor.
|
||||||
# You need to also make sure that awk is installed
|
# You need to also make sure that awk is installed
|
||||||
#
|
#
|
||||||
|
@ -70,6 +72,10 @@ if [ "$1" = "config" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$USERS" = "ALL" ]; then
|
||||||
|
USERS=$( w | awk '{ print $1 }' )
|
||||||
|
fi
|
||||||
|
|
||||||
top -b -n 1 | tail -n +8 | \
|
top -b -n 1 | tail -n +8 | \
|
||||||
awk -v USERS="$USERS" '
|
awk -v USERS="$USERS" '
|
||||||
{ if ($2 != "USER") CPU_USER[$2]+=$9 }
|
{ if ($2 != "USER") CPU_USER[$2]+=$9 }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue