Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit c0712e0b authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent 9fbf6605
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
2022-05-09: added item to BgpPeer class, this is used in the discovery function 2022-05-09: added item to BgpPeer class, this is used in the discovery function
2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list
added remote_as to BgpPeerItem added remote_as to BgpPeerItem
2023-01-25: fixed routing instance in item
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# 2022-05-09: added item to BgpPeer class, this is used in the discovery function # 2022-05-09: added item to BgpPeer class, this is used in the discovery function
# 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list # 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list
# added remote_as to BgpPeerItem # added remote_as to BgpPeerItem
# # 2023-01-25: fixed routing instance in item
import copy import copy
from typing import List, Dict, Optional, Tuple from typing import List, Dict, Optional, Tuple
...@@ -54,6 +54,7 @@ class JuniperPrefixes: ...@@ -54,6 +54,7 @@ class JuniperPrefixes:
def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict[str, BgpPeer]]: def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict[str, BgpPeer]]:
jnxBgpM2Peer, jnxBgpM2PrefixCountersEntry = string_table jnxBgpM2Peer, jnxBgpM2PrefixCountersEntry = string_table
peer_table = {} peer_table = {}
peer_prefixes = {} peer_prefixes = {}
...@@ -105,10 +106,8 @@ def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict ...@@ -105,10 +106,8 @@ def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict
address_family_str = juniper_afi_safi_mapping(address_family.afi, address_family.safi) address_family_str = juniper_afi_safi_mapping(address_family.afi, address_family.safi)
item = f'{remote_addr} {address_family_str}' item = f'{remote_addr} {address_family_str}'
# ToDo: add vrf name # ToDo: add vrf name
routing_instance = '' routing_instance = f'VR {routing_instance}'
if routing_instance != '0': item = f'{item} {routing_instance}'
routing_instance = f'VR {routing_instance}'
item = f'{item} {routing_instance}'
peer_table[item] = copy.deepcopy(bgp_peer[remote_addr]) peer_table[item] = copy.deepcopy(bgp_peer[remote_addr])
peer_table[item].accepted_prefixes = address_family.accepted_prefixes peer_table[item].accepted_prefixes = address_family.accepted_prefixes
peer_table[item].metric_count += address_family.metric_count peer_table[item].metric_count += address_family.metric_count
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment