Révision 4b21d581
[cpubyuser] expand magic 'ALL' user before config
| plugins/system/cpubyuser | ||
|---|---|---|
| 39 | 39 |
|
| 40 | 40 |
. "$MUNIN_LIBDIR/plugins/plugin.sh" |
| 41 | 41 |
|
| 42 |
[ "$USERS" = "ALL" ] && USERS=$(w --no-header | awk '{ print $1 }' | sort | uniq)
|
|
| 43 |
|
|
| 44 |
|
|
| 42 | 45 |
if [ "$1" = "autoconf" ]; then |
| 43 | 46 |
if [ -n "$USERS" ]; then |
| 44 | 47 |
echo "yes" |
| ... | ... | |
| 68 | 71 |
exit |
| 69 | 72 |
fi |
| 70 | 73 |
|
| 71 |
if [ "$USERS" = "ALL" ]; then |
|
| 72 |
USERS=$( w | awk '{ print $1 }' )
|
|
| 73 |
fi |
|
| 74 |
|
|
| 75 | 74 |
top -b -n 1 | tail -n +8 | \ |
| 76 | 75 |
awk -v USERS="$USERS" ' |
| 77 | 76 |
{ if ($2 != "USER") CPU_USER[$2]+=$9 }
|
Formats disponibles : Unified diff