{% extends 'generic/_base.html' %} {% load helpers %} {% block title %}Link from Checkmk to NetBox: {{ object }}{% endblock %} {% block content %}
Optional. An icon next to each host in the Checkmk monitoring views that opens the host in NetBox (a NetBox search for the host name). The plugin does not set this up: both steps are done by hand in Checkmk, the plugin only checks whether a rule exists. You can leave it out.

State {{ object|linkify }}{% if object.checked_at %}, checked {{ object.checked_at|isodatetime:"minutes" }}{% endif %}

{% if item %} {% if item.status == 'ok' %}ok{% else %}not set up{% endif %} {{ item.detail }} {% else %} Not checked yet. {% endif %}
{% if can_check %} {% endif %}

1. Define the action (global setting)

In Checkmk: Setup > General > Global settings > User interface > Custom icons and actions. Open in Checkmk

Add a new element:

IDnetbox
Iconany icon you like
TitleOpen in NetBox
Action > URL{{ action_url }}
Action > Open inLoad in a new window / tab
Show in columnon, if the icon should show directly next to the host

The address of NetBox comes from netbox_url in the plugin settings, or else from the address you opened this page with. It must be the address Checkmk users reach NetBox at. $HOSTNAME_URL_ENCODED$ is filled in by Checkmk.

2. Show it on the hosts (rule)

In Checkmk: Setup > Hosts > Host monitoring rules > Various > Custom icons or actions for hosts in status GUI. Open in Checkmk

Valuethe icon netbox from step 1
Folder/{{ object.prefix }} (the hosts of this instance)
{% if outside_profiles %}
These mapping profiles may put hosts outside /{{ object.prefix }}; leave the folder condition out or add a rule for their folders: {% for p in outside_profiles %}{{ p|linkify }} ({{ p.folder_template }}){% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}

3. Activate and check

Activate the changes in Checkmk, then Check again above. The check turns ok as soon as the rule set Custom icons or actions for hosts in status GUI has a rule.
{% include "netbox_checkmk_sync/inc/busy.html" %} {% endblock %}