@@ -40,7 +40,7 @@ def __init__(self, cfgfile, birdcli, netstatcmd="netstat -na"):
40
40
}
41
41
42
42
_re_config_include = re .compile ("^include\s*\" (/[^\" ]*)\" .*$" )
43
- _re_config_bgp_proto_begin = re .compile ("^protocol bgp ([a-zA-Z0-9_]+) \{$" )
43
+ _re_config_bgp_proto_begin = re .compile ("^protocol bgp ([a-zA-Z0-9_]+) .* \{$" )
44
44
_re_config_local_as = re .compile ("local ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) as ([0-9]+);" )
45
45
_re_config_bgp_holdtime = re .compile ("hold time ([0-9]+);" )
46
46
_re_config_bgp_keepalive = re .compile ("keepalive time ([0-9]+);" )
@@ -99,8 +99,11 @@ def __init__(self, cfgfile, birdcli, netstatcmd="netstat -na"):
99
99
100
100
bgp_defaults = {
101
101
'bgpPeerIdentifier' : SnmpIpAddress ("0.0.0.0" ),
102
+ 'bgpPeerLocalAddr' : SnmpIpAddress ("0.0.0.0" ),
102
103
'bgpPeerHoldTime' : 0 ,
104
+ 'bgpPeerHoldTimeConfigured' : 0 ,
103
105
'bgpPeerKeepAlive' : 0 ,
106
+ 'bgpPeerKeepAliveConfigured' : 0 ,
104
107
'bgpPeerState' : 1 ,
105
108
'bgpPeerInUpdates' : SnmpCounter32 (0 ),
106
109
'bgpPeerOutUpdates' : SnmpCounter32 (0 ),
@@ -234,6 +237,7 @@ def getBGPState(self):
234
237
match = self ._re_birdcli_bgp_begin .search (line )
235
238
if match :
236
239
bgp_proto = match .group (1 )
240
+ state ["bgp-peers" ][bgp_proto ] = {}
237
241
timestamp = int (match .group (2 ))
238
242
if not state ["bgp-peers" ].has_key (bgp_proto ):
239
243
print ("WARNING: proto \" %s\" not in config, skipping" % bgp_proto )
0 commit comments