diff options
Diffstat (limited to 'files')
-rw-r--r-- | files/plugins/xen_traffic_all | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/files/plugins/xen_traffic_all b/files/plugins/xen_traffic_all index 55740f0..3fcb508 100644 --- a/files/plugins/xen_traffic_all +++ b/files/plugins/xen_traffic_all @@ -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 |