How to make service name configureable in a special_agent?

Hi everyone,

I’ve developed a special agent for a specific API check for our CheckMK.
The service name is defined from agent_based/http_api.py, using the service_name parameter of CheckPlugin(). The full block looks like this:

CHECK_NAME      = "HTTP API"

check_plugin_http_api = CheckPlugin(
    name = "http_api",
    service_name = f"{CHECK_NAME} Records",
    discovery_function = discover_http_api,
    check_function = check_http_api,
    check_default_parameters = {"records_count_lower": ("fixed", (5000, 4000))},
    check_ruleset_name="http_api",
)

I’d like to add another parameter to the rulesets/special_agent.py now, with which I can make the service_name configurable, just like I can do with the CheckMK internal plugin collection check httpv2:

Can anybody tell me how to use the ruleset parameter form data in the agent_based check plugin setup? I do not really understand how checkmk is handing it’s parameters between the involved functions during discovery and check call.

1 Like

That would be good to know …