fixing config
authorMarcel Haerry <haerry@puzzle.ch>
Wed, 16 Jul 2008 15:25:31 +0000 (17:25 +0200)
committerMarcel Haerry <haerry@puzzle.ch>
Wed, 16 Jul 2008 15:25:31 +0000 (17:25 +0200)
files/plugins/xen_traffic_all

index 55740f0..3fcb508 100644 (file)
@@ -34,18 +34,26 @@ if [ "$1" = "config" ]; then
     echo 'graph_category xen'
     DOMAINS=$(xm list | awk '{print $1}' | egrep -v "^(Name|Domain-0)")
     for dom in $DOMAINS; do
-        name=$( echo $dom | sed -e's/-/_/g' )
-        #echo $name"UP.label $name"
-        #echo $name"DOWN.label $name"
+       devs=$( xm network-list $dom |\
+               egrep "^[0-9]+" | sed 's@^.*vif/\([0-9]*\)/\([0-9]*\).*$@vif\1.\2@')
+        real_name=$( echo $dom | sed -e's/-/_/g' )
+        name=$real_name
+       for dev in $devs; do
+            if [ ${#devs} -gt 1 ]; then
+                name=$real_name"_"`echo $dev | sed 's/\./\_/'`
+            fi
+            #echo $name"UP.label $name"
+           #echo $name"DOWN.label $name"
         
-        echo $name'Down.label received'
-        echo $name'Down.type COUNTER'
-        echo $name'Down.graph no'
-        echo "${name}Down.cdef ${name}Down,8,*"
-        echo "${name}Up.label ${name}"
-        echo $name'Up.type COUNTER'
-        echo "${name}Up.negative ${name}Down"
-        echo "${name}Up.cdef ${name}Up,8,*"
+            echo $name'Down.label received'
+           echo $name'Down.type COUNTER'
+            echo $name'Down.graph no'
+           echo "${name}Down.cdef ${name}Down,8,*"
+            echo "${name}Up.label ${name}"
+           echo $name'Up.type COUNTER'
+            echo "${name}Up.negative ${name}Down"
+           echo "${name}Up.cdef ${name}Up,8,*"
+       done
     done
     exit 0
 fi