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

update project

parent db078778
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/ospfv3-0.4.0-20231221.mkp "ospfv3-0.4.0-20231221.mkp"
# OSPFv3 # OSPFv3
Monitors status of OSPFv3 enabled devices Monitors status of OSPFv3 enabled devices
......
...@@ -102,26 +102,26 @@ class OspfV3Area: ...@@ -102,26 +102,26 @@ class OspfV3Area:
def parse_ospfv3_area(string_table: StringTable) -> Dict[str, OspfV3Area]: def parse_ospfv3_area(string_table: StringTable) -> Dict[str, OspfV3Area]:
areas = {} areas = {}
for area in string_table: for area in string_table:
AreaId, AreaImportAsExtern, AreaSpfRuns, AreaBdrRtrCount, AreaAsBdrRtrCount, AreaScopeLsaCount, \ area_id, import_as_extern, spf_runs, bdr_rtr_count, as_bdr_rtr_count, scope_lsa_count, scope_lsa_cksum_sum, \
AreaScopeLsaCksumSum, AreaSummary, AreaStubMetric, AreaNssaTranslatorRole, AreaNssaTranslatorState, \ summary, stub_metric, nssa_translator_role, nssa_translator_state, nssa_translator_stab_interval, \
AreaNssaTranslatorStabInterval, AreaNssaTranslatorEvents, AreaStubMetricType, AreaTEEnabled, = area nssa_translator_events, stub_metric_type, te_enabled, = area
areas[AreaId] = OspfV3Area( areas[area_id] = OspfV3Area(
AreaImportAsExtern=ospf_area_impotasextern(AreaImportAsExtern), AreaImportAsExtern=ospf_area_impotasextern(import_as_extern),
AreaSummary=ospf_area_summary(AreaSummary), AreaSummary=ospf_area_summary(summary),
AreaSpfRuns=int(AreaSpfRuns), AreaSpfRuns=int(spf_runs),
AreaBdrRtrCount=int(AreaBdrRtrCount), AreaBdrRtrCount=int(bdr_rtr_count),
AreaAsBdrRtrCount=int(AreaAsBdrRtrCount), AreaAsBdrRtrCount=int(as_bdr_rtr_count),
AreaScopeLsaCount=int(AreaScopeLsaCount), AreaScopeLsaCount=int(scope_lsa_count),
AreaScopeLsaCksumSum=int(AreaScopeLsaCksumSum), AreaScopeLsaCksumSum=int(scope_lsa_cksum_sum),
AreaStubMetric=int(AreaStubMetric), AreaStubMetric=int(stub_metric),
AreaNssaTranslatorRole=ospf_area_translatorrole(AreaNssaTranslatorRole), AreaNssaTranslatorRole=ospf_area_translatorrole(nssa_translator_role),
AreaNssaTranslatorState=ospf_area_translatorrolestate(AreaNssaTranslatorState), AreaNssaTranslatorState=ospf_area_translatorrolestate(nssa_translator_state),
AreaNssaTranslatorStabInterval=int(AreaNssaTranslatorStabInterval), AreaNssaTranslatorStabInterval=int(nssa_translator_stab_interval),
AreaNssaTranslatorEvents=int(AreaNssaTranslatorEvents), AreaNssaTranslatorEvents=int(nssa_translator_events),
AreaStubMetricType=ospf_area_submetrictype(AreaStubMetricType), AreaStubMetricType=ospf_area_submetrictype(stub_metric_type),
AreaTEEnabled=ospf_area_teeenabled(AreaTEEnabled), AreaTEEnabled=ospf_area_teeenabled(te_enabled),
AreaType=get_area_type(AreaImportAsExtern, AreaSummary) AreaType=get_area_type(import_as_extern, summary)
) )
return areas return areas
......
...@@ -89,26 +89,26 @@ class OspfV3General: ...@@ -89,26 +89,26 @@ class OspfV3General:
def parse_ospfv3_general(string_table: StringTable) -> Optional[OspfV3General]: def parse_ospfv3_general(string_table: StringTable) -> Optional[OspfV3General]:
try: try:
OID_END, RouterId, AdminStatus, VersionNumber, AreaBdrRtrStatus, ASBdrRtrStatus, AsScopeLsaCount, \ oid_end, router_id, admin_status, version_number, area_bdr_rtr_status, as_bdr_rtr_status, as_scope_lsa_count, \
AsScopeLsaCksumSum, OriginateNewLsas, RxNewLsas, ExtLsaCount, ExtAreaLsdbLimit, \ as_scope_lsa_cksum_sum, originate_new_lsas, rx_new_lsas, ext_lsa_count, ext_area_lsdb_limit, \
ReferenceBandwidth, StubRouterSupport, StubRouterAdvertisement = string_table[0] reference_bandwidth, stub_router_support, stub_router_advertisement = string_table[0]
except (ValueError, IndexError): except (ValueError, IndexError):
return return
return OspfV3General( return OspfV3General(
RouterId=render_ipv4_neighbor_id(RouterId), RouterId=render_ipv4_neighbor_id(router_id),
AdminStatus=ospf_admin_status(AdminStatus), AdminStatus=ospf_admin_status(admin_status),
VersionNumber=int(VersionNumber), VersionNumber=int(version_number),
AreaBdrRtrStatus=ospf_abr_asbr_status(AreaBdrRtrStatus), AreaBdrRtrStatus=ospf_abr_asbr_status(area_bdr_rtr_status),
ASBdrRtrStatus=ospf_abr_asbr_status(ASBdrRtrStatus), ASBdrRtrStatus=ospf_abr_asbr_status(as_bdr_rtr_status),
AsScopeLsaCount=int(AsScopeLsaCount), AsScopeLsaCount=int(as_scope_lsa_count),
AsScopeLsaCksumSum=int(AsScopeLsaCksumSum), AsScopeLsaCksumSum=int(as_scope_lsa_cksum_sum),
RxNewLsas=int(RxNewLsas), RxNewLsas=int(rx_new_lsas),
ExtLsaCount=int(ExtLsaCount), ExtLsaCount=int(ext_lsa_count),
ExtAreaLsdbLimit=int(ExtAreaLsdbLimit), ExtAreaLsdbLimit=int(ext_area_lsdb_limit),
ReferenceBandwidth=int(ReferenceBandwidth), ReferenceBandwidth=int(reference_bandwidth),
StubRouterSupport=ospf_stub_router_support(StubRouterSupport), StubRouterSupport=ospf_stub_router_support(stub_router_support),
StubRouterAdvertisement=ospf_stub_router_advertisement(StubRouterAdvertisement), StubRouterAdvertisement=ospf_stub_router_advertisement(stub_router_advertisement),
) )
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
# #
# 2021-09-17: rewritten for CMK 2.0 # 2021-09-17: rewritten for CMK 2.0
# 2021-10-02: added WATO options # 2021-10-02: added WATO options
# 2023-12-21: replaced ifDescr by ifName
# fixed handling if non-matching ifIndex
# #
# sample snmpwalk # sample snmpwalk
# #
...@@ -140,34 +142,32 @@ def parse_ospfv3_interface(string_table: List[StringTable]) -> Optional[Dict[str ...@@ -140,34 +142,32 @@ def parse_ospfv3_interface(string_table: List[StringTable]) -> Optional[Dict[str
ospf_interfaces = {} ospf_interfaces = {}
interfaceinfo, interfaces = string_table interfaceinfo, interfaces = string_table
interfaces_by_index = {if_index: if_name for if_index, if_name in interfaces}
for ospf_interface in interfaceinfo: for ospf_interface in interfaceinfo:
OID_END, IfAreaId, IfType, IfAdminStatus, IfRtrPriority, IfHelloInterval, IfRtrDeadInterval, IfPollInterval, \ oid_end, area_id, if_type, admin_state, rtr_priority, hello_interval, rtr_dead_interval, poll_interval, \
IfState, IfDesignatedRouter, IfBackupDesignatedRouter, IfEvents, IfMetricValue, IfLinkScopeLsaCount, \ if_state, designated_router, backup_designated_router, if_events, metric_value, link_scope_lsa_count, \
IfLinkLsaCksumSum = ospf_interface link_lsa_cksum_sum = ospf_interface
ospfIfIndex, ospfIfInstId = OID_END.split('.') ospf_if_index, ospf_if_inst_id = oid_end.split('.')
LocalInterface = '' local_interface = get_short_if_name(interfaces_by_index.get(ospf_if_index, ospf_if_index))
for interface in interfaces:
ifIndex, ifName = interface
if ifIndex == ospfIfIndex:
LocalInterface = get_short_if_name(ifName)
ospf_interfaces[LocalInterface] = OspfV3Interface( ospf_interfaces[local_interface] = OspfV3Interface(
IfAreaId=int(IfAreaId), IfAreaId=int(area_id),
IfType=ospf_if_type(IfType), IfType=ospf_if_type(if_type),
IfAdminStatus=ospf_if_admin_status(IfAdminStatus), IfAdminStatus=ospf_if_admin_status(admin_state),
IfRtrPriority=int(IfRtrPriority), IfRtrPriority=int(rtr_priority),
IfHelloInterval=int(IfHelloInterval), IfHelloInterval=int(hello_interval),
IfRtrDeadInterval=int(IfRtrDeadInterval), IfRtrDeadInterval=int(rtr_dead_interval),
IfPollInterval=int(IfPollInterval), IfPollInterval=int(poll_interval),
IfState=ospf_if_state(IfState), IfState=ospf_if_state(if_state),
IfDesignatedRouter=render_ipv4_neighbor_id(IfDesignatedRouter), IfDesignatedRouter=render_ipv4_neighbor_id(designated_router),
IfBackupDesignatedRouter=render_ipv4_neighbor_id(IfBackupDesignatedRouter), IfBackupDesignatedRouter=render_ipv4_neighbor_id(backup_designated_router),
IfEvents=int(IfEvents), IfEvents=int(if_events),
IfMetricValue=int(IfMetricValue), IfMetricValue=int(metric_value),
IfLinkScopeLsaCount=int(IfLinkScopeLsaCount), IfLinkScopeLsaCount=int(link_scope_lsa_count),
IfLinkLsaCksumSum=int(IfLinkLsaCksumSum), IfLinkLsaCksumSum=int(link_lsa_cksum_sum),
) )
return ospf_interfaces return ospf_interfaces
...@@ -235,10 +235,10 @@ register.snmp_section( ...@@ -235,10 +235,10 @@ register.snmp_section(
] ]
), ),
SNMPTree( SNMPTree(
base='.1.3.6.1.2.1.2.2.1', # base='.1.3.6.1.2.1.31.1.1.1', #
oids=[ oids=[
'1', # ifIndex OIDEnd(), # ifIndex
'2', # ifDescr '1', # ifName
] ]
), ),
], ],
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
# #
# 2021-09-17: rewritten for CMK 2.0 # 2021-09-17: rewritten for CMK 2.0
# 2021-10-02: added WATO options # 2021-10-02: added WATO options
# 2023-12-21: replaced ifDescr by ifName
# fixed handling if non-matching ifIndex
# #
# .1.3.6.1.2.1.191.1.9.1.4.1.0.50529054 = INTEGER: 2 # .1.3.6.1.2.1.191.1.9.1.4.1.0.50529054 = INTEGER: 2
# .1.3.6.1.2.1.191.1.9.1.5.1.0.50529054 = Hex-STRING: FE 80 00 00 00 00 00 00 01 92 01 68 00 00 00 03 # .1.3.6.1.2.1.191.1.9.1.5.1.0.50529054 = Hex-STRING: FE 80 00 00 00 00 00 00 01 92 01 68 00 00 00 03
...@@ -118,31 +120,29 @@ def parse_ospfv3_neighbor(string_table: List[StringTable]) -> Dict[str, OspfV3Ne ...@@ -118,31 +120,29 @@ def parse_ospfv3_neighbor(string_table: List[StringTable]) -> Dict[str, OspfV3Ne
neighbors = {} neighbors = {}
neighborinfo, interfaces = string_table neighborinfo, interfaces = string_table
interfaces_by_index = {if_index: if_name for if_index, if_name in interfaces}
for neighbor in neighborinfo: for neighbor in neighborinfo:
OID_END, nbrAddressType, nbrAddress, nbrOptions, nbrPriority, nbrState, nbrEvents, nbrLsRetransQLen, \ oid_end, address_type, address, options, priority, state, events, ls_retrans_q_len, hello_suppressed, \
nbrHelloSuppressed, nbrRestartHelperStatus, nbrRestartHelperAge, nbrRestartHelperExitReason = neighbor restart_helper_status, restart_helper_age, restart_helper_exit_reason = neighbor
if nbrAddressType == '2': # IPv6 address if address_type == '2': # IPv6 address
nbrAddress = render_ipv6_address(nbrAddress) address = render_ipv6_address(address)
nbrIfIndex, nbrIfInstId, nbrRtrId = OID_END.split('.') nbr_if_index, nbr_if_inst_id, nbr_rtr_id = oid_end.split('.')
nbrLocalInterface = '' nbr_local_interface = get_short_if_name(interfaces_by_index.get(nbr_if_index, nbr_if_index))
for interface in interfaces:
ifIndex, ifName = interface neighbors[f'{address} on {nbr_local_interface}'] = OspfV3Neighbor(
if ifIndex == nbrIfIndex: nbrRtrId=render_ipv4_neighbor_id(nbr_rtr_id),
nbrLocalInterface = get_short_if_name(ifName) nbrOptions=options,
nbrPriority=int(priority),
neighbors[f'{nbrAddress} on {nbrLocalInterface}'] = OspfV3Neighbor( nbrState=int(state),
nbrRtrId=render_ipv4_neighbor_id(nbrRtrId), nbrEvents=int(events),
nbrOptions=nbrOptions, nbrLsRetransQLen=int(ls_retrans_q_len),
nbrPriority=int(nbrPriority), nbrHelloSuppressed=ospf_nbr_hellosuppressed(hello_suppressed),
nbrState=int(nbrState), nbrRestartHelperStatus=ospf_nbr_helperstatus(restart_helper_status),
nbrEvents=int(nbrEvents), nbrRestartHelperAge=int(restart_helper_age),
nbrLsRetransQLen=int(nbrLsRetransQLen), nbrRestartHelperExitReason=ospf_nbr_helperexitreason(restart_helper_exit_reason),
nbrHelloSuppressed=ospf_nbr_hellosuppressed(nbrHelloSuppressed),
nbrRestartHelperStatus=ospf_nbr_helperstatus(nbrRestartHelperStatus),
nbrRestartHelperAge=int(nbrRestartHelperAge),
nbrRestartHelperExitReason=ospf_nbr_helperexitreason(nbrRestartHelperExitReason),
) )
if neighbors: if neighbors:
return neighbors return neighbors
...@@ -224,10 +224,10 @@ register.snmp_section( ...@@ -224,10 +224,10 @@ register.snmp_section(
] ]
), ),
SNMPTree( SNMPTree(
base='.1.3.6.1.2.1.2.2.1', # base='.1.3.6.1.2.1.31.1.1.1', #
oids=[ oids=[
'1', # ifIndex OIDEnd(), # ifIndex
'2', # ifDescr '1', # ifName
] ]
), ),
], ],
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
# #
# 2021-09-17: rewritten for CMK 2.0 # 2021-09-17: rewritten for CMK 2.0
# 2021-10-02: added WATO options # 2021-10-02: added WATO options
# 2023-12-21: replaced ifDescr by ifName
# fixed handling if non-matching ifIndex
# #
# .1.3.6.1.2.1.191.1.11.1.3.3.50529054 = INTEGER: 0 # .1.3.6.1.2.1.191.1.11.1.3.3.50529054 = INTEGER: 0
# .1.3.6.1.2.1.191.1.11.1.4.3.50529054 = Gauge32: 0 # .1.3.6.1.2.1.191.1.11.1.4.3.50529054 = Gauge32: 0
...@@ -117,35 +119,32 @@ def parse_ospfv3_virtuallink(string_table: List[StringTable]) -> Dict[str, OspfV ...@@ -117,35 +119,32 @@ def parse_ospfv3_virtuallink(string_table: List[StringTable]) -> Dict[str, OspfV
virtual_links = {} virtual_links = {}
virtual_links_info, interfaces = string_table virtual_links_info, interfaces = string_table
interfaces_by_index = {if_index: if_name for if_index, if_name in interfaces}
for virtual_link in virtual_links_info: for virtual_link in virtual_links_info:
OID_END, VirtNbrIfIndex, VirtNbrIfInstId, VirtNbrAddressType, VirtNbrAddress, VirtNbrOptions, VirtNbrState, \ oid_end, if_index, if_inst_id, address_type, address, options, state, events, ls_retrans_q_len, \
VirtNbrEvents, VirtNbrLsRetransQLen, VirtNbrHelloSuppressed, VirtNbrIfId, VirtNbrRestartHelperStatus, \ hello_suppressed, if_id, restart_helper_status, restart_helper_age, \
VirtNbrRestartHelperAge, VirtNbrRestartHelperExitReason, = virtual_link restart_helper_exit_reason, = virtual_link
if VirtNbrAddressType == '2': # IPv6 address if address_type == '2': # IPv6 address
VirtNbrAddress = render_ipv6_address(VirtNbrAddress) address = render_ipv6_address(address)
VirtNbrArea, VirtNbrId = OID_END.split('.') area, nbr_id = oid_end.split('.')
nbrLocalInterface = '' nbr_local_interface = get_short_if_name(interfaces_by_index.get(if_index, if_index))
for interface in interfaces:
ifIndex, ifName = interface virtual_links[address] = OspfV3VirtualLink(
if ifIndex == VirtNbrIfIndex: VirtNbrId=render_ipv4_neighbor_id(nbr_id),
nbrLocalInterface = get_short_if_name(ifName) VirtNbrArea=int(area),
VirtNbrOptions=options,
# virtual_links[f'{VirtNbrAddress} on {nbrLocalInterface}']= OspfV3VirtualLink( VirtNbrState=int(state),
virtual_links[VirtNbrAddress] = OspfV3VirtualLink( VirtNbrEvents=int(events),
VirtNbrId=render_ipv4_neighbor_id(VirtNbrId), VirtNbrLsRetransQLen=int(ls_retrans_q_len),
VirtNbrArea=int(VirtNbrArea), VirtNbrHelloSuppressed=ospf_nbr_hellosuppressed(hello_suppressed),
VirtNbrOptions=VirtNbrOptions, VirtNbrRestartHelperStatus=ospf_nbr_helperstatus(restart_helper_status),
VirtNbrState=int(VirtNbrState), VirtNbrRestartHelperAge=int(restart_helper_age),
VirtNbrEvents=int(VirtNbrEvents), VirtNbrRestartHelperExitReason=ospf_nbr_helperexitreason(restart_helper_exit_reason),
VirtNbrLsRetransQLen=int(VirtNbrLsRetransQLen), VitrNbrLocalInterface=nbr_local_interface,
VirtNbrHelloSuppressed=ospf_nbr_hellosuppressed(VirtNbrHelloSuppressed),
VirtNbrRestartHelperStatus=ospf_nbr_helperstatus(VirtNbrRestartHelperStatus),
VirtNbrRestartHelperAge=int(VirtNbrRestartHelperAge),
VirtNbrRestartHelperExitReason=ospf_nbr_helperexitreason(VirtNbrRestartHelperExitReason),
VitrNbrLocalInterface=nbrLocalInterface,
) )
if virtual_links: if virtual_links:
return virtual_links return virtual_links
...@@ -229,10 +228,10 @@ register.snmp_section( ...@@ -229,10 +228,10 @@ register.snmp_section(
] ]
), ),
SNMPTree( SNMPTree(
base='.1.3.6.1.2.1.2.2.1', # base='.1.3.6.1.2.1.31.1.1.1', #
oids=[ oids=[
'1', # ifIndex OIDEnd(), # ifIndex
'2', # ifDescr '1', # ifName
] ]
), ),
], ],
......
File added
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
'gui': ['metrics/ospfv3.py', 'wato/ospfv3.py']}, 'gui': ['metrics/ospfv3.py', 'wato/ospfv3.py']},
'name': 'ospfv3', 'name': 'ospfv3',
'title': 'Collection of OSPFv3 checks', 'title': 'Collection of OSPFv3 checks',
'version': '0.4.0-20230603', 'version': '0.4.0-20231221',
'version.min_required': '2.1.0b1', 'version.min_required': '2.1.0b1',
'version.packaged': '2.1.0p21', 'version.packaged': '2.2.0p14',
'version.usable_until': None} 'version.usable_until': None}
\ No newline at end of file
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