We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acafe93 commit 34f05c9Copy full SHA for 34f05c9
1 file changed
netengine/backends/snmp/openwrt.py
@@ -505,11 +505,19 @@ def neighbors(self):
505
'7': 'INCOMPLETE',
506
}
507
508
- # TODO: find a way to extract IP address from the OID
509
- neighbors = self.next('1.3.6.1.2.1.4.35.1.4')[3]
510
- neighbor_states = self.next('1.3.6.1.2.1.4.35.1.7')[3]
+ neighbors_oid = '1.3.6.1.2.1.4.35.1.4'
+ neighbor_states_oid = '1.3.6.1.2.1.4.35.1.7'
+ neighbor_info = self.next('1.3.6.1.2.1.4.35.1')[3]
511
+ neighbors = []
512
+ neighbor_states = []
513
result = []
514
515
+ for oid in neighbor_info:
516
+ if neighbors_oid in str(oid[0][0]):
517
+ neighbors.append(oid)
518
+ elif neighbor_states_oid in str(oid[0][0]):
519
+ neighbor_states.append(oid)
520
+
521
for index, neighbor in enumerate(neighbors):
522
try:
523
oid = neighbor[0][0].getOid()
0 commit comments