From 391a4bfa416540a1e2aff48b6e296b595805d9d3 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Sat, 22 Oct 2016 03:52:05 +0200 Subject: [PATCH] [cpubyuser] user constant for magic 'others' user --- plugins/system/cpubyuser | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/system/cpubyuser b/plugins/system/cpubyuser index 39469981..096a32c0 100755 --- a/plugins/system/cpubyuser +++ b/plugins/system/cpubyuser @@ -39,6 +39,7 @@ . "$MUNIN_LIBDIR/plugins/plugin.sh" +OTHER_FIELD="others" [ "$USERS" = "ALL" ] && USERS=$(w --no-header | awk '{ print $1 }' | sort | uniq) @@ -60,8 +61,8 @@ if [ "$1" = "config" ]; then echo "graph_scale no" echo "graph_period second" user_fields="$(for user in $USERS; do clean_fieldname "$user" | tr '\n' ' '; done)" - echo "graph_order $user_fields others" - for user in $USERS "others"; do + echo "graph_order $user_fields $OTHER_FIELD" + for user in $USERS "$OTHER_FIELD"; do user_field="$(clean_fieldname "$user")" echo "${user_field}.label $user" echo "${user_field}.info CPU used by user $user"