File tree 1 file changed +16
-3
lines changed
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):
40
40
## if CacheInterval has expired at that time
41
41
def OnUpdate (ax , axd , state ):
42
42
def state2int (state ):
43
- # FIXME i need more samples of `birdc show ospf neighbors`
44
- # for more fine-granular results here...
45
43
if state .lower ().startswith ("full" ):
46
44
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
48
61
print ('updated bird-ospf state: {0}' .format (time .time ()))
49
62
## register variables
50
63
axd .RegisterVar ('ospf' , 0 )
You can’t perform that action at this time.
0 commit comments