fuh-gpl / check_mk-plugins

3 stars 2 forks source link

Check parameter definition for informix_dbspaces has type Dictionary, but match_type None #2

Closed eandresr closed 5 years ago

eandresr commented 5 years ago

Check_mk last version (1.5.11)

Configured the py into /omd/sites//local/share/check_mk/web/plugins/wato

with (just a slice):
register_check_parameters(
    subgroup_applications,
    "informix_dbspaces",
    _("IBM Informix dbspaces"),
    Dictionary(
        help = _("This check monitors various aspects of IBM Informix dbspaces"),
        elements = [
            ("levels",
                Alternative(
                    title = _("Dbspace usage levels"),
                    elements = [
                        Tuple(
                             title = _("Percentage free space"),
                             elements = [
                                 Percentage(title = _("Warning below"), unit = _("% free")),
                                 Percentage(title = _("Critical below"), unit = _("% free")),
                             ],),
                        Tuple(
                             title = _("Absolute free space"),
                             elements = [
                                 Integer(title = _("Warning lower than"), unit = _("MB")),
                                 Integer(title = _("Critical lower than"), unit = _("MB")),
                             ],),
                ]
                ),
            ),
    ],
    ),
    TextAscii(
        title = _("Dbspace"),
        allow_empty = False
    ),
    "None",
    )

It returns "Check parameter definition for informix_dbspaces has type Dictionary, but match_type None" on Check_mk web portal

I tried to set dic/Dict/Dictionary instead of "None", but everything failed!

eandresr commented 5 years ago

fixed by myself... the problem is the match_type "None", because the item is a Dictionary, so you shoud change the last "None" in every item by "dict" as follows:

try:
    register_check_parameters(
        subgroup_applications,
        "informix_dbspaces",
        _("IBM Informix dbspaces"),
        Dictionary(
            help = _("This check monitors various aspects of IBM Informix dbspaces"),
            elements = [
                ("levels",
                    Alternative(
                        title = _("Dbspace usage levels"),
                    elements = [
                            Tuple(
                                 title = _("Percentage free space"),
                                 elements = [
                                     Percentage(title = _("Warning below"),  unit = _("% free")),
                                     Percentage(title = _("Critical below"), unit = _("% free")),
                                 ],),
                            Tuple(
                                 title = _("Absolute free space"),
                                 elements = [
                                     Integer(title = _("Warning lower than"), unit = _("MB")),
                                     Integer(title = _("Critical lower than"), unit = _("MB")),
                                 ],),
                    ]
                    ),
                ),
        ],
        ),
        TextAscii(
            title = _("Dbspace"),
            allow_empty = False
        ),
        "dict"
        )
except NameError:
    # check_mk version too old for register_check_parameters
    pass