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

update project

parent c6973c74
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@
# 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
# Example Agent Output:
# BGP4-MIB
......@@ -62,7 +63,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1 import (
get_rate,
GetRateError,
get_value_store,
IgnoreResultsError,
# IgnoreResultsError,
Metric,
render,
)
......@@ -198,16 +199,14 @@ def check_bgp_peer(item, params, section: Dict[str, BgpPeer]) -> CheckResult:
now_time = time.time()
value_store = get_value_store()
for entry in peer.metric_rate:
key, value = entry
for key, value in peer.metric_rate:
try:
value = get_rate(value_store, f'{key}', now_time, value, raise_overflow=True)
except GetRateError:
value = 0
continue
yield Metric(name=f'bgp_peer_{key}', value=value, boundaries=(0, None))
for entry in peer.metric_count:
key, value = entry
for key, value in peer.metric_count:
if value is not None:
yield Metric(name=f'bgp_peer_{key}', value=value, boundaries=(0, None))
......
File added
No preview for this file type
......@@ -19,7 +19,7 @@
'wato/inv_bgp_peer.py']},
'name': 'bgp_peer',
'title': 'BGP Peer',
'version': '20230220.v2.0.1',
'version.min_required': '2.1.0',
'version': '2.0.1-20230607',
'version.min_required': '2.1.0b1',
'version.packaged': '2.1.0p21',
'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