{% extends 'admin/master.html' %} {% block body %}

Checkmk Data Quality Check

Provide a list of hostnames — paste them into the text box or upload a CSV — and check them against a Checkmk account's monitoring data. For every host you see whether it is present, whether it exists under a different name/domain, whether its agent works (the Check_MK service), which contact groups may see it and which CMDB template it carries in the syncer. Missing hosts can be created as internal CMDB objects, and hosts that are already there can be given a template afterwards. Checking itself changes nothing in Checkmk.

{% if not accounts %}
No enabled Checkmk (cmkv2) account found. Create one first.
{% endif %}
Paste hostnames here — one per line or separated by commas.
A header column named hostname, host or name is used automatically; otherwise the first column is taken. The pasted text takes precedence if both are filled.

{# Account-wide checks — no host list needed, unrelated to the CSV/paste check above. #}
Account-wide checks

Scan a Checkmk account for hosts with uppercase letters or without a fully-qualified name.

{% if uppercase %}
Hosts with uppercase letters in {{ selected_account }} {{ uppercase.hosts | length }} of {{ uppercase.total }} scanned
{% if uppercase.hosts %}
{% for host in uppercase.hosts %} {% endfor %}
Name in Checkmk Lowercase
{{ host.name }} {{ host.suggested }}
{% else %}

No monitored host in this account has uppercase letters in its name.

{% endif %}
{% endif %} {% if non_fqdn %}
Hosts without an FQDN in {{ selected_account }} {{ non_fqdn.hosts | length }} of {{ non_fqdn.total }} scanned
{% if non_fqdn.hosts %}
{% for host in non_fqdn.hosts %} {% endfor %}
Name in Checkmk (no domain part)
{{ host.name }}
{% else %}

Every monitored host in this account has a fully-qualified name.

{% endif %}
{% endif %} {% if report %} {% set s = report.summary %}
Summary for {{ selected_account }}
Checked: {{ s.total }} Present: {{ s.found }} Different name: {{ s.domain_mismatch }} Missing: {{ s.missing }} · Agent OK: {{ s.agent_ok }} Agent problem: {{ s.agent_problem }} No agent: {{ s.no_agent }} · In CMDB: {{ s.in_cmdb }} With template: {{ s.with_template }} Without template: {{ s.without_template }}
{% for row in report.results %} {% endfor %}
Host Status Name in Checkmk Host state Agent CMDB template Contact groups
{{ row.hostname }} {% if row.status == 'found' %} Present {% elif row.status == 'domain_mismatch' %} Different name {% else %} Not found {% endif %} {% if row.status == 'domain_mismatch' %} {{ row.matched_names | join(', ') }} {% elif row.status == 'found' %} (same) {% else %} {% endif %} {% if row.host_state == 'UP' %} UP {% elif row.host_state is not none %} {{ row.host_state }} {% else %} {% endif %} {% if row.agent_state == 'OK' %} OK {% elif row.agent_state is not none %} {{ row.agent_state }} {% elif row.exists %} No agent {% else %} {% endif %} {% if row.cmdb_name is none %} not in CMDB {% elif row.cmdb_templates %} {% for tpl in row.cmdb_templates %} {{ tpl }} {% endfor %} {% else %} no template {% endif %} {% if row.contact_groups %} {% for group in row.contact_groups %} {{ group }} {% endfor %} {% elif row.exists %} none {% else %} {% endif %}
{# One list for every template picker on the page — both forms point at it. #} {% for tpl in templates %} {% endfor %} {% set missing = report.results | selectattr('status', 'equalto', 'missing') | list %} {% if missing %}
Create {{ missing | length }} missing host(s) in the internal CMDB

The selected hosts are created as syncer-managed objects (source cmdb). The normal Checkmk export then rolls them out. Optionally apply CMDB templates so they inherit their labels/attributes.

{% for tpl in templates %}
{% endfor %}
Pick any number of the {{ templates | length }} available template(s); the new hosts carry all of them. None means no template.
Appended to every selected host that has no domain part; hosts already given as an FQDN stay unchanged.
{% for row in missing %}
{% endfor %}
{% endif %} {% set existing = report.results | selectattr('cmdb_name') | list %} {% if existing %} {% set untemplated = existing | rejectattr('cmdb_templates') | list %}
Assign a CMDB template to existing host(s) {{ existing | length }} in CMDB {{ untemplated | length }} without template

These hosts are already in the CMDB. The chosen template is added to the templates they carry — nothing is replaced or removed, and hosts that already have it stay untouched. Only the hosts without a template are preselected.

Start typing to filter the {{ templates | length }} available template(s).
{% for row in existing %}
{% endfor %}
{% endif %} {% endif %}
{% endblock %}