From 724072e729671cb79a0bf3c861bd9f34e6ea2461 Mon Sep 17 00:00:00 2001 From: Joachim Tingvold Date: Fri, 10 Sep 2010 21:32:03 +0200 Subject: [PATCH] =?UTF-8?q?Munin=20doesn't=20like=20special=20chars=20in?= =?UTF-8?q?=20the=20VM-name.=20This=20fix=20replaces=20all=20chars=20excep?= =?UTF-8?q?t=20=ABa-z=BB,=20=ABA-Z=BB=20and=20=AB0-9=BB,=20with=20undersco?= =?UTF-8?q?re.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/other/esxi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/other/esxi b/plugins/other/esxi index 866e02cd..2a316506 100755 --- a/plugins/other/esxi +++ b/plugins/other/esxi @@ -1,7 +1,7 @@ #!/bin/bash -GREP="/usr/bin/grep" -SED="/usr/bin/sed" +GREP="/bin/grep" +SED="/bin/sed" TAIL="/usr/bin/tail" SSH="/usr/bin/ssh" BASENAME="/usr/bin/basename" @@ -254,9 +254,10 @@ if [ -n "$vmlist" ]; then n=0 while [ -n "${id[$n]}" ]; do #echo ${id[$n]} ${name[$n]} ${vmcpu[$n]} ${vmmem[$n]} + nicename=`echo ${name[$n]} | sed 's/[^a-z|A-Z|0-9]/\_/g'` case $which_info in - "cpu" ) echo "${name[$n]}".value "${vmcpu[$n]}";; - "mem" | "gmem" | "hmem" ) echo "${name[$n]}".value "$((${vmmem[$n]}))";; + "cpu" ) echo "$nicename".value "${vmcpu[$n]}";; + "mem" | "gmem" | "hmem" ) echo "$nicename".value "$((${vmmem[$n]}))";; esac (( n++ )) done