File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -49,16 +49,22 @@ def state2int(state):
4949 ## register variables
5050 axd .RegisterVar ('ospf' , 0 )
5151
52+ # get ip-sorted neighbors
53+ nbrs = []
5254 for nbrid in sorted (state ["ospf-neighbors" ].keys (), BirdAgent .ipCompare ):
53- nbr = state ["ospf-neighbors" ][nbrid ]
55+ nbrs .append ((nbrid , state ["ospf-neighbors" ][nbrid ]))
56+
57+ # register in MIB-sort:
58+ for nbrid , nbr in nbrs :
5459 axd .RegisterVar ("ospfNbrIpAddr.%s.0" % nbrid , SnmpIpAddress (nbr ["rtrip" ]))
60+ for nbrid , nbr in nbrs :
5561 axd .RegisterVar ("ospfNbrRtrId.%s.0" % nbrid , SnmpIpAddress (nbrid ))
62+ for nbrid , nbr in nbrs :
5663 axd .RegisterVar ("ospfNbrPriority.%s.0" % nbrid , nbr ["pri" ])
64+ for nbrid , nbr in nbrs :
5765 axd .RegisterVar ("ospfNbrState.%s.0" % nbrid , state2int (nbr ["state" ]))
5866 return
5967
60-
61-
6268# main program
6369if __name__ == '__main__' :
6470 print ('bird-ospf AgentX starting' )
You can’t perform that action at this time.
0 commit comments