SNNP Plugin - DHCP Scope

Hello,

I’m new to create my own plugins.
I want to create a plugin where I get the DHCP Scope from some firewalls.
I already know which OIDs I need etc…
Reading the “writing your own check plug-ins” document is not helping me much.

This is currently what I have, I tried to import on the ~local/bin/check_mk/based/plugins/agent_based

register.snmp_section(
    name = "DHCP Scope",
    detect = startswith(".1.3.6.1.2.1.1.1.0", "T30"),
    fetch = SNMPTree (
        base = '.1.3.6.1.4.1.3097.6.2',
        oids = [
            '.1',     
        ],
    ),   
)

I must be doing something wrong, I don’t know where to find this service or if I’m importing it in the right place.

The small code part is only the registering of an data section for SNMP.
You define there only what data should be fetched from a device matching the detect condition.

Now the next step is to write you discovery and check function.
A complete plugin looks like the example under “2.9. The complete plug-in at a glance” plus your registering of an snmp section.

The linked example here is a complete SNMP check with all needed parts.

It is not to complicated. Only the detect part is imported from external.