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):
49
49
## register variables
50
50
axd .RegisterVar ('ospf' , 0 )
51
51
52
+ # get ip-sorted neighbors
53
+ nbrs = []
52
54
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 :
54
59
axd .RegisterVar ("ospfNbrIpAddr.%s.0" % nbrid , SnmpIpAddress (nbr ["rtrip" ]))
60
+ for nbrid , nbr in nbrs :
55
61
axd .RegisterVar ("ospfNbrRtrId.%s.0" % nbrid , SnmpIpAddress (nbrid ))
62
+ for nbrid , nbr in nbrs :
56
63
axd .RegisterVar ("ospfNbrPriority.%s.0" % nbrid , nbr ["pri" ])
64
+ for nbrid , nbr in nbrs :
57
65
axd .RegisterVar ("ospfNbrState.%s.0" % nbrid , state2int (nbr ["state" ]))
58
66
return
59
67
60
-
61
-
62
68
# main program
63
69
if __name__ == '__main__' :
64
70
print ('bird-ospf AgentX starting' )
You can’t perform that action at this time.
0 commit comments