CMK_Raw 2.1.0p2

Hello,

i am currently writing a snmp check for CMK 2.1, the check itself works fine,
but now i need a custom rule to specify the parameters for the check.

For this i followed the guide on, section 10.3:

My check is called cisco_firmware.py and the wato rulespec file is called cisco_firmware_parameters.py.
Here is the rulespec file under /opt/omd/sites/test/local/share/check_mk/web/plugins/wato

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from cmk.gui.i18n import _

from cmk.gui.valuespec import (
    Dictionary,
    TextAscii,
    TextInput,
)

from cmk.gui.plugins.wato.utils import (
    CheckParameterRulespecWithoutItem,
    rulespec_registry,
    RulespecGroupCheckParametersNetworking,
)

def _parameter_valuespec_cisco_firmware():
    return Dictionary(
        elements=[
            ("to_version", TextAscii(title=_("Intended IOS Version"),
        ],
    )
    
rulespec_registry.register(
    CheckParameterRulespecWithoutItem(
        check_group_name="cisco_firmware",
        group=RulespecGroupCheckParametersNetworking,
        match_type="dict",
        parameter_valuespec=_parameter_valuespec_cisco_firmware,
        title=lambda: _("Cisco Firmware"),
    ))

Now after i restart the apache with omd restart apache , I should find this new rule under
Setup --> Services --> Service monitoring rules and then in the networking categorie, but its not there?

Does someone know if there is something wrong with my rulespec file?
Or is there a way do debug if the file is even read?

Thank you in advance :slight_smile:

1 Like

If there is a syntax problem in the file you should see a error message inside the “~/var/log/web.log”.

1 Like