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

update project

parent b79e2e3f
No related branches found
No related tags found
No related merge requests found
[PACKAGE]: ../../raw/master/mkp/cisco_meraki-1.3.0-20240623.mkp "cisco_meraki-1.3.0-20240623.mkp"
[PACKAGE]: ../../raw/master/mkp/cisco_meraki-1.3.1-20240624.mkp "cisco_meraki-1.3.1-20240624.mkp"
[SDK]: ../../raw/master/mkp/MerakiSDK-1.46.0-20240516.mkp "MerakiSDK-1.46.0-20240516.mkpp"
# Cisco Meraki special agent
......
File added
......@@ -13,7 +13,8 @@
# made data parsing more robust
# 2024-05-15: fixed typo in output of uplink.received (in -> In) (ThX to Rickard Eriksson)
# moved parse function to the dataclasses
# 2025-05-19: reworked appliance uplinks usage
# 2024-05-19: reworked appliance uplinks usage
# 2024-04-24: fixed, we can have no traffic if uplinc is not connected
from dataclasses import dataclass
from datetime import datetime
......@@ -186,25 +187,26 @@ def check_appliance_uplinks(item: str, params: Mapping[str, any], section: Appli
yield Result(state=State.OK, summary=f'Public IP: {uplink.public_ip}')
yield Result(state=State.OK, notice=f'Network: {section.network_name}')
if uplink.received: # and params.get('show_traffic'):
value = uplink.received * 8 / _TIMESPAN # Bits / Timespan
yield from check_levels(
value=value, # Bits
label='In',
metric_name='if_in_bps',
render_func=lambda v: render.networkbandwidth(v/8), # Bytes
# notice_only=True,
)
if uplink.sent: # and params.get('show_traffic'):
value = uplink.sent * 8 / _TIMESPAN # Bits / Timespan
yield from check_levels(
value=value, # Bits
label='Out',
metric_name='if_out_bps',
render_func=lambda v: render.networkbandwidth(v/8), # Bytes
# notice_only=True,
)
if uplink.status in ['active']: # we can only have traffic, if uplinc is connected
if uplink.received: # and params.get('show_traffic'):
value = uplink.received * 8 / _TIMESPAN # Bits / Timespan
yield from check_levels(
value=value, # Bits
label='In',
metric_name='if_in_bps',
render_func=lambda v: render.networkbandwidth(v/8), # Bytes
# notice_only=True,
)
if uplink.sent: # and params.get('show_traffic'):
value = uplink.sent * 8 / _TIMESPAN # Bits / Timespan
yield from check_levels(
value=value, # Bits
label='Out',
metric_name='if_out_bps',
render_func=lambda v: render.networkbandwidth(v/8), # Bytes
# notice_only=True,
)
# not needed, will show in device status (?)
# yield from check_last_reported_ts(last_reported_ts=section.last_reported_at.timestamp())
......
......@@ -15,10 +15,12 @@
#
# 2023-11-09: fixed crash if no powersupply in components
# 2023-11-19: fixed crash in inventory if no powersupply in components
# 2024-06-24: fixed don't output empty model/serial for poer supply
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from datetime import datetime
from collections.abc import Mapping, Sequence
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
......@@ -30,8 +32,8 @@ from cmk.base.plugins.agent_based.agent_based_api.v1 import (
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
CheckResult,
DiscoveryResult,
StringTable,
InventoryResult,
StringTable,
)
from cmk.base.plugins.agent_based.utils.cisco_meraki import (
......@@ -176,9 +178,10 @@ def check_device_status_ps(item: str, params: Mapping[str, any], section: Device
state=State(params.get('state_not_powering', 1)),
summary=f'Status: {power_supply.status}',
)
yield Result(state=State.OK, summary=f'Model: {power_supply.model}')
yield Result(state=State.OK, summary=f'Serial: {power_supply.serial}')
if power_supply.model:
yield Result(state=State.OK, summary=f'Model: {power_supply.model}')
if power_supply.serial:
yield Result(state=State.OK, summary=f'Serial: {power_supply.serial}')
if power_supply.poe:
yield Result(
state=State.OK,
......
......@@ -9,6 +9,7 @@
#
# 2023-11-12: added wireless device status (channel, channel width, signal power)
# 2024-05-12: added switch port statuses and API return Codes
# 2024-06-24: fixed, wrong total dor SSID perfometer signal_power -> 30
from cmk.gui.i18n import _
......@@ -146,7 +147,7 @@ graph_info['cisco_meraki.wireless_device_status.channel'] = {
perfometer_info.append({
'type': 'linear',
'segments': ['signal_power'],
'total': "signal_power",
'total': 30,
})
#
......@@ -328,4 +329,4 @@ perfometer_info.append({
# 'usage_in',
# 'usage_out',
# ]
# }
\ No newline at end of file
# }
......@@ -60,7 +60,7 @@
'plugins/wato/agent_cisco_meraki.py']},
'name': 'cisco_meraki',
'title': 'Cisco Meraki special agent',
'version': '1.3.0-20240623',
'version': '1.3.1-20240624',
'version.min_required': '2.2.0b1',
'version.packaged': '2.2.0p27',
'version.usable_until': '2.3.0b1'}
......@@ -158,7 +158,7 @@ def _valuespec_special_agent_cisco_meraki() -> ValueSpec:
(_SEC_NAME_SWITCH_PORTS_STATUSES,
_SEC_TITLE_SWITCH_PORTS_STATUSES),
(_SEC_NAME_WIRELESS_ETHERNET_STATUSES,
_SEC_TITLE_SWITCH_PORTS_STATUSES),
_SEC_TITLE_WIRELESS_ETHERNET_STATUSES),
(_SEC_NAME_WIRELESS_DEVICE_STATUS,
_SEC_TITLE_WIRELESS_DEVICE_STATUS),
(_SEC_NAME_ORG_SWITCH_PORTS_STATUSES,
......
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