#!/bin/sh
export Lang=en_US
export LC_ALL=en_US

XM_LIST=`mktemp 2>/dev/null`

if [ "x${XM_LIST}" = "x" -o ! -f $XM_LIST ]; then
    exit 0
fi

for i in `virsh list | awk '{if ($1 ~ /^[0-9]+$/) print $2 }'`; do
     echo -e "$(virsh dominfo $i)" | awk -F: -f /etc/snmp/xm_list.awk >> $XM_LIST
done

cat $XM_LIST
rm -f $XM_LIST

exit 1
