handle multiple WMI objects
This commit is contained in:
parent
66107940a2
commit
3b579a97d9
|
|
@ -63,12 +63,16 @@ class Agent(object):
|
||||||
wmi_details = {}
|
wmi_details = {}
|
||||||
pass
|
pass
|
||||||
wmi_dict = {}
|
wmi_dict = {}
|
||||||
|
wmi_dict_keys = []
|
||||||
for k, v in wmi_details.items():
|
for k, v in wmi_details.items():
|
||||||
|
for index, item in enumerate(v):
|
||||||
try:
|
try:
|
||||||
value = v[0][0]
|
value = item[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
value = dict()
|
value = dict()
|
||||||
wmi_dict[k] = value
|
new_key = k + str(index)
|
||||||
|
wmi_dict[new_key] = value
|
||||||
|
wmi_dict_keys.append(new_key)
|
||||||
return wmi_dict
|
return wmi_dict
|
||||||
|
|
||||||
def get_agent_metrics(self):
|
def get_agent_metrics(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue