1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

[cpubyuser] use 'clean_fieldname' instead of incomplete substitution (Closes: #757)

This commit is contained in:
Lars Kruse 2016-10-22 01:48:36 +02:00
parent 54580bf7a9
commit 78f4e42d21

View file

@ -37,6 +37,8 @@
#%# family=auto #%# family=auto
#%# capabilities=autoconf #%# capabilities=autoconf
. "$MUNIN_LIBDIR/plugins/plugin.sh"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -n "$USERS" ]; then if [ -n "$USERS" ]; then
echo "yes" echo "yes"
@ -54,11 +56,11 @@ if [ "$1" = "config" ]; then
echo "graph_vlabel %" echo "graph_vlabel %"
echo "graph_scale no" echo "graph_scale no"
echo "graph_period second" echo "graph_period second"
_USERS=${USERS//[-.]/_} _USERS="$(for user in $USERS; do clean_fieldname "$user" | tr '\n' ' '; done)"
echo "graph_order $_USERS others" echo "graph_order $_USERS others"
FIRSTUSER=1; FIRSTUSER=1;
for USER in $USERS "others"; do for USER in $USERS "others"; do
_USER=${USER//[-.]/_} _USER="$(clean_fieldname "$USER")"
echo "${_USER}.label $USER" echo "${_USER}.label $USER"
echo "${_USER}.info CPU used by user $USER" echo "${_USER}.info CPU used by user $USER"
echo "${_USER}.type GAUGE" echo "${_USER}.type GAUGE"