5 sys.path.insert(0, '/usr/lib/xen-3.1-1/lib/python')
6 from xen.lowlevel.xs import xs
12 domids = set(trans.ls('', '/local/domain'))
18 name, data = get_dom(int(domid))
19 if name.startswith('d_'):
25 name = trans.read('', '/local/domain/%d/name' % domid)
28 # presence of a graphical console
29 data['console'] = trans.read('', '/local/domain/%d/device/vfb/0/state' % domid)
31 data['vm'] = trans.read('', '/local/domain/%d/vm' % domid)
32 data['start_time'] = float(trans.read('', '%s/start_time' % data['vm']))
33 data['uptime'] = time.time()-data['start_time']
37 if __name__ == '__main__':
39 print yaml.safe_dump(vms, default_flow_style=False)