Performance and Utilization monitoring of Xen Dom0
Your questions is a little unclear as to what kind of stats you are hoping to collect from the dom0, but I think what you are looking for is an understanding of how your existing hardware resources are allocated.
We're having great success using libvirt's Python bindings to get this information. Here's a Python script snippet that illustrates the idea:
#!/usr/bin/env python
import sys
import libvirt
def main(options,args):
hypervisors = sys.argv[1:]
print "%16s%18s%18s%18s" % ("dom0 IP", "Free Memory (MB)", "Disk Used (GB)", "Disk Free (GB)")
for ip in hypervisors:
# this assumes "remote" connection to libvirtd using TCP
url = "xen+tcp://%s" % (ip)
conn = libvirt.open(url)
# you may want to do more error handling here
if conn == None:
continue
mem = conn.getFreeMemory() / 1048576 #convert bytes -> megabytes
pool = conn.storagePoolLookupByName('vol0')
# a refresh() is necessary because libvirtd's internal information isn't
# always in sync with the host.
pool.refresh(0)
disk_info = pool.info()
disk_used = disk_info[2] / 1073741824 #convert bytes -> gigabytes
disk_free = disk_info[3] / 1073741824 #convert bytes -> gigabytes
print "%16s%18d%18s%18d" % (ip, mem, disk_used, disk_free)
if __name__ == '__main__':
sys.exit(main(options,args))