r.sander
(Robert Sander)
July 1, 2025, 9:50am
1
Hi @moritz ,
why do we need to hardcode a “reference_metric” in the ruleset if we want to use PredictiveLevels?
This was not necessary in the past. The check_levels method got and still gets a metric_name and value.
I have a check plugin where the metric names are not predictable (pun intended).
How would I now implement the ruleset for that?
This is the old ruleset:
#!/usr/bin/env python3
# -*- encoding: utf-8; py-indent-offset: 4 -*-
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
ListOfStrings,
TextAscii,
)
from cmk.gui.plugins.wato import (
rulespec_registry,
CheckParameterRulespecWithItem,
Levels,
RulespecGroupCheckParametersApplications,
)
def _item_spec_otrs():
return TextAscii(title = _('OTRS Queue Name'))
This file has been truncated. show original
And this is the check plugin:
if isinstance(paramstate[state], tuple):
yield from check_levels(
total,
levels_upper=paramstate[state],
metric_name=dsname,
label=state,
render_func=_render_tickets,
notice_only=True,
)
elif isinstance(paramstate[state], dict):
yield from check_levels_predictive(
total,
levels=paramstate[state],
metric_name=dsname,
label=state,
render_func=_render_tickets,
)
else:
yield Metric(dsname, total)
yield Result(state=State.OK,
notice='%s: %s' % (state, _render_tickets(total)))
Within the application OTRS the admin is able to define their own ticket states. Therefor I cannot pre-define them in a ruleset.
Sara
July 1, 2025, 11:30am
2
Hi @r.sander !
We are planning one more DevHour where we could discuss all the DevAPI questions.
It is planned for 16th of July, at 3PM. I will announce it with more details beginning of the next week or so.
Maybe we could collect the questions and discuss them on the call if the time works for you?
r.sander
(Robert Sander)
July 1, 2025, 11:56am
3
Yes, that date works for me. Thanks for the suggestion.
1 Like
Sara
July 3, 2025, 7:14am
4
Hello Community! Here is the next DevHour Announcement!
It is time to announce the next Developer Hour for Checkmk extension developers!
@moritz will join us on the call to answer your questions about plug-in migration and the new DevAPIs. Do not miss the opportunity to have your questions answered!
Add your questions in advance here and join us on Zoom on July 16th, at 3PM Berlin time.
Questions asked during the call will also be answered but for more complicated questions it is more…
The call is scheduled I have already added your 2 questions into the document.
1 Like
r.sander
(Robert Sander)
July 16, 2025, 1:21pm
5
I have to remove the predicted level from the check plugin.