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

Delete inv_fritzbox_smarthome.py

parent c6ecea9b
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2023-12-29
# File : inv_fritzbox_smarthome.py (inventory plugin)
#
from typing import Dict
from cmk.base.plugins.agent_based.agent_based_api.v1 import register, TableRow
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import InventoryResult
from cmk.base.plugins.agent_based.utils.fritzbox_smarthome import AvmSmartHomeDevice
def _add_avm_smarthome_device(device: AvmSmartHomeDevice):
path = ['hardware', 'avm', 'smart_home_devices']
yield TableRow(
path=path,
key_columns={'id': device.id},
inventory_columns={
'identifier': device.identifier,
'name': device.name,
'fw_version': device.fw_version,
'manufacturer': device.manufacturer,
'product_name': device.product_name,
'functions': ', '.join(device.functions)
}
)
def inventory_fritzbox_smarthome(section: AvmSmartHomeDevice | Dict[str, AvmSmartHomeDevice]) -> InventoryResult:
if isinstance(section, AvmSmartHomeDevice):
yield from _add_avm_smarthome_device(device=section)
else:
for device in section.values():
yield from _add_avm_smarthome_device(device)
register.inventory_plugin(
name="inv_fritzbox_smarthome",
sections=['fritzbox_smarthome'],
inventory_function=inventory_fritzbox_smarthome,
)
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