Files
patrickandClaude Sonnet 5.5 453c077386 feat: Phase 6d API-Selbsttest gegen Checkmk
Lesender Selbsttest (Version, Services, Hosts, Downtimes) beim Start und
täglich 04:00, Seite /selftest, Teilcheck checkmk_api in /health, Chat-Meldung
bei Wechsel. Toleranter Antwort-Parser (value/members, state_type int/String),
Fallbacks für Host-Abfrage und Downtime-Liste, Fehlerhinweise je HTTP-Status.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 12:55:57 +01:00

38 lines
1.5 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Selbsttest{% endblock %}
{% block content %}
<h1>Selbsttest</h1>
<section class="card">
<p class="muted">Prüft lesend, ob die Checkmk-REST-API wie erwartet antwortet (Version, Service- und Host-Abfrage, Downtime-Abruf). Läuft beim Start, täglich um 04:00 Uhr und bei einem Versionswechsel, ändert nichts in Checkmk. Fallbacks (z. B. GET statt POST) stehen im Text des jeweiligen Teilchecks.</p>
{% if run %}
<p>Checkmk-Version: <strong>{{ run.version or '–' }}</strong> &middot; letzter Lauf: {{ run.ts | fmt_ts }}
<span class="badge {{ 'ok' if run.overall_status == 'ok' else ('warn' if run.overall_status == 'abweichend' else 'error') }}">{{ run.overall_status }}</span>
</p>
<div class="table-wrap">
<table>
<thead><tr><th>Teilcheck</th><th>Status</th><th>Text</th></tr></thead>
<tbody>
{% for c in run.checks %}
<tr>
<td>{{ check_labels.get(c.name, c.name) }}</td>
<td><span class="badge {{ 'ok' if c.status == 'ok' else ('warn' if c.status == 'abweichend' else 'error') }}">{{ c.status }}</span></td>
<td>{{ c.text }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="muted">Noch kein Lauf.</p>
{% endif %}
</section>
{% if user.is_admin %}
<section class="card">
<form method="post" action="/selftest/run">
{{ csrf_input }}
<div class="actions"><button type="submit">Selbsttest jetzt ausführen</button></div>
</form>
</section>
{% endif %}
{% endblock %}