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 52a99d48 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

modified for check APIv2

parent 740727b4
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/juniper_bgp_peer-1.0.0-20230613.mkp "juniper_bgp_peer-1.0.0-20230613.mkp" [PACKAGE]: ../../raw/master/mkp/juniper_bgp_peer-1.0.1-20250329.mkp "juniper_bgp_peer-1.0.1-20250329.mkp"
# Juniper BGP Peer # Juniper BGP Peer
Monitors status of Juniper BGP peers (IPv4 and IPv6) Monitors status of Juniper BGP peers (IPv4 and IPv6)
......
File added
...@@ -11,29 +11,28 @@ ...@@ -11,29 +11,28 @@
# #
# THX to Jeff Fern jeff[dash]cmk[at]fcse[dot]co[dot]uk for testing and providing feedback to make this addon happen # THX to Jeff Fern jeff[dash]cmk[at]fcse[dot]co[dot]uk for testing and providing feedback to make this addon happen
# #
# 2022-04-30: code cleanup/streamlining # 2022-04-30: code cleanup/streamlining
# # 2025-03-29: moved to check APIv2 to prepare for CMK2.4
from typing import List from typing import List
from cmk.base.plugins.agent_based.agent_based_api.v1 import ( from cmk.agent_based.v2 import (
register,
SNMPTree,
OIDBytes, OIDBytes,
startswith,
OIDEnd, OIDEnd,
) SNMPSection,
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( SNMPTree,
StringByteTable, StringByteTable,
startswith,
) )
from cmk.base.plugins.agent_based.utils.bgp_peer import ( from cmk_addons.plugins.bgp_peer.lib.bgp_peer import (
InvBgpPeer, InvBgpPeer,
bgp_error_as_string, bgp_error_as_string,
bgp_error_code_as_hex, bgp_error_code_as_hex,
bgp_render_ip_address, bgp_render_ip_address,
get_bgp_type, get_bgp_type,
) )
from cmk.base.plugins.agent_based.utils.juniper_bgp_peer import ( from cmk_addons.plugins.bgp_peer.lib.juniper_bgp_peer import (
juniper_afi_safi_mapping, juniper_afi_safi_mapping,
) )
...@@ -86,7 +85,7 @@ def parse_inv_juniper_bgp_peer(string_table: List[StringByteTable]): ...@@ -86,7 +85,7 @@ def parse_inv_juniper_bgp_peer(string_table: List[StringByteTable]):
return bgp_peers return bgp_peers
register.snmp_section( snmp_section_inv_juniper_bgp_peer=SNMPSection(
name='inv_juniper_bgp_peer', name='inv_juniper_bgp_peer',
parse_function=parse_inv_juniper_bgp_peer, parse_function=parse_inv_juniper_bgp_peer,
parsed_section_name='inv_bgp_peer', parsed_section_name='inv_bgp_peer',
......
...@@ -18,30 +18,29 @@ ...@@ -18,30 +18,29 @@
# 2023-01-25: fixed routing instance in item # 2023-01-25: fixed routing instance in item
# 2023-02-20: fixed crash on unexpected input data (i.e. in_prefixes_active) # 2023-02-20: fixed crash on unexpected input data (i.e. in_prefixes_active)
# THX stephen[dot]Chrobot[dash]Hudson[at]nominet[dot]uk # THX stephen[dot]Chrobot[dash]Hudson[at]nominet[dot]uk
# # 2025-03-29: moved to check APIv2 to prepare for CMK2.4
import copy import copy
from typing import List, Dict, Optional, Tuple from typing import List, Dict, Optional, Tuple
from dataclasses import dataclass from dataclasses import dataclass
from cmk.base.plugins.agent_based.agent_based_api.v1 import ( from cmk.agent_based.v2 import (
register,
SNMPTree,
startswith,
OIDEnd,
OIDBytes, OIDBytes,
) OIDEnd,
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( SNMPSection,
SNMPTree,
StringByteTable, StringByteTable,
startswith,
) )
from cmk.base.plugins.agent_based.utils.bgp_peer import ( from cmk_addons.plugins.bgp_peer.lib.bgp_peer import (
BgpPeer, BgpPeer,
bgp_get_peer_entry, bgp_get_peer_entry,
bgp_render_ip_address, bgp_render_ip_address,
) )
from cmk.base.plugins.agent_based.utils.juniper_bgp_peer import ( from cmk_addons.plugins.bgp_peer.lib.juniper_bgp_peer import (
juniper_afi_safi_mapping, juniper_afi_safi_mapping,
) )
...@@ -120,7 +119,7 @@ def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict ...@@ -120,7 +119,7 @@ def parse_juniper_bgp_peer(string_table: List[StringByteTable]) -> Optional[Dict
return peer_table return peer_table
register.snmp_section( snmp_section_juniper_bgp_peer=SNMPSection(
name='juniper_bgp_peer', name='juniper_bgp_peer',
parse_function=parse_juniper_bgp_peer, parse_function=parse_juniper_bgp_peer,
parsed_section_name='bgp_peer', parsed_section_name='bgp_peer',
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
'NOTE: this plugin will supersede the original ' 'NOTE: this plugin will supersede the original '
'juniper_bgp_status plugin.\n', 'juniper_bgp_status plugin.\n',
'download_url': 'https://thl-cmk.hopto.org/gitlab/checkmk/juniper-networks/juniper_bgp_peer', 'download_url': 'https://thl-cmk.hopto.org/gitlab/checkmk/juniper-networks/juniper_bgp_peer',
'files': {'agent_based': ['juniper_bgp_peer.py', 'files': {'cmk_addons_plugins': ['bgp_peer/agent_based/inv_juniper_bgp_peer.py',
'inv_juniper_bgp_peer.py', 'bgp_peer/agent_based/juniper_bgp_peer.py',
'utils/juniper_bgp_peer.py']}, 'bgp_peer/lib/juniper_bgp_peer.py']},
'name': 'juniper_bgp_peer', 'name': 'juniper_bgp_peer',
'title': 'Juniper BGP peer', 'title': 'Juniper BGP peer',
'version': '1.0.0-20230613', 'version': '1.0.1-20250329',
'version.min_required': '2.0.0b1', 'version.min_required': '2.3.0b1',
'version.packaged': '2.2.0p24', 'version.packaged': 'cmk-mkp-tool 0.2.0',
'version.usable_until': None} 'version.usable_until': '2.5.0b1'}
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