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

Preview Generated Checkmk Users

What the generation rules would make of the hosts you have right now. The same host attributes are read, the same groups are looked up in the directory and the same Jinja is rendered as in a real run — only the writing is left out. Nothing is created, updated or deleted here. Documentation

{% if not rules %}
No enabled generation rule found. Create one under Generate Checkmk Users first.
{% endif %}
Optional. Replaces the group search filter of every rule for this preview only.
{% if error %}
{{ error }}
{% endif %} {% for level, message in errors %}
{{ level }}: {{ message }}
{% endfor %} {% if rows is not none %} {% if not rows %}
No group selected by these rules. The hosts carry nothing in the attribute the rule reads, or every value was skipped by the rewrite.
{% else %}

{{ rows|length }} group(s). new in Checkmk = no user with this ID exists yet and one would be created, update = the user exists and the marked fields would change, already correct = the user exists and nothing would change, skipped = no user is written, with the reason next to it.

{% for row in rows %} {% endfor %}
Rule Host value Searched as In the directory Checkmk user ID In Checkmk Fields of that user
{{ row.rule }} {{ row.original_name }} {{ row.name }} {% if row.name != row.original_name %} rewritten {% endif %} {% if not row.searched %} no LDAP account on the rule, not looked up {% elif row.found %} found, {{ row.attributes|length }} attribute(s) {% else %} no such group in the directory {% endif %} {{ row.user_id or '—' }} {% if row.action == 'create' %} new in Checkmk {% elif row.action == 'update' %} update {% elif row.action == 'unchanged' %} already correct {% else %} skipped {% endif %} {% if row.note %} {{ row.note }} {% else %} {% for field in ['full_name', 'email', 'pager_address', 'roles', 'contact_groups', 'disable_login'] %} {% set value = row.rendered.get(field) %} {% endfor %}
{{ field }} {% if value is sameas true or value is sameas false %} {{ value }} {% elif value is string %} {% if value %}{{ value }} {% elif field in row.fields %} renders to nothing, keeps {{ row.fields[field] }} {% else %} renders to nothing, stays empty {% endif %} {% elif value %} {{ value|join(', ') }} {% else %} no entry left after rendering {% endif %} {% if field in row.changed and row.action == 'update' %} changes {% endif %}
Variables the group carries ({{ row.attributes|length }}) {% if not row.attributes %}

{% if not row.searched %} The rule has no LDAP account, so the directory was never asked and no variable exists. Every Jinja field can only use {{ '{{name}}' }} and {{ '{{original_name}}' }}. {% else %} The directory returned nothing for this group, so no variable exists. Check the group base DN, the group search filter and the group name attribute of the rule. {% endif %}

{% endif %} {% if row.attributes %} {% for key, value in row.attributes.items() %} {% endfor %}
{{ '{{' }}{{ key }}{{ '}}' }} {{ value }}
{% endif %}
{% endif %}
{% endif %} {% endif %}
{% endblock %}