File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,24 @@ def OnInit(ax, axd):
4040## if CacheInterval has expired at that time
4141def OnUpdate (ax , axd , state ):
4242 def state2int (state ):
43- # FIXME i need more samples of `birdc show ospf neighbors`
44- # for more fine-granular results here...
4543 if state .lower ().startswith ("full" ):
4644 return 8
47- return 1
45+ elif state .lower ().startswith ("loading" ):
46+ return 7
47+ elif state .lower ().startswith ("exchange" ):
48+ return 6
49+ elif state .lower ().startswith ("exstart" ):
50+ return 5
51+ elif state .lower ().startswith ("2-way" ):
52+ return 4
53+ elif state .lower ().startswith ("init" ):
54+ return 3
55+ elif state .lower ().startswith ("attempt" ):
56+ return 2
57+ elif state .lower ().startswith ("down" ):
58+ return 1
59+ else :
60+ return 1
4861 print ('updated bird-ospf state: {0}' .format (time .time ()))
4962 ## register variables
5063 axd .RegisterVar ('ospf' , 0 )
You can’t perform that action at this time.
0 commit comments