I just wrote my first SNMP plugin for Mikrotik QoS (QueueTrees) and that works at last with the help of this forum. Now I try to make the parameters for this plugin not just hard coded, but changeable via a rule.
According to the (german) manual (Eine eigene Regelkette definieren) I wrote a file and placed it in local/share/check_mk/web/plugins/wato
. But after a “omd restart apache” the rule do not appear in the rule search.
Any help appreceated - thanks,
Bernhard
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2022 Bernhard Voit - License: GNU General Public License v2
# check_parameter definition for the mikrotik_queuetree
from cmk.gui.i18n import _
from cmk.gui.ValueSpec import (
Dictionary,
Float,
TextAscii,
)
from cmk.gui.plugins.wato import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _item_valuespec_mikrotik_queuetree():
return TextAscii(title=_("Queue Name"))
def _parameter_valuespec_mikrotik_queuetree():
return Dictionary(
elements=[
("warn_level", Float(title=_("Warning above Drops per second"))),
("ctit_level", Float(title=_("Critical above Drops per second"))),
],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="mikrotik_queuetree",
group=RulespecGroupCheckParametersNetworking,
match_type="dict",
item_spec=_item_valuespec_mikrotik_queuetree,
parameter_valuespec=_parameter_valuespec_mikrotik_queuetree,
title=lambda: _("Mikrotik QueueTree Parameters"),
))