Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions socs/agents/ibootbar/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def _build_message(get_result, names, time):
continue

message['data'][field_name] = oid_value
message['data'][field_name + "_name"] = names[int(field_name[-1])]
if 'outlet' in field_name:
message['data'][field_name + "_name"] = names[int(field_name[-1])]
message['data'][field_name + "_description"] = oid_description

return message
Expand Down Expand Up @@ -143,8 +144,9 @@ def update_cache(get_result, names, outlet_locked, timestamp):

# Update OID Cache for session.data
oid_cache[field_name] = {"status": oid_value}
oid_cache[field_name]["name"] = names[int(field_name[-1])]
oid_cache[field_name]["locked"] = outlet_locked[int(field_name[-1])]
if 'outlet' in field_name:
oid_cache[field_name]["name"] = names[int(field_name[-1])]
oid_cache[field_name]["locked"] = outlet_locked[int(field_name[-1])]
oid_cache[field_name]["description"] = oid_description
oid_cache['ibootbar_connection'] = {'last_attempt': time.time(),
'connected': True}
Expand Down Expand Up @@ -233,12 +235,18 @@ def acq(self, session, params=None):
{'outletStatus_0':
{'status': 1,
'name': 'Outlet-1',
'locked': True,
'description': 'on'},
'outletStatus_1':
{'status': 0,
'name': 'Outlet-2',
'locked': False,
'description': 'off'},
...
'currentLC1_0':
{'status': 0,
'description': '0'},
...
'ibootbar_connection':
{'last_attempt': 1656085022.680916,
'connected': True},
Expand Down Expand Up @@ -271,6 +279,11 @@ def acq(self, session, params=None):
for i in range(8):
get_list.append((self.ibootbar_type + '-MIB', 'outletStatus', i))
name_list.append((self.ibootbar_type + '-MIB', 'outletName', i))
get_list.append((self.ibootbar_type + '-MIB', 'currentLC1', 0))
get_list.append((self.ibootbar_type + '-MIB', 'currentLC2', 0))
if self.ibootbar_type == 'IBOOTPDU':
get_list.append((self.ibootbar_type + '-MIB', 'voltageLC1', 0))
get_list.append((self.ibootbar_type + '-MIB', 'voltageLC2', 0))

# Issue SNMP GET commands
get_result = yield self.snmp.get(get_list, self.version)
Expand Down