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.

Ok so I can use that example above you gave me, put my Register definition and it should work?

Also, where does this script goes? I can’t manage to find the folder for it

I don’t know if the OIDs that I have on the firewall will even work to get the DHCP Scope.
I’m working with watchguard firewalls… They don’t show the amount of IPs I have left or a percentage of used DHCP pool… So I’ll probably have to do some operations (max range of ips minus the number of entries?)…
Is there any possibility of getting someone from checkmk or so, to help to build the Plugin?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.