Hello Ja_n and welcome to the forum.
Some of teh temperature modules can be captured via SNMP.
Here is an example of an Inveo device which uses 1-wire as temperature sensors.
#/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Inveo Monitoring
"""
from typing import Dict, Any, Mapping, Sequence, List
from cmk.agent_based.v2 import (
SNMPSection,
SNMPTree,
StringTable,
DiscoveryResult,
CheckResult,
Service,
startswith,
get_value_store,
CheckPlugin,
)
from cmk.plugins.lib.temperature import check_temperature
from pprint import pprint
ParsedSection = Mapping[str, tuple[str, str]]
Section = Mapping[str, dict[str, float]]
def parse_inveo_temp(string_table: List[StringTable]) -> ParsedSection:
parsed = {}
parsed['temperature'] = int(string_table[0][0][0])
return parsed
snmp_section_inveo_temp = SNMPSection(
name="inveo_temp",
parse_function=parse_inveo_temp,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.42814.14.3.5',
oids=[
'3', # sensor nr 1 temp * 10
],
),
],
detect=startswith(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.42814.14"),
)
def discover_inveo_temp(section: Section) -> DiscoveryResult:
yield Service(item="1")
def check_inveo_temp(item: str, params: Sequence[Mapping[str, Any]], section: Section) -> CheckResult:
if 'temperature' in section:
value_store = get_value_store()
temp = float(section['temperature']) / 10
yield from check_temperature(
temp,
params,
value_store=value_store,
unique_name="inveo_temp.%s" % item
)
check_plugin_inveo_temp = CheckPlugin(
name="inveo_temp",
service_name="Sensor %s",
discovery_function=discover_inveo_temp,
check_function=check_inveo_temp,
check_default_parameters={},
check_ruleset_name="temperature",
)
In relation to the MIB you device canhave more the one connector for 1-wire temp, so you need to add next oid.
RG, Christian