A ticket records a known problem: title, area, hosts, subject, description, links to alert rules and anomalies, and a log of comments, edits, resolving and reopening. Opening, resolving (with the resolution as the note) and reopening go on the timeline; every step is audited, and the audit rows stay off the timeline. An alert or anomaly an open ticket covers (by link, by subject, or a host-wide ticket on the host itself) shows a Known issue badge, and offers "Open a ticket" prefilled from its rule or anomaly when none does. Hosts, monitors and containers get a Known issues card. MCP: list_tickets, get_ticket (viewer); open_ticket, update_ticket, comment_ticket, resolve_ticket, reopen_ticket (operator). list_alerts and list_anomalies carry known_issue; get_overview, get_host, get_monitor and get_container carry open_tickets. Also update_change and delete_change for changes recorded by hand (author or admin). Tickets are left out of backups, like the timeline (2026-10-15 ruling). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
4.5 KiB
HTML
76 lines
4.5 KiB
HTML
{# alerts/_active.html — the Alerts page's verdict and Active section, polled
|
|
on their own (#5315): one line that says what is firing, how many rules
|
|
there are and where their notifications go; then the alerts themselves,
|
|
firing first, then no data, then acknowledged, then pending
|
|
(alert_svc.active_rows). An acknowledged alert says how long it has been
|
|
breaching, and apart from that who acknowledged it and when. One an open
|
|
ticket covers is a known issue, linked to it; the rest offer a ticket. #}
|
|
{% from "_macros.html" import status_badge %}
|
|
{% set can_edit = session.user_role in ('operator', 'admin') %}
|
|
{% set words = {"firing": "firing", "no_data": "silent", "acknowledged": "acknowledged", "pending": "pending"} %}
|
|
<p class="page-verdict">
|
|
{%- set firing = active|selectattr("label", "equalto", "firing")|list|length %}
|
|
{%- if firing %}<strong class="tone-crit">{{ firing }} firing</strong>
|
|
{%- elif active %}<strong class="tone-warn">Nothing is firing</strong>
|
|
{%- else %}<strong class="tone-ok">Nothing is firing</strong>{% endif %}
|
|
{%- for key in ("no_data", "acknowledged", "pending") %}
|
|
{%- set n = active|selectattr("label", "equalto", key)|list|length %}
|
|
{%- if n %} · <span class="tone-warn">{{ n }} {{ words[key] }}</span>{% endif %}
|
|
{%- endfor %}
|
|
{%- if rules_total %} · {{ rules_total }} rule{{ "s" if rules_total != 1 }}{% if rules_off %}, {{ rules_off }} off{% endif %}{% endif %}
|
|
{%- if notify %} · notifies {{ notify|join(" and ") }}
|
|
{%- else %} · <span class="tone-warn" title="No email server with recipients and no webhook URL is set, so an alert that fires tells no one">notifies nobody yet</span>
|
|
{%- if session.user_role == 'admin' %} — <a href="/settings/notifications/">set up email or a webhook</a>{% endif %}{% endif %}
|
|
</p>
|
|
{% if active %}
|
|
<h2 class="section-title" style="margin-bottom:1rem;">Active</h2>
|
|
<div class="card-flush" style="margin-bottom:2rem;">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>State</th>
|
|
<th>What is wrong</th>
|
|
<th>Rule</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in active %}
|
|
<tr>
|
|
<td>
|
|
{{ status_badge(row.label, title=("No sample since " ~ (row.state.last_sample_at.strftime('%Y-%m-%d %H:%M UTC') if row.state.last_sample_at else 'the rule started watching')) if row.label == 'no_data' else none) }}
|
|
{% if row.state.no_data_since and row.label != 'no_data' %}
|
|
{{ status_badge('no_data', title="Silent since " ~ row.state.no_data_since.strftime('%Y-%m-%d %H:%M UTC')) }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{{- row.says.lead -}}
|
|
{%- if row.url %}<a href="{{ row.url }}">{{ row.says.resource }}</a>{% else %}<strong>{{ row.says.resource }}</strong>{% endif -%}
|
|
{{- row.says.tail -}}
|
|
{%- if row.tickets %}
|
|
<div class="field-hint" style="margin-top:0.15rem;">{{ status_badge("known_issue") }}
|
|
{% for t in row.tickets %}<a href="/tickets/{{ t.id }}">#{{ t.id }} {{ t.title }}</a>{{ ", " if not loop.last }}{% endfor %}</div>
|
|
{%- endif %}
|
|
{%- if row.label == 'acknowledged' and row.state.acknowledged_at %}
|
|
<div class="field-hint" style="margin-top:0.15rem;">Acknowledged{% if row.acked_by %} by {{ row.acked_by }}{% endif %} {{ row.state.acknowledged_at|ago }}</div>
|
|
{%- endif %}
|
|
</td>
|
|
<td style="color:var(--text-muted);"><a href="/alerts/history?rule={{ row.rule.id }}">{{ row.rule.name }}</a></td>
|
|
<td class="td-actions">
|
|
{% if can_edit and row.state.state.value == 'firing' %}
|
|
<form method="post" action="/alerts/{{ row.rule.id }}/acknowledge" style="display:inline;">{{ csrf_field() }}
|
|
<button type="submit" class="btn btn-sm btn-warn">Acknowledge</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if can_edit and not row.tickets %}
|
|
<a class="btn btn-sm btn-ghost" href="/tickets/new?rule={{ row.rule.id|urlencode }}&back=/alerts/"
|
|
title="A known problem that will take a while: keep its notes and its fix in one place">Open a ticket</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|