def cim_dashboard(): client = CIMClient() try: os_info = client.get_os_info() except: os_info = 'not availible' try: ip_interfaces = client.get_ip_interfaces() except: ip_interfaces = [] return render_template('cim.html', os_info=os_info, ip_interfaces=ip_interfaces)
) else: client = CIMClient("https://%s" % host, 5989, user, password) else: client = CIMClient("http://%s" % host, 5988, user, password) return client if __name__ == "__main__": ns = "root/cimv2" # ns = "root/emc/host" # ns = "interop" client = _get_cim_client(https=True, force_unsecure=True) # enumerate all class names in specified namespace client = CIMClient("http://192.168.1.73", 5988, "ghost", "ghost") cls_name = "PG_ComputerSystem" # cls_name = "PG_UnixProcess" ns = "root/cimv2" # ns = "root/emc/host" (err, inst_names) = client.enumerate_instance_names(cls_name=cls_name, ns=ns) if not err: for inst_name in inst_names: pass # print inst_name.to_xml_dtd().toxml() (err, instances) = client.enumerate_instances(cls_name=cls_name, ns=ns) if not err: for inst in instances: pass # print inst.to_xml_dtd().toxml()