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

update project

parent 50cff349
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -30,7 +30,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
StringTable,
)
from cmk.base.plugins.agent_based.utils.cisco_meraki import (
get_int, # type: ignore[import]
get_int, # type: ignore[import]
load_json,
)
......@@ -133,12 +133,11 @@ def parse_cisco_meraki_org_api_requests_by_organization(
string_table: StringTable
) -> Mapping[str, Sequence[OrganizationApiCount]] | None:
if json_data := load_json(string_table):
section = {}
for entry in json_data:
section[entry['org_id']] = []
for code in entry['requests'][0]['counts']:
section[entry['org_id']].append(OrganizationApiCount.parse(code))
return section
return {
entry['org_id']: [
OrganizationApiCount.parse(code) for code in entry['requests'][0]['counts']
] for entry in json_data
}
register.agent_section(
......@@ -207,7 +206,6 @@ def check_organisations_api(
state=State.OK if org.api else State(params['state_api_not_enabled']),
summary=f'Status: {_api_status[org.api]}',
)
org_id = f'ID: {org.id}'
org_name = f'Name: {org.name}'
org_id_notice = f'Organisation ID: {org.id}'
......@@ -232,9 +230,9 @@ def check_organisations_api(
yield Result(state=State.OK, notice=org_name_notice)
if section_cisco_meraki_org_api_requests_by_organization is None or (
api_requests := section_cisco_meraki_org_api_requests_by_organization.get(params.get(
'internal_item_name'
))
api_requests := section_cisco_meraki_org_api_requests_by_organization.get(params.get(
'internal_item_name'
))
) is None:
return
......
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