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

fix crash if metric data is None (backport from cmk 2.1 version)

parent 76f20e4f
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@
# 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-22: fix output for admin_state
# 2023-02-20: fix crash if metric data is None
#
# Example Agent Output:
......@@ -206,7 +207,8 @@ def check_bgp_peer(item, params, section: Dict[str, BgpPeer]) -> CheckResult:
for entry in peer.metric_count:
key, value = entry
yield Metric(name=f'bgp_peer_{key}', value=value, boundaries=(0, None))
if value id not None:
yield Metric(name=f'bgp_peer_{key}', value=value, boundaries=(0, None))
register.snmp_section(
......
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