Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:infrasonar/brocade-probe
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Oct 4, 2024
2 parents 9bd625e + 1d74ceb commit 4fe38a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/check/brocade.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@ async def check_brocade(
check_config: dict) -> dict:
snmp = get_snmp_client(asset, asset_config, check_config)
state = await snmpquery(snmp, QUERIES)

port_status = {
item['name']: item for item in state.pop('fcFxPortStatusEntry', [])
}
port_phys = {
item['name']: item for item in state.pop('fcFxPortPhysEntry', [])
}
for item in state.get('swFCPortEntry', []):
name = item['name']
port_status_item = port_status.get(name)
if port_status_item:
item.update(port_status_item)
port_phys_item = port_phys.get(name)
if port_phys_item:
item.update(port_phys_item)
return state

0 comments on commit 4fe38a4

Please sign in to comment.