You’re welcome. Here’s an example of my custom icon. It doesn’t do anything useful but at least it shows which methods need to be overwritten and how to pick data from the current check to build a URL. I’m not sure about the
html.makeuri_contextless() function but for my case it works. There are some variants in the other (builtin) icons. I think you can as well build the URL string manually with the usual string formatting operations.
Furthermore, I think it is possible to hide/show an icon depending on a user’s access rights, but I didn’t do that either.
# -*- mode: Python; encoding: utf-8; indent-offset: 4; autowrap: nil -*-
# put the file here: ~/local/share/check_mk/web/plugins/icons/foo.py
from cmk.gui.plugins.views.icons.utils import (
def render(self, what, row, tags, custom_vars):
if (what == 'service' and row['service_check_command'] == 'check_mk-df'):
if row['service_description'] == 'Filesystem /':
host = row["host_name"]
urlvars = [
url = html.makeuri_contextless(urlvars, filename="view.py")
# gives: http://.../SITE/check_mk/view.py?host=...&site=...&view_name=host
# "forth" refers to an icon below ~share/check_mk/web/htdocs/themes/*/images/
return 'forth', _('Jump to %s' % host), url
# True: display icon in column, False: display it in the action menu