Skip to content

Instantly share code, notes, and snippets.

@kanazux
Created March 27, 2018 18:43
Show Gist options
  • Save kanazux/e1a7421c029d36bd56e6ebfdc545b284 to your computer and use it in GitHub Desktop.
Save kanazux/e1a7421c029d36bd56e6ebfdc545b284 to your computer and use it in GitHub Desktop.
get cpu info from wmi class
from wmi_query import wmi_query
opts = {'user': 'user',
        'password': 'passwd',
        'address': '192.168.1.0',
        'domain': 'localhost',
        'namespace': 'ROOT/wmi',
        'delimiter': '|',
        'query': 'select * from ProcessorBiosInfo'}
wmi = wmi_query(opts=opts)
wmi.run()
print wmi.name()
ProcessorBiosInfo
for x in wmi.data_dict[wmi.name()]:
    print("\n\t{}\n".format(wmi.name()))
    for y in wmi.get_item_keys():
        print(" {}:\t{}".format(y, wmi.data_dict[wmi.name()][x][y]))
	ProcessorBiosInfo

 PBlk:	1040
 PBlkLen:	6
 Pct:	

 ProcessorId:	1
 ApicId:	0
 NtNumber:	0
 Active:	True
 Pss:	�
 InstanceName:	ACPI\GenuineIntel_-_Intel64_Family_6_Model_15_-_Intel(R)_Celeron(R)_CPU________E1400__@_2.00GHz\_1_0

	ProcessorBiosInfo

 PBlk:	1040
 PBlkLen:	6
 Pct:	

 ProcessorId:	2
 ApicId:	1
 NtNumber:	1
 Active:	True
 Pss:	�
 InstanceName:	ACPI\GenuineIntel_-_Intel64_Family_6_Model_15_-_Intel(R)_Celeron(R)_CPU________E1400__@_2.00GHz\_2_0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment