Hello,
I have created my own checks with additional pagest to confirm configuration changes.
My check monitro existence of phisical boards in device, detect any change in configuration, and report it as a error until acknowledged.
It works fine in my existing 2.1.0p44 version of checkmk, but I can’t update to version 2.2.
I have created file in local/share/checkmk/web/plugins/icons to create additional icon in context menu to accept changes and another local/share/checkmk/web/plugins/pages where user can see changes and confirm them.
When using version 2.2.0p46 - my ‘acknowlkedge’ postion exists in context menu, but afer activating it I have typical Apache ‘not found’ page. Whwre is the problem? How can I debug this kind of files? There is no entries in var/log/web.log file.
My icon plugins file: local/share/checkmk/web/plugins/icons/boards.py:
from cmk.gui.utils.urls import makeuri_contextless
from cmk.gui.http import request, response
@icon_and_action_registry.register
class boardsIcon(Icon):
@classmethod
def ident(cls):
return boards"
@classmethod
def title(cls) -> str:
return _("boards")
def service_columns(self):
return ["host_name", "service_description", "check_command"]
def render(self, what, row, tags, custom_vars):
if what != "service" or row[what + "_check_command"] not in [
"check_mk-boards",
]:
return
sitename, hostname, item = row["site"], row["host_name"], row["service_description"]
url = makeuri_contextless(
request,
[("site", sitename), ("host", hostname), ("file", item)],
filename="boards",
)
return "accept", _("acknowledge configuration changess"), url
My page file at local/share/checkmk/web/plugins/pages/board.py
#!/usr/bin/env python3
import datetime
import time
from collections.abc import Iterator
from cmk.gui.breadcrumb import (
Breadcrumb,
BreadcrumbItem,
make_current_page_breadcrumb_item,
make_simple_page_breadcrumb,
)
from cmk.gui.htmllib.header import make_header
from cmk.gui.htmllib.html import html
from cmk.gui.http import request
from cmk.gui.i18n import _
from cmk.gui.logged_in import user
from cmk.gui.main_menu import mega_menu_registry
from cmk.gui.page_menu import (
make_display_options_dropdown,
make_simple_link,
PageMenu,
PageMenuDropdown,
PageMenuEntry,
PageMenuTopic,
)
@cmk.gui.pages.register("boards")
def page_show():
service = request.var("file")
host_name = request.var("host", "")
title = _("hardware configuration changes")
breadcrumb = make_simple_page_breadcrumb(mega_menu_registry.menu_monitoring(), title)
make_header(html, title, breadcrumb, conf_page_menu(breadcrumb))
html.h1 ("Test!!!")
html.footer ()
return
def conf_page_menu(breadcrumb: Breadcrumb) -> PageMenu:
return PageMenu(
dropdowns=[
PageMenuDropdown(
name="cfg_errs",
title=_("Configuration changes"),
topics=[
PageMenuTopic(
title=_("Acknowledge"),
entries=list(conf_acknowledge()),
),
],
),
],
breadcrumb=breadcrumb,
)
def conf_acknowledge(
) -> Iterator[PageMenuEntry]:
yield PageMenuEntry(
title="Configuraton changesa",
icon_name="accept",
item=make_simple_link(
make_confirm_link(
url=makeactionuri(request, transactions, [("func", "1")]),
message=_("Do you really want to acknowledge new configration?")
)
),
is_shortcut=True,
is_suggested=True,
)