{% extends 'admin/master.html' %} {% macro action_button(action, label, css, icon, confirm='') %}
{% endmacro %} {# Render one host-selection condition (FullCondition) as readable text. #} {% macro render_cond(c) %} {% if c.match_type == 'host' %} Hostname {{ 'NOT ' if c.hostname_match_negate }}{{ c.hostname_match }} “{{ c.hostname }}” {% else %} Attribute “{{ c.tag }}” {{ 'NOT ' if c.value_match_negate }}{{ c.value_match }} “{{ c.value }}” {% endif %} {% endmacro %} {% block body %}

Project: {{ project.name }}

Back to projects
{% if project.documentation %}

{{ project.documentation }}

{% endif %}
Exported to accounts
{% if project.limit_by_accounts %} {{ project.limit_by_accounts | join(', ') }} {% else %} all accounts (no account filter set) {% endif %}
Assigned Rules
{{ project_rules.count() }}
Assigned DCD Rules
{{ dcd_rules.count() }}
Import Rules from Checkmk Folder {{ action_button('export', 'Export as JSON', 'btn-secondary', 'fa-file-code-o') }}

Rules in this project

Add rule Manage in rule list
{% if project_rules.count() == 0 %}
No rules assigned to this project yet. Create a rule and set its Project to {{ project.name }}, or import rules from a Checkmk folder above.
{% else %} {% for rule in project_rules %}
{{ rule.name }} {% if rule.static_rule %} static {% endif %} {% if rule.enabled %} enabled {% else %} disabled {% endif %} Edit
Applies to: {% if rule.static_rule %} host-independent (rendered once) {% elif rule.condition_typ == 'anyway' or not rule.conditions %} all hosts {% else %} ({{ 'all' if rule.condition_typ == 'all' else 'any' }} of)
    {% for c in rule.conditions %}
  • {{ render_cond(c) }}
  • {% endfor %}
{% endif %}
{% for o in rule.outcomes %}
Ruleset: {{ o.ruleset or '—' }} Folder: {{ o.folder or '/' }} {% if o.condition_host %} Host cond: {{ o.condition_host }} {% endif %} {% if o.condition_label_template %} Label cond: {{ o.condition_label_template }} {% endif %} {% if o.condition_service %} Service: {{ o.condition_service }} {% endif %}
Rule value:
{{ o.value_template or '—' }}
{% endfor %}
{% endfor %} {% endif %}

DCD rules in this project

Add DCD rule Manage in DCD list
{% if dcd_rules.count() == 0 %}
No DCD rules assigned to this project yet. Open a DCD rule and set its Project to {{ project.name }} to add it here. Assigned DCD rules also follow this project's account filter on export.
{% else %} {% for rule in dcd_rules %}
{{ rule.name }} {% if rule.static_rule %} static {% endif %} {% if rule.enabled %} enabled {% else %} disabled {% endif %} Edit
Applies to: {% if rule.condition_typ == 'anyway' or not rule.conditions %} all hosts {% else %} ({{ 'all' if rule.condition_typ == 'all' else 'any' }} of)
    {% for c in rule.conditions %}
  • {{ render_cond(c) }}
  • {% endfor %}
{% endif %}
{% for o in rule.outcomes %}
Connection: {{ o.dcd_id or '—' }} Title: {{ o.title or '—' }} Site: {{ o.site or '—' }} Connector: {{ o.connector_type or '—' }}
{% endfor %}
{% endfor %} {% endif %}
{% endblock %}