2021-08-20: rewritten for CMK 2.0 by thl-cmk[at]outlook[dot]com based on the "BGP Peer State Check" check by Thomas Wollner (tw[at]ollner-net[dot]de), (http://wollner-net.de/check_mk/network_checks/bgp_peer-1.4.mkp) 2021-08-21: added more perfdata, added metrics file 2021-08-22: added WATO options, streamlined with cisco_bgp_peer 2021-08-29: moved static (longoutput) to inventory plugin moved helper functions to utils/bgp_peer WATO: removed htmloutput and infotext_values option 2021-11-14: merged check function with cisco_bgp_peer moved parse function to utils/bgp_peer 2022-04-02: WATO: added bgp neighbour states rewritten bgp neighbor state handling (made configurable) 2022-04-17: added peer_unavail_reason/peer_unavail_reason_str for huawei bgp peers 2022-04-24: added peer status to inventory added option to remove some columns from inventory 2022-04-28: added whois information to inventory 2022-04-29: added upper/lower prefix limits from wato added info if device is admin prefix limit capable (device_admin_limit) 2022-04-30: code clenup 2022-05-02: fixed missing not_in_service_time from params 2022-05-09: made item name configurable (don't use address-family/routing-instance/VRF) 2022-05-11: changed bgp_get_peer_entry to get proper parameters instead of Nontransparent list added remote_as to BgpPeerItem 2022-05-12: merged bgp_get_ip_address_from_oid with bgp_render_ip_address changed IPv6 address format to lower case as required by rfc5952 section-4.3 (this affects IPv6 items) 2022-09-05: added missing wato parameters to register.check_plugin check_default_parameters 2022-09-05: added internal_item to WATO as hidden_key to avoid warnings on cmk updates (THX to Jay2k1 for reporting the issue) 2022-09-10: made more reliable on limited data (fsm_established_time and admin_state) (THX to martin[dot]pechstein[at]posteo[dot]de) 2022-09-11: optimized internal flow: > alias > not found > admin down > peer state > ... 2023-01-21: changed to always yield fsm_established_time (not only if beep connects, but also on all other states) 2023-01-20: add description to BgpPeerItem (for Arista) 2023-01-22: fix output for admin_state 2023-02-16: changed for CMK 2.1 (moved gui files from local/share/.. to local/lib/..) fix type error in discovery (CMK2.1 GUI only) 2023-02-20: fix crash if metric data is None 2023-03-26: optimized output of metrics, GetRateError will not be set to 0 anymore 2023-06-11: set upper cmk version to 2.2.0b1 for bgp_peer-2.0.1-20230611.mkp 2023-06-11: moved wato file to check_parameters sub directory removed declare_invtable_view from view definition on cmk 2.2 (see werk 15493) 2023-06-13: added huawei metrics from huawei_bgp_peer 2023-08-17: fix removed internal_item form check_default_parameters (THX mail[at]bastian-kuhn[dot]de) added warning if internal_item is missing in params 2024-05-17: fixed typo in metrics file range mac -> max (crashed graphs in cmk 2.3.) 2024-06-07: fixed crash on configured state mapping