SNMP Custom Check Crash


I’m trying to create my first custom SNMP check, so I have tried to start off as simple as possible with minimal code to get a stable result and work from there, but I am getting a an error generated from "cmk -vp --debug " Not sure what I have done wrong in my code for it to be crashing. Any pointers would be greatly appreciated. Thanks

CMK version: 2.0.0p25 (CEE)
OS version: Ubuntu 18.04.4 LTS

Error message:

Traceback (most recent call last):
  File "/omd/sites/Azure/bin/cmk", line 98, in <module>
    exit_status ="--check", None, opts, args)
  File "/omd/sites/Azure/lib/python3/cmk/base/modes/", line 69, in call
    return handler(*handler_args)
  File "/omd/sites/Azure/lib/python3/cmk/base/modes/", line 1643, in mode_check
    return checking.do_check(
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 37, in wrapped_check_func
    status, infotexts, long_infotexts, perfdata = check_func(hostname, *args, **kwargs)
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 212, in do_check
    num_success, plugins_missing_data = _do_all_checks_on_host(
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 343, in _do_all_checks_on_host
    success = execute_check(
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 486, in execute_check
    submit, data_received, result = get_aggregated_result(
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 564, in get_aggregated_result
    result = _aggregate_results(check_function(**kwargs))
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 796, in _aggregate_results
    perfdata, results = _consume_and_dispatch_result_types(subresults)
  File "/omd/sites/Azure/lib/python3/cmk/base/", line 840, in _consume_and_dispatch_result_types
    for subr in subresults:
  File "/omd/sites/Azure/lib/python3/cmk/base/api/agent_based/register/", line 89, in filtered_generator
    for element in generator(*args, **kwargs):
  File "/omd/sites/Azure/local/lib/python3/cmk/base/plugins/agent_based/", line 41, in check_Ubiquiti
    if item[0].contains("low"):
AttributeError: 'str' object has no attribute 'contains'

SNMP Check Code

from .agent_based_api.v1 import *
from .agent_based_api.v1.type_defs import (

    name = "snmp_Ubiquiti",
    detect = startswith(".", "Ubiquiti"),
    fetch = SNMPTree(
        base = '.',
        oids = [

def discover_Ubiquiti(section) -> DiscoveryResult:
    for item in section:
        yield Service(item=item)

def check_Ubiquiti(params, section) -> CheckResult:
    for item in section:
        if item[0].contains("low"):
            yield Result(state=State.OK, summary="Found value")
    yield Result(state=State.CRIT, summary="Not found")

    name = "snmp_Ubiquiti",
    service_name = "Ubiquiti Test",
    discovery_function = discover_Ubiquiti,
    check_function = check_Ubiquiti,