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

update project

parent 2120f936
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/cisco_meraki-1.3.3-20240716.mkp "cisco_meraki-1.3.3-20240716.mkp"
[PACKAGE]: ../../raw/master/mkp/cisco_meraki-1.3.5-20240807.mkp "cisco_meraki-1.3.5-20240807.mkp"
[SDK]: ../../raw/master/mkp/MerakiSDK-1.46.0-20240516.mkp "MerakiSDK-1.46.0-20240516.mkpp"
# Cisco Meraki special agent
......
File added
......@@ -10,6 +10,7 @@
# 2024-06-29: refactored for CMK 2.3
# 2024-06-30: renamed from cisco_meraki_org_appliance_performance.py in to appliance_performance.py
# 2024-08-02: fixed if perfscore was float instead of int
from collections.abc import Mapping
......@@ -31,16 +32,15 @@ from cmk_addons.plugins.meraki.lib.utils import load_json
# {"perfScore": 1}
# sample string_table
# [['[{"perfScore": 0}]']]
def parse_appliance_performance(string_table: StringTable) -> int | None:
# [['[{"perfScore": 12.0}]']]
# [['[{"perfScore": 0.00021434677238992957}]']]
def parse_appliance_performance(string_table: StringTable) -> float | None:
json_data = load_json(string_table)
if (json_data := json_data[0]) is None:
return
perfscore = json_data.get('perfScore')
if isinstance(perfscore, int):
return int(perfscore)
try:
return float(json_data[0]['perfScore'])
except (ValueError, TypeError, KeyError):
return None
agent_section_meraki_org_appliance_performance = AgentSection(
......@@ -49,11 +49,11 @@ agent_section_meraki_org_appliance_performance = AgentSection(
)
def discover_appliance_performance(section: int) -> DiscoveryResult:
def discover_appliance_performance(section: float) -> DiscoveryResult:
yield Service()
def check_appliance_performance(params: Mapping[str, any], section: int) -> CheckResult:
def check_appliance_performance(params: Mapping[str, any], section: float) -> CheckResult:
yield from check_levels(
value=section,
label='Utilization',
......
......@@ -13,6 +13,7 @@
# moved data parsing in to SSID class
# 2024-06-30: renamed from cisco_meraki_org_wireless_device_status.py int to wireless_device_ssid_status.py
# 2024-07-13: fixed crash on missing metrics (device dormant) ThX to Leon Buhleier
# 2024-08-07: fixed crash on missing power value (unit only) ThX to Leon Buhleier
from collections.abc import Mapping
from dataclasses import dataclass
......@@ -126,7 +127,7 @@ def check_wireless_device_status(
try:
power = int(ssid.power.split(' ')[0])
except AttributeError:
except (AttributeError, ValueError):
power = None
for metric, value in [
......
......@@ -63,7 +63,7 @@
'web': ['plugins/views/cisco_meraki.py']},
'name': 'cisco_meraki',
'title': 'Cisco Meraki special agent',
'version': '1.3.3-20240716',
'version': '1.3.5-20240807',
'version.min_required': '2.3.0b1',
'version.packaged': 'cmk-mkp-tool 0.2.0',
'version.usable_until': '2.4.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